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 1fngNv-0005h3-DU for barebox@lists.infradead.org; Thu, 09 Aug 2018 08:33:32 +0000 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Thu, 9 Aug 2018 10:33:12 +0200 Message-Id: <20180809083313.13034-2-u.kleine-koenig@pengutronix.de> In-Reply-To: <20180809083313.13034-1-u.kleine-koenig@pengutronix.de> References: <20180809083313.13034-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 2/3] libfile: open_and_lseek: enlarge small files enough to make lseek possible To: barebox@lists.infradead.org VGhpcyBtYWtlcyB0aGUgZm9sbG93aW5nIGRvIHRoZSBleHBlY3RlZCB0aGluZzoKCgliYXJlYm94 QGJhcmVib3ggc2FuZGJveDovIGxzIC1sIGxhbGEKCS1yd3hyd3hyd3ggICAgICAgICAgICAgIDQg bGFsYQoJYmFyZWJveEBiYXJlYm94IHNhbmRib3g6LyBtdyAtZCBsYWxhIDcyIDAKCldpdGhvdXQg dGhpcyBwYXRjaCBtdyBkaWVzIHdpdGgKCglsc2VlazogSW52YWxpZCBhcmd1bWVudAoKbWVtc2V0 LCBtZW1jcHkgYW5kIHByb2JhYmx5IG90aGVycyBiZW5lZml0IGluIHRoZSBzYW1lIHdheS4KClNp Z25lZC1vZmYtYnk6IFV3ZSBLbGVpbmUtS8O2bmlnIDx1LmtsZWluZS1rb2VuaWdAcGVuZ3V0cm9u aXguZGU+Ci0tLQogbGliL2xpYmZpbGUuYyB8IDE4ICsrKysrKysrKysrKysrKysrKwogMSBm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