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-0004gr-6e for barebox@lists.infradead.org; Thu, 06 Feb 2014 16:41:44 +0000 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Thu, 6 Feb 2014 17:40:54 +0100 Message-Id: <1391704854-3141-10-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 9/9] nfs: parse nfsport and mount port from file system options To: barebox@lists.infradead.org VGhpcyBhbGxvd3MgdG8gdXNlIHVuZnMzIG9uIHRoZSBzZXJ2ZXIgc2lkZSB3aGljaCBkb2Vzbid0 IGludGVncmF0ZSBpbnRvCnBvcnRtYXAvcnBjYmluZCB3aGljaCByZXN1bHRzIGluIHRoZSBwb3J0 IG5vdCBiZWluZyBpbXBvc3NpYmxlIHRvIGxvb2t1cAp2aWEgcnBjIGNhbGxzIHRvIHRoZSBwb3J0 bWFwIHByb2dyYW0uCgpVc2UgaXQgbGlrZToKCgltb3VudCAtdCBuZnMgLW8gcG9ydD0yNzAzLG1v dW50cG9ydD0yNzAzIDE5Mi4xNjguNzcuMTU3Oi9yb290IC9tbnQvbmZzCgpTaWduZWQtb2ZmLWJ5 OiBVd2UgS2xlaW5lLUvDtm5pZyA8dS5rbGVpbmUta29lbmlnQHBlbmd1dHJvbml4LmRlPgotLS0K IGZzL25mcy5jIHwgNjIgKysrKysrKysrKysrKysrKysrKysrKys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ZXJyMjsKKwlkZWJ1ZygibW91bnQgcG9ydDogJWh1XG4iLCBucHJpdi0+ bW91bnRfcG9ydCk7CisKKwlwYXJzZW9wdF9odShmc2Rldi0+b3B0aW9ucywgInBvcnQiLCAmbnBy aXYtPm5mc19wb3J0KTsKKwlpZiAoIW5wcml2LT5uZnNfcG9ydCkgeworCQlyZXQgPSBycGNfbG9v a3VwX3JlcShucHJpdiwgUFJPR19ORlMsIDMpOworCQlpZiAocmV0IDwgMCkgeworCQkJcHJpbnRm KCJsb29rdXAgbmZzIHBvcnQgZmFpbGVkIHdpdGggJWRcbiIsIHJldCk7CisJCQlnb3RvIGVycjI7 CisJCX0KKwkJbnByaXYtPm5mc19wb3J0ID0gcmV0OwogCX0KLQlucHJpdi0+bmZzX3BvcnQgPSBy ZXQ7CisJZGVidWcoIm5mcyBwb3J0OiAlZFxuIiwgbnByaXYtPm5mc19wb3J0KTsKIAogCXJldCA9 IG5mc19tb3VudF9yZXEobnByaXYpOwogCWlmIChyZXQpIHsKLS0gCjEuOC41LjIKCgpfX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwpiYXJlYm94IG1haWxpbmcg bGlzdApiYXJlYm94QGxpc3RzLmluZnJhZGVhZC5vcmcKaHR0cDovL2xpc3RzLmluZnJhZGVhZC5v cmcvbWFpbG1hbi9saXN0aW5mby9iYXJlYm94Cg==