From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1glXjs-0006BD-HE for barebox@lists.infradead.org; Mon, 21 Jan 2019 11:27:48 +0000 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Mon, 21 Jan 2019 12:27:31 +0100 Message-Id: <20190121112732.23772-2-u.kleine-koenig@pengutronix.de> In-Reply-To: <20190121112732.23772-1-u.kleine-koenig@pengutronix.de> References: <20190121112732.23772-1-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 v3 2/3] fs/nfs: copy data from rpc replies to local storage To: barebox@lists.infradead.org VGhlIG5mcyBjb2RlIHVzZXMgZGF0YSBwcm92aWRlZCB0byB0aGUgcGFja2V0IGhhbmRsZXIgYWZ0 ZXIgbmV0X3BvbGwoKQpyZXR1cm5lZC4gQnV0IHRoZSBsaWZlIHRpbWUgb2YgdGhpcyBkYXRhIGFs cmVhZHkgZW5kZWQgd2hlbiBuZXRfcG9sbCgpCnJldHVybnMuIE1vc3Qgb2YgdGhlIHRpbWUgaXQg aXMgcG9zc2libGUgdG8gZ2V0IGF3YXkgaGVyZSBidXQgb24gaS5NWDI4CnRoZSBkYXRhIGlzIG92 ZXJ3cml0dGVuIHNpbmNlIGNvbW1pdCA4MmVjMjg5MjljYzkgKCJuZXQ6IGZlY19pbXg6IERvIG5v dAp1c2UgRE1BIGNvaGVyZW50IG1lbW9yeSBmb3IgUnggYnVmZmVycyIpLgoKU28gdGhlIGRhdGEg ZnJvbSB0aGUgcGFja2V0IGlzIGNvcGllZCB0byBhIG1hbGxvY2VkIGJ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