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 1f3Ggn-00021k-Qs for barebox@lists.infradead.org; Tue, 03 Apr 2018 07:49:18 +0000 From: Sascha Hauer Date: Tue, 3 Apr 2018 09:48:48 +0200 Message-Id: <20180403074851.5411-17-s.hauer@pengutronix.de> In-Reply-To: <20180403074851.5411-1-s.hauer@pengutronix.de> References: <20180403074851.5411-1-s.hauer@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 16/19] fs: ubifs: Switch to dcache implementation To: Barebox List U2lnbmVkLW9mZi1ieTogU2FzY2hhIEhhdWVyIDxzLmhhdWVyQHBlbmd1dHJvbml4LmRlPgotLS0K IGZzL3ViaWZzL0tjb25maWcgIHwgICAxIC0KIGZzL3ViaWZzL01ha2VmaWxlIHwgICAyICstCiBm cy91Ymlmcy9kaXIuYyAgICB8IDQxMCArKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysr KysrKysrKysrKysrKysrKysrKysKIGZzL3ViaWZzL3N1cGVyLmMgIHwgMTUzICsrLS0tLS0tLS0t LS0tLS0tLS0tCiBmcy91Ymlmcy91Ymlmcy5jICB8IDM0MSArLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KIGZzL3ViaWZzL3ViaWZzLmggIHwgICA3ICstCiA2IGZp bGVzIGNoYW5nZWQsIDQzMiBpbnNlcnRpb25zKCspLCA0ODIgZGVsZXRpb25zKC0pCiBjcmVhdGUg bW9kZSAxMDA2NDQgZnMvdWJpZnMvZGlyLmMKCmRpZmYgLS1naXQgY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