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 1WBsyn-000056-AA for barebox@lists.infradead.org; Fri, 07 Feb 2014 21:29:01 +0000 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Fri, 7 Feb 2014 22:28:11 +0100 Message-Id: <1391808493-27328-9-git-send-email-u.kleine-koenig@pengutronix.de> In-Reply-To: <1391808493-27328-1-git-send-email-u.kleine-koenig@pengutronix.de> References: <1391808493-27328-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 v2 09/11] nfs: switch to nfs3 To: barebox@lists.infradead.org VGhpcyB3YXMgdGVzdGVkIGFnYWluc3QgbmZzLWtlcm5lbC1zZXJ2ZXIgYW5kIHVuZnMzLgoKU2ln bmVkLW9mZi1ieTogVXdlIEtsZWluZS1Lw7ZuaWcgPHUua2xlaW5lLWtvZW5pZ0BwZW5ndXRyb25p eC5kZT4KLS0tCgpOb3RlczoKICAgIENoYW5nZXMgc2luY2UgaW1wbGljaXQgdjE6CiAgICAtIGZp eCBQUk9HX01PVU5UIHZlcnNpb24gdG8gMwogICAgLSBhZGQgZW1wdHkgbGluZSBhcyByZXF1ZXN0 ZWQgYnkgSmVhbi1DaHJpc3RvcGhlCiAgICAtIHVzZSB7aHRvbixudG9ofXsxNiwzMiw2NH0KCiBm cy9uZnMuYyB8IDg5NCArKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysr Ky0tLS0tLS0tLS0tLS0tLS0tLS0KIDEgZmlsZSBjaGFuZ2VkLCA2MjUgaW5zZX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yKTsKKwlkYXRhWzZd ID0gaHRvbjMyKDE3KTsJLyogSVBfVURQICovCiAJZGF0YVs3XSA9IDA7CiAKIAlyZXQgPSBycGNf cmVxKG5wcml2LCBQUk9HX1BPUlRNQVAsIFBPUlRNQVBfR0VUUE9SVCwgZGF0YSwgOCk7CiAJaWYg KHJldCkKIAkJcmV0dXJuIHJldDsKIAotCXBvcnQgPSBudG9obChuZXRfcmVhZF91aW50MzIobmZz X3BhY2tldCArIHNpemVvZihzdHJ1Y3QgcnBjX3JlcGx5KSkpOworCXBvcnQgPSBudG9oMzIobmV0 X3JlYWRfdWludDMyKG5mc19wYWNrZXQgKyBzaXplb2Yoc3RydWN0IHJwY19yZXBseSkpKTsKIAly ZXR1cm4gcG9ydDsKIH0KIAorc3RhdGljIHVpbnQzMl90ICpuZnNfYWRkX3VpbnQzMih1aW50MzJf dCAqcCwgdWludDMyX3QgdmFsKQoreworCSpwKysgPSBodG9uMzIodmFsKTsKKwlyZXR1cm4gcDsK K30KKworc3RhdGljIHVpbnQzMl90ICpuZnNfYWRkX3VpbnQ2NCh1aW50MzJfdCAqcCwgdWludDY0 X3QgdmFsKQoreworCXVpbnQ2NF90IG52YWwgPSBodG9uNjQodmFsKTsKKworCW1lbWNweShwLCAm bnZhbCwgOCk7CisJcmV0dXJuIHAgKyAyOworfQorCitzdGF0aWMgdWludDMyX3QgKm5mc19hZGRf ZmgzKHVpbnQzMl90ICpwLCB1bnNpZ25lZCBmaF9sZW4sIGNvbnN0IGNoYXIgKmZoKQoreworCSpw KysgPSBodG9uMzIoZmhfbGVuKTsKKworCS8qIHplcm8gcGFkZGluZyAqLworCWlmIChmaF9sZW4g JiAzKQorCQlwW2ZoX2xlbiAvIDRdID0gMDsKKworCW1lbWNweShwLCBmaCwgZmhfbGVuKTsKKwlw ICs9IERJVl9ST1VORF9VUChmaF9sZW4sIDQpOworCXJldHVybiBwOworfQorCitzdGF0aWMgdWlu dDMyX3QgKm5mc19hZGRfZmlsZW5hbWUodWludD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Ck7CisJcCA9IG5mc19hZGRfdWludDY0KHAsIG9mZnNldCk7CisJ cCA9IG5mc19hZGRfdWludDMyKHAsIHJlYWRsZW4pOwogCiAJbGVuID0gcCAtICYoZGF0YVswXSk7 CiAKLQlyZXQgPSBycGNfcmVxKHByaXYtPm5wcml2LCBQUk9HX05GUywgTkZTX1JFQUQsIGRhdGEs IGxlbik7CisJcmV0ID0gcnBjX3JlcShwcml2LT5ucHJpdiwgUFJPR19ORlMsIE5GU1BST0MzX1JF QUQsIGRhdGEsIGxlbik7CiAJaWYgKHJldCkKIAkJcmV0dXJuIHJldDsKIAotCWZpbGVkYXRhID0g KHVpbnQzMl90ICopKG5mc19wYWNrZXQgKyBzaXplb2Yoc3RydWN0IHJwY19yZXBseSkpOworCXAg PSBuZnNfcGFja2V0ICsgc2l6ZW9mKHN0cnVjdCBycGNfcmVwbHkpICsgNDsKKworCXAgPSBuZnNf cmVhZF9wb3N0X29wX2F0dHIocCwgTlVMTCk7CisKKwlybGVuID0gbnRvaDMyKG5ldF9yZWFkX3Vp bnQzMihwKSk7CisKKwkvKiBza2lwIG92ZXIgY291bnQgKi8KKwlwICs9IDE7CiAKLQlybGVuID0g bnRvaGwobmV0X3JlYWRfdWludDMyKGZpbGVkYXRhICsgMTgpKTsKKwllb2YgPSBudG9oMzIobmV0 X3JlYWRfdWludDMyKHApKTsKIAotCWtmaWZvX3B1dChwcml2LT5maWZvLCAoY2hhciAqKShmaWxl ZGF0YSArIDE5KSwgcmxlbik7CisJLyoKKwkgKiBza2lwIG92ZXIgZW9mIGFuZCBjb3VudCBlbWJl ZGRlZCBpbiB0aGUgcmVwcmVzZW50YXRpb24gb2YgZGF0YQorCSAqIGFzc3VtaW5nIGl0IGVxdWFs cyBybGVuIGFib3ZlLgorCSAqLworCXAgKz0gMjsKKworCWlmIChyZWFkbGVuICYmICFybGVuICYm ICFlb2YpCisJCXJldHVybiAtRUlPOworCisJa2ZpZm9fcHV0KHByaXYtPmZpZm8sIChjaGFyICop c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