From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:6f8:1178:4:290:27ff:fe1d:cc33]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WBS1H-0004gq-6a for barebox@lists.infradead.org; Thu, 06 Feb 2014 16:41:49 +0000 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Thu, 6 Feb 2014 17:40:53 +0100 Message-Id: <1391704854-3141-9-git-send-email-u.kleine-koenig@pengutronix.de> In-Reply-To: <1391704854-3141-1-git-send-email-u.kleine-koenig@pengutronix.de> References: <1391704854-3141-1-git-send-email-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 8/9] nfs: switch to nfs3 To: barebox@lists.infradead.org VGhpcyB3YXMgdGVzdGVkIGFnYWluc3QgbmZzLWtlcm5lbC1zZXJ2ZXIgYW5kIHVuZnMzLgoKU2ln bmVkLW9mZi1ieTogVXdlIEtsZWluZS1Lw7ZuaWcgPHUua2xlaW5lLWtvZW5pZ0BwZW5ndXRyb25p eC5kZT4KLS0tCiBmcy9uZnMuYyB8IDg1OSArKysrKysrKysrKysrKysrKysrKysrKysrKysrKysr KysrKysrKysrKysrKy0tLS0tLS0tLS0tLS0tLS0tLS0KIDEgZmlsZSBjaGFuZ2VkLCA2MDggaW5z ZXJ0aW9ucygrKSwgMjUxIGRlbGV0aW9ucygtKQoKZGlmZiAtLWdpdCBhL2ZzL25mcy5jIGIvZnMv bmZzLmMKaW5kZXggMzczMTU5ZDZmZmI3Li44ZWVjNjMwNzhkZDMgMTAwNjQ0Ci0tLSBhL2ZzL25m cy5jCisrKyBiL2ZzL25mcy5jCkBAIC0xLDEwICsxLDEyIEBACiAvKg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IHR5cGVkZWYgdWludDY0IHNpemUzOworICoKKyAqIHR5cGVkZWYgc3RyaW5nIGZp bGVuYW1lMzw+OworICogdHlwZWRlZiBzdHJpbmcgbmZzcGF0aDM8PjsKKyAqCisgKiB0eXBlZGVm IG9wYXF1ZSBjb29raWV2ZXJmM1tORlMzX0NPT0tJRVZFUkZTSVpFXTsKKyAqCisgKiBlbnVtIGZ0 eXBlMyB7CisgKiAJTkYzUkVHID0gMSwKKyAqIAlORjNESVIgPSAyLAorICogCU5GM0JMSyA9IDMs CisgKiAJTkYzQ0hSID0gNCwKKyAqIAlORjNMTksgPSA1LAorICogCU5GM1NPQ0sgPSA2LAorICog CU5GM0ZJRk8gPSA3CisgKiB9OworICoKKyAqIHN0cnVjdCBzcGVjZGF0YTMgeworICogCXVpbnQz MiBzcGVjZGF0YTE7CisgKiAJdWludDMyIHNwZWNkYXRhMjsKKyAqIH07CisgKgorICogc3RydWN0 IG5mc19maDMgeworICogCW9wYXF1ZSBkYXRhPE5GUzNfRkhTSVpFPjsKKyAqIH0KKyAqCisgKiBz dHJ1Y3QgbmZzdGltZTMgeworICogCXVpbnQzMiBzZWNvbmRzOworICogCXVpbnQzMiBuc2Vjb25k czsKKyAqIH07CisgKgorICogc3RydWN0IGZhdHRyMyB7CisgKiAJZnR5cGUzIHR5cGU7CisgKiAJ bW9kZTMgbW9kZTsKKyAqIAl1aW50MzJfdCBubGluazsKKyAqIAl1aWQzIHVpZDsKKyAqIAlnaWQz IGdpZDsKKyAqIAlzaXplMyBzaXplOworICogCXNpemUzIHVzZWQ7CisgKiAJc3BlY2RhdGEzIHJk ZXY7CisgKiAJdWludDY0X3QgZnNpZDsKKyAqIAlmaWxlaWQzIGZpbGVpZDsKKyAqIAluZnN0aW1l MyBhdGltZTsKKyAqIAluZnN0aW1lMyBtdGltZTsKKyAqIAluZnN0aW1lMyBjdGltZTsKKyAqIH07 CisgKgorICogc3RydWN0IGRpcm9wYXJnczMgeworICogCW5mc19maDMgZGlyOworICogC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dDoKKwkJcHJpbnRmKCIlczogaW52YWxpZCBtb2RlICV4XG4iLAor CQkJCV9fZnVuY19fLCBudG9obChuZXRfcmVhZF91aW50MzIocCArIDApKSk7CisJCXJldHVybiAt RUlPOworCX0KKworCS8qIG9mZnNldG9mKHN0cnVjdCBmYXR0cjMsIG1vZGUpID0gNCAqLworCW1v ZGUgPSBudG9obChuZXRfcmVhZF91aW50MzIocCArIDEpKTsKKwlmb3IgKGkgPSAwOyBpIDwgQVJS QVlfU0laRShuZnMzX21vZGVfYml0cyk7ICsraSkgeworCQlpZiAobW9kZSAmIG5mczNfbW9kZV9i aXRzW2ldLm5mc21vZGUpCisJCQlzLT5zdF9tb2RlIHw9IG5mczNfbW9kZV9iaXRzW2ldLnN0YXRt b2RlOworCX0KKworCS8qIG9mZnNldG9mKHN0cnVjdCBmYXR0cjMsIHNpemUpID0gMjAgKi8KKwlz LT5zdF9zaXplID0gbnRvaGxsKG5ldF9yZWFkX3VpbnQ2NChwICsgNSkpOworCisJcmV0dXJuIDA7 Cit9CisKK3N0YXRpYyB1aW50MzJfdCAqbmZzX3JlYWRfcG9zdF9vcF9hdHRyKHVpbnQzMl90ICpw LCBzdHJ1Y3Qgc3RhdCAqKnMpCit7CisJc3RydWN0IHN0YXQgZHVtbXk7CisJLyoKKwkgKiB1bmlv biBwb3N0X29wX2F0dHIgc3dpdGNoIChib29sIGF0dHJpYnV0ZXNfZm9sbG93KSB7CisJICogY2Fz ZSBUUlVFOgorCSAqIAlmYXR0cjMgYXR0cmlidXRlczsKKwkgKiBjYXNlIEZBTFNFOgorCSAqIAl2 b2lkOworCSAqIH07CisJICovCisKKwlpZiAobnRvaGwobmV0X3JlYWRfdWludDMyKHArKykpKSB7 CisJCW5mc19mYXR0cjNfdG9fc3RhdChwLCBzID8gKnMgOiAmZHVtbXkpOworCQlwICs9IDIxOwor CX0gZWxzZSBpZiAocykgeworCQkvKiBubyBhdHRyaWJ1dGVzIGF2YWlsYWJsZSAqLworCQkqcyA9 I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cHJpdiAqcHJpdiwgaW50 ICpwbGVuLCB1aW50MzJfdCBjb29raWUpCisvKgorICogcmV0dXJucyB3aXRoIGRpci0+c3RyZWFt IHBvaW50aW5nIHRvIHRoZSBmaXJzdCBlbnRyeQorICogb2YgZGlybGlzdDMgcmVzLnJlc29rLnJl cGx5CisgKi8KK3N0YXRpYyB2b2lkICpuZnNfcmVhZGRpcmF0dHJfcmVxKHN0cnVjdCBmaWxlX3By aXYgKnByaXYsIHN0cnVjdCBuZnNfZGlyICpkaXIpCiB7CiAJdWludDMyX3QgZGF0YVsxMDI0XTsK IAl1aW50MzJfdCAqcDsKQEAgLTUxNywyNiArNzg5LDc5IEBAIHN0YXRpYyB2b2lkICpuZnNfcmVh ZGRpcmF0dHJfcmVxKHN0cnVjdCBmaWxlX3ByaXYgKnByaXYsIGludCAqcGxlbiwgdWludDMyX3Qg Y29vCiAJaW50IHJldDsKIAl2b2lkICpidWY7CiAKKwkvKgorCSAqIHN0cnVjdCBSRUFERElSM2Fy Z3MgeworCSAqIAluZnNfZmgzIGRpcjsKKwkgKiAJY29va2llMyBjb29raWU7CisJICogCWNvb2tp ZXZlcmYzIGNvb2tpZXZlcmY7CisJICogCWNvdW50MyBjb3VudDsKKwkgKiB9OworCSAqCisJICog c3RydWN0IGVudHJ5MyB7CisJICogCWZpbGVpZDMgZmlsZWlkOworCSAqIAlmaWxlbmFtZTMgbmFt ZTsKKwkgKiAJY29va2llMyBjb29raWU7CisJICogCWVudHJ5MyAqbmV4dGVudHJ5OworCSAqIH07 CisJICoKKwkgKiBzdHJ1Y3QgZGlybGlzdDMgeworCSAqIAllbnRyeTMgKmVudHJpZXM7CisJICog CWJvb2wgZW9mOworCSAqIH07CisJICoKKwkgKiBzdHJ1Y3QgUkVBRERJUjNyZXNvayB7CisJICog CXBvc3Rfb3BfYXR0ciBkaXJfYXR0cmlidXRlczsKKwkgKiAJY29va2lldmVyZjMgY29va2lldmVy ZjsKKwkgKiAJZGlybGlzdDMgcmVwbHk7CisJICogfTsKKwkgKgorCSAqIHN0cnVjdCBSRUFERElS M3Jlc2ZhaWwgeworCSAqIAlwb3N0X29wX2F0dHIgZGlyX2F0dHJpYnV0ZXM7CisJICogfTsKKwkg KgorCSAqIHVuaW9uIFJFQURESVIzcmVzIHN3aXRjaCAobmZzc3RhdDMgc3RhdHVzKSB7CisJICog Y2FzZSBORlMzX09LOgorCSAqIAlSRUFERElSM3Jlc29rIHJlc29rOworCSAqIGRlZmF1bHQ6CisJ ICogCVJFQURESVIzcmVzZmFpbCByZXNmYWlsOworCSAqIH07CisJICovCisKIAlwID0gJihkYXRh WzBdKTsKIAlwID0gcnBjX2FkZF9jcmVkZW50aWFscyhwKTsKIAotCW1lbWNweShwLCBwcml2LT5m aWxlZmgsIE5GU19GSFNJWkUpOwotCXAgKz0gKE5GU19GSFNJWkUgLyA0KTsKLQkqcCsrID0gaHRv bmwoY29va2llKTsgLyogY29va2llICovCi0JKnArKyA9IGh0b25sKDEwMjQpOyAvKiBjb3VudCAq LwotCSpwKysgPSAwOworCXAgPSBuZnNfYWRkX2ZoMyhwLCBwcml2LT5maWxlZmhfbGVuLCBwcml2 LT5maWxlZmgpOworCXAgPSBuZnNfYWRkX3VpbnQ2NChwLCBkaXItPmNvb2tpZSk7CiAKLQlsZW4g PSBwIC0gJihkYXRhWzBdKTsKKwltZW1jcHkocCwgZGlyLT5jb29raWV2ZXJmLCBORlMzX0NPT0tJ RVZFUkZTSVpFKTsKKwlwICs9IE5GUzNfQ09PS0lFVkVSRlNJWkUgLyA0OworCisJcCA9IG5mc19h ZGRfdWludDMyKHAsIDEwMjQpOyAvKiBjb3VudCAqLwogCi0JcmV0ID0gcnBjX3JlcShwcml2LT5u cHJpdiwgUFJPR19ORlMsIE5GU19SRUFERElSLCBkYXRhLCBsZW4pOworCXJldCA9IHJwY19yZXEo cHJpdi0+bnByaXYsIFBST0dfTkZTLCBORlNQUk9DM19SRUFERElSLCBkYXRhLCBwIC0gZGF0YSk7 CiAJaWYgKH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