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 1gkVG2-0003z7-6b for barebox@lists.infradead.org; Fri, 18 Jan 2019 14:36:32 +0000 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Fri, 18 Jan 2019 15:36:27 +0100 Message-Id: <20190118143627.14114-1-u.kleine-koenig@pengutronix.de> In-Reply-To: <20190115105305.19940-1-u.kleine-koenig@pengutronix.de> References: <20190115105305.19940-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 v2] fs: nfs: copy data from rpc replies to local storage To: barebox@lists.infradead.org VGhlIG5mcyBjb2RlIHVzZXMgZGF0YSBwcm92aWRlZCB0byB0aGUgcGFja2V0IGhhbmRsZXIgYWZ0 ZXIgbmV0X3BvbGwoKQpyZXR1cm5lZC4gQnV0IHRoZSBsaWZlIHRpbWUgb2YgdGhpcyBkYXRhIGFs cmVhZHkgZW5kZWQgd2hlbiBuZXRfcG9sbCgpCnJldHVybnMuIE1vc3Qgb2YgdGhlIHRpbWUgaXQg aXMgcG9zc2libGUgdG8gZ2V0IGF3YXkgaGVyZSBidXQgb24gaS5NWDI4CnRoZSBkYXRhIGlzIG92 ZXJ3cml0dGVuIHNpbmNlIGNvbW1pdCA4MmVjMjg5MjljYzkgKCJuZXQ6IGZlY19pbXg6IERvIG5v dAp1c2UgRE1BIGNvaGVyZW50IG1lbW9yeSBmb3IgUnggYnVmZmVycyIpLgoKU28gdGhlIGRhdGEg ZnJvbSB0aGUgcGFja2V0IGlzIGNvcGllZCB0byBhIG1hbGxvY2VkIGJ1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