From patchwork Thu Jan 8 18:51:16 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1342 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898334; bh=8VUcyhTeRzwqeGFa0TweYiB16Ray7VE/9q4tk4XNSEs=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=fTnkGbxt79+ueS+ZtJ1acyVvOqE34+wy5Tbi3pRltYqH8hVhVSNpBTFo7PdntkCoh cC9oAGaz5GIKgIIuUn3+/vEfv9AU0NIcbfiRpAT/tY03Z4ndAqnAGX/dJ+4+5tyHxl mZgHTmqvFNL3ldGnte9UygZKdISRSRmBS10md4tzwkiVTSCxGSRYZHvS9r6fmO55K4 2Tn5qFr6+DXmus6JWw5cbnK4RNl/hYSHWoPoabjFnCa6CJDP87q2LGV60V7EqI7+X7 d9+L59ClsQvXujf/aH0d0FdQ10HWfNT3o2EhaJgZjxgmzWmefcDxTN+cxv6xksss2U lyN7ls1T4ua7A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 147BC691C8 for ; Thu, 8 Jan 2026 11:52:14 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id lSB8wWhombDO for ; Thu, 8 Jan 2026 11:52:14 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898334; bh=8VUcyhTeRzwqeGFa0TweYiB16Ray7VE/9q4tk4XNSEs=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=fTnkGbxt79+ueS+ZtJ1acyVvOqE34+wy5Tbi3pRltYqH8hVhVSNpBTFo7PdntkCoh cC9oAGaz5GIKgIIuUn3+/vEfv9AU0NIcbfiRpAT/tY03Z4ndAqnAGX/dJ+4+5tyHxl mZgHTmqvFNL3ldGnte9UygZKdISRSRmBS10md4tzwkiVTSCxGSRYZHvS9r6fmO55K4 2Tn5qFr6+DXmus6JWw5cbnK4RNl/hYSHWoPoabjFnCa6CJDP87q2LGV60V7EqI7+X7 d9+L59ClsQvXujf/aH0d0FdQ10HWfNT3o2EhaJgZjxgmzWmefcDxTN+cxv6xksss2U lyN7ls1T4ua7A== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 038C4691BF for ; Thu, 8 Jan 2026 11:52:14 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898332; bh=wSIqAGeWMOAut3rGzLaVLQiHWyRetaQGXDIa6EvGNM8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EtYBAVq3GWH3myOe9ozTLsbb7pzceVJXsdFYUhAYcn/6NlnuT+vahskmaw4ia0crt jPBgzZbXIt1hYcBU3ZFfpdnl5l2H5GW5EcogY+kmYzGYDdIu+N0oEmbtptIL4CMr3V apciW/3O+YPeseBB9h6zcd9vYQcExBpjmelQm5/cFIxWn/fECS4jS4VdjWXybzuS10 owF2gnWShOk5m5NJ5xRuiskyXjB0aEc3RBVwtsv6O7VZ9n2bau3boC25Mim/eeZhv4 GvOVpxf/InC8EX0nD/pmqyjwDd5y7Bsz7EFTHsMFwk5U9j34+i3jzef9R2dasFMuZA WRzUQq43b4rNQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0F9B6691BF; Thu, 8 Jan 2026 11:52:12 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id YtqwqJ-B30VQ; Thu, 8 Jan 2026 11:52:11 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898328; bh=LOmYPSMKV/lM4E2fYeFmaBUeUGKArBCqjX5Tabzngh4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Mu0K/ag8ohIcsS30A4SQxz2ekWMqA3iGig3WXA0wlwVbJpQVOPDsTANnPywbfQMjU KuItGh08jNiEsbeTquduLL6KY5NFlYzcyaPGIQVoWg5SB1X+g0hZ0/UyyqvkhCL8Vu FKKtrawJaRVhGv0QQDlkV2qMjtJikTMnMAAFagsILeQe6TPZINlRiyWvCPEh30gxmM GceTzC/E9+dAXgAxwYunr5cEAmO285Rv4ai86370ggnNGn8Nhp4Hil4msrlmPu0Zug +BGF6bq1huKlD+Tyviw6U5MCWWMDytkJArC3Uxwjlb3vzqqgdfeSh+N1wbtZJGFBmW cGU9K2Lzqm69w== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id B879469128; Thu, 8 Jan 2026 11:52:07 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 8 Jan 2026 11:51:16 -0700 Message-ID: <20260108185149.1995917-2-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260108185149.1995917-1-sjg@u-boot.org> References: <20260108185149.1995917-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 7BKPI6YE7LWYYUJBU7HKSCVVJ3X67CRR X-Message-ID-Hash: 7BKPI6YE7LWYYUJBU7HKSCVVJ3X67CRR X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 01/21] ext4l: Use div64.h instead of defining locally List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass U-Boot has a do_div() macro which is supported on most boards. Use that instead of defining a new one. Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index c013b9605a4..04b76af7f09 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -36,6 +36,7 @@ #include #include /* Real rbtree implementation */ #include /* For crc32() used by crc32_be */ +#include /* * Enable ext4_msg() and other diagnostic macros to pass full messages. @@ -439,15 +440,6 @@ int __ext4_xattr_set_credits(struct super_block *sb, struct inode *inode, #define sb_issue_zeroout(sb, blk, num, gfp) ({ (void)(sb); (void)(blk); (void)(num); (void)(gfp); 0; }) #define blkdev_issue_flush(bdev) ({ (void)(bdev); 0; }) -/* do_div - divide u64 by u32 */ -#define do_div(n, base) ({ \ - unsigned int __base = (base); \ - unsigned int __rem; \ - __rem = ((unsigned long long)(n)) % __base; \ - (n) = ((unsigned long long)(n)) / __base; \ - __rem; \ -}) - /* Inode locking - stubs */ #define inode_is_locked(i) (1) #define i_size_write(i, s) do { (i)->i_size = (s); } while (0) From patchwork Thu Jan 8 18:51:17 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1343 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898338; bh=KCVrTNbdJ6c5Jko7D6CqQR57MUD46KNhM2lUOkAa6Hw=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=pj8Kt5VvCgNrBoyLrYATaCGx/opIRtm2J3hEQwf7U76zur+rtjHW0mF+BMWxilXG0 pHT3/Y/0xwUunVMNnt8wVWHeQFbObUICWd+Hbr3EhaUydIzFT1CE5hexKFKMI58hj4 Sr81aXCPKCdDQIx7cYV0Re5zwpls/qf550kSfyuPy9jAC76qyrsqVIK+eAf1DQ3CRp 8+RkDKJKjdKeqRIvqaJAUnLFWbZ8XHZB1hZ5Z9RixkfjGp1JRiV4b6N9Sav33EMnfl er3YbwT0320xWf7kx260WXrTPYuLv9qPZyhWDzbVfvLLWZduWZuZyGvMyWeIJSM6NX wV9rng0T0jHpg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 842AF691BF for ; Thu, 8 Jan 2026 11:52:18 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 6saLXoXDZkvr for ; Thu, 8 Jan 2026 11:52:18 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898338; bh=KCVrTNbdJ6c5Jko7D6CqQR57MUD46KNhM2lUOkAa6Hw=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=pj8Kt5VvCgNrBoyLrYATaCGx/opIRtm2J3hEQwf7U76zur+rtjHW0mF+BMWxilXG0 pHT3/Y/0xwUunVMNnt8wVWHeQFbObUICWd+Hbr3EhaUydIzFT1CE5hexKFKMI58hj4 Sr81aXCPKCdDQIx7cYV0Re5zwpls/qf550kSfyuPy9jAC76qyrsqVIK+eAf1DQ3CRp 8+RkDKJKjdKeqRIvqaJAUnLFWbZ8XHZB1hZ5Z9RixkfjGp1JRiV4b6N9Sav33EMnfl er3YbwT0320xWf7kx260WXrTPYuLv9qPZyhWDzbVfvLLWZduWZuZyGvMyWeIJSM6NX wV9rng0T0jHpg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 73808691C4 for ; Thu, 8 Jan 2026 11:52:18 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898337; bh=G1e5gImKDW+tp5aepQoCNI5zwnedCXgbcE9Q6zMaL4E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o/fV8ohwjqeheEDT9Pr15losUOpYGlEfrsJ9Ghg7oDX2ZDdLtm6EBpmDxD99lDtN3 geZ56OTWSn4zyiJmYxD6h2OKJ6pYjXu00s7WXl+FK5yLCRVzuj+9oTcN+++XfvGuKL fRiy8wOC+2lQYxVzC7GGcnmFz9nss65eg/IZ8OOmd3CDtMFvfYqSw3K8uYFBQMNr9I VrRkEEjk78GPsTwUogBpGXU4gsNjPmA4RmnpnOxG4aPLIeqzjwRpsijTXOGZx/V/py aoSVjStkgH+KW4cqlX72oZRgZ0UznFANHcnjBHN4r8Jfrzm02WZs8G0IMUS59HN5en ZEUv12/IbMPcw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4C3B569128; Thu, 8 Jan 2026 11:52:17 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id a59TyuAFfcra; Thu, 8 Jan 2026 11:52:17 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898333; bh=HWxM74WF2gCKhoS5phkb8Bc86SQX66jG7eZqDNuy734=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YGl6ceQ3rAzUX8kE765p3mb2VAr0QYwID2i4jWoE7i5WWPe2WrseWutoKr0JoY3ZD Y8v+Np4TYQUwoeITXUCxlwVVE3nS0PEjU9AzGJdp1idoaF/zOyUc3yjXQmlV8mFztT RBKlk8dwYdRQV5/OK8cZrlND/my2VRR5fJT9MeQptNm5Ze5Pbf74zRDg5zyIgKbQJL VlbhiKPpme2VkmDu0Ohb7JIhK5yv9lCu6u2sFS/s9et1JVmXk+1DtoylDfQkEkTmZl /l6eLstR6dmWJWvxGysdtk/QucvzOlFMIlwYq9VfzZOyVAq7nUZ8de5W6lLMjBagR+ IcQSy1KNW/iTA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id F21E169101; Thu, 8 Jan 2026 11:52:12 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 8 Jan 2026 11:51:17 -0700 Message-ID: <20260108185149.1995917-3-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260108185149.1995917-1-sjg@u-boot.org> References: <20260108185149.1995917-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: DIECLVBUZ2QWXZKDGJQSG4G2B2HO4B2D X-Message-ID-Hash: DIECLVBUZ2QWXZKDGJQSG4G2B2HO4B2D X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 02/21] ext4l: Make use of log.2 instead of defining locally List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Make use of the existing linux/log.h header which is supported on most boards. Drop the unnecessary code in the header and stub files. Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 14 ++------------ fs/ext4l/stub.c | 15 --------------- 2 files changed, 2 insertions(+), 27 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 04b76af7f09..c975396dec4 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -19,6 +19,7 @@ #pragma GCC diagnostic ignored "-Wunused-function" #pragma GCC diagnostic ignored "-Wunused-variable" +#include #include #include #include /* For panic() */ @@ -28,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -36,7 +38,6 @@ #include #include /* Real rbtree implementation */ #include /* For crc32() used by crc32_be */ -#include /* * Enable ext4_msg() and other diagnostic macros to pass full messages. @@ -1458,10 +1459,6 @@ typedef unsigned int projid_t; __ret == __old; \ }) -/* ilog2 - log base 2 */ -#include -#define ilog2(n) (fls(n) - 1) - /* hash_64 - simple 64-bit hash */ #define hash_64(val, bits) ((unsigned long)((val) >> (64 - (bits)))) @@ -2370,10 +2367,6 @@ void fscrypt_show_test_dummy_encryption(struct seq_file *seq, char sep, /* Memory allocation - declarations for stub.c */ void *kvzalloc(size_t size, gfp_t flags); #define kvmalloc(size, flags) kvzalloc(size, flags) -unsigned long roundup_pow_of_two(unsigned long n); - -/* Power of 2 check - declaration for stub.c */ -int is_power_of_2(unsigned long n); /* Time operations */ #define ktime_get_ns() (0ULL) @@ -2651,9 +2644,6 @@ struct seq_operations { /* Block layer constants */ #define BLK_MAX_SEGMENT_SIZE 65536 -/* order_base_2 - log2 rounded up */ -#define order_base_2(n) ilog2(roundup_pow_of_two(n)) - /* num_possible_cpus - number of possible CPUs (always 1 in U-Boot) */ #define num_possible_cpus() 1 diff --git a/fs/ext4l/stub.c b/fs/ext4l/stub.c index d328c6821a9..af0bb045d5f 100644 --- a/fs/ext4l/stub.c +++ b/fs/ext4l/stub.c @@ -360,15 +360,6 @@ void ext4_force_shutdown(void *sb, int flags) } /* Memory stubs */ -unsigned long roundup_pow_of_two(unsigned long n) -{ - unsigned long ret = 1; - - while (ret < n) - ret <<= 1; - return ret; -} - void *kvzalloc(size_t size, gfp_t flags) { return calloc(1, size); @@ -525,12 +516,6 @@ int sb_set_blocksize(struct super_block *sb, int size) return size; } -/* Power of 2 check */ -int is_power_of_2(unsigned long n) -{ - return n != 0 && (n & (n - 1)) == 0; -} - /* strscpy_pad is now a macro in ext4_uboot.h */ /* kmemdup_nul is defined earlier in this file */ From patchwork Thu Jan 8 18:51:18 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1344 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898344; bh=FM3cO7FL/EmMYC/mhtOHl2+/lCn6jNftx7kArabTCUo=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=S9XGhHNpOMUlDNTdeuu4wkW3HU6GIX159bm4xxA79proMD73z5JVx8i8F/uRYcGRR cgKAiPVRbPwQB02DRDXi/S0iJky3BKI/OhlGD2kL24hA4Pwq0c3TfGdsPfgs0eINTE 3brZNcucRWv0x+spftIjMpMbnz88KmNP8VHDvIFZfm7TKJ2RI0vjLqWDJ3GdLx7rst ozogACmtmuXgxq3vdQrM5MiswbfzUgOwsnEcSYe0joVPBqMMWHvq2msGanLnKx42ps bk3mMdHBVtoA1swC7wK9WW67uOPg02JdEKV0Uny9IeVHDia8oTwrNTtLM8ojm/4Qko Qm7xnTcnCpQuw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6999E691BF for ; Thu, 8 Jan 2026 11:52:24 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id ROZcrJbAvaFh for ; Thu, 8 Jan 2026 11:52:24 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898344; bh=FM3cO7FL/EmMYC/mhtOHl2+/lCn6jNftx7kArabTCUo=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=S9XGhHNpOMUlDNTdeuu4wkW3HU6GIX159bm4xxA79proMD73z5JVx8i8F/uRYcGRR cgKAiPVRbPwQB02DRDXi/S0iJky3BKI/OhlGD2kL24hA4Pwq0c3TfGdsPfgs0eINTE 3brZNcucRWv0x+spftIjMpMbnz88KmNP8VHDvIFZfm7TKJ2RI0vjLqWDJ3GdLx7rst ozogACmtmuXgxq3vdQrM5MiswbfzUgOwsnEcSYe0joVPBqMMWHvq2msGanLnKx42ps bk3mMdHBVtoA1swC7wK9WW67uOPg02JdEKV0Uny9IeVHDia8oTwrNTtLM8ojm/4Qko Qm7xnTcnCpQuw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 53A64691C8 for ; Thu, 8 Jan 2026 11:52:24 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898341; bh=/Yua7Lt7j4ijhsLjJQeZB5YH54nsXGg5r0wBYF974vY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AniX5lQfL0QQqymLmWQtxbudnaN12T8joFE0ILtTaOkdkzxU0IcFGnnCLmZWtRp2Q KpjXd7Z5669uOaIRIG5A9lsMzLmp/mH8TPXfOUgT8DshavWjSNwe+OpKAC95T1sdWX YwgIX+SmUly/PhbT8xfU0xupUylqdaC74/2g2zOMBMb59tSlRywxDR3UxCLJCakLJj zIDwmdguud7gzQe5h4CcxdQsMRO7tCkDc9N8HSxYBMrnsgtBzN4U0ya4hEMtV3V1Mw mTH7ZX31OaV312Jt4lqYj1zL8cMnSBuKtJTzUX5xvLhlukY33qAJjoTyxzyTfCGw1X NUHLHAv1Lp1jA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D707C691BF; Thu, 8 Jan 2026 11:52:21 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id LqIVr5OSn0EP; Thu, 8 Jan 2026 11:52:21 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898337; bh=MMW1m/0K7/VbbKsJ6PvKlHTxO80IrlTlr/9QUXFe5Ko=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QRVqrMASCSX3d6lv3DTIYk/5zWt3a0SSgaZTCKx7sVin2X6AFAcXYWbT49Flz68pQ 5Z+EGrmSria0qKCO6yGyPX0chhU+0xGM9+8ukQCTELhpqlvuHgtftuk0E2Y7VnIvbU VgFHwY/+V3WH7vTg465ZdauQOhGo6ZC0X5Q0il96qtrQkpqneklfkxNmsP/NrmYZwE y18vi2bBFKd7Ug+I3YpR7FOitUvECunbHFsfDUxkPfMx7LEiFK8VUDwpUL3fULtYVo yFpnEsNUU3/UGecZh9MHtdgvpVyWt7tDSwZa1qkc+U5EokAzVsI46WFPSMREG3YgLY O/VbuoMenc0Fg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 8E23669101; Thu, 8 Jan 2026 11:52:17 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 8 Jan 2026 11:51:18 -0700 Message-ID: <20260108185149.1995917-4-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260108185149.1995917-1-sjg@u-boot.org> References: <20260108185149.1995917-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: JN4THKZTXLGKBAGA7D7N3XZEG4PDUKZF X-Message-ID-Hash: JN4THKZTXLGKBAGA7D7N3XZEG4PDUKZF X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 03/21] ext4l: Move __kernel_fsid_t to posix_types.h List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Other archs provide the struct __kernel_fsid_t definition in linux/posix_types.h, but sandbox does not. Add it so we can remove the ext4l version. Signed-off-by: Simon Glass --- arch/sandbox/include/asm/posix_types.h | 4 ++++ fs/ext4l/ext4_uboot.h | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/arch/sandbox/include/asm/posix_types.h b/arch/sandbox/include/asm/posix_types.h index e1442c455bd..fe12ec9cc01 100644 --- a/arch/sandbox/include/asm/posix_types.h +++ b/arch/sandbox/include/asm/posix_types.h @@ -55,4 +55,8 @@ typedef unsigned short __kernel_old_gid_t; typedef long long __kernel_loff_t; #endif +typedef struct { + int val[2]; +} __kernel_fsid_t; + #endif diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index c975396dec4..f3dede424df 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -2067,11 +2067,6 @@ struct fid { }; }; -/* __kernel_fsid_t - must be before kstatfs */ -typedef struct { - int val[2]; -} __kernel_fsid_t; - /* uuid_to_fsid - convert UUID to fsid */ static inline __kernel_fsid_t uuid_to_fsid(const u8 *uuid) { From patchwork Thu Jan 8 18:51:19 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1345 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898345; bh=jAZ87fLRiil0mu0UHiSRb6H/mjkijUxCaHSWFfAUjpQ=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=p5Ezt34a/Aiua7x2SrRYY4qy8suG2XodRgOUMTuNQTIbXOYGGC7odHPXcD00ije5+ 75ETkc8imGd54Uq5TjlkDuP4iJiKZxASpBXPlsXKkdIrXfJ2GR+zbN/81hg+myK+Jw vDAREh3yiXJNOKcHufX+W45eomaH4qlor8DsVrmyMYc5yagUHbBlG9ojs4k6owfwM/ oRhEFv7UOt6I4+zSSmgmni0UQ12BVn1b/BFSfjKkV8F831z/s74rlYvG4W/vCOD8Lf fZiSd/u/PN0asheBRbANW9BwJ/pJ2U1DcnjoJj/uvhBJpVgiP0L7UhGwTdrT6/8i4l ngQTnITHxhu2Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 05B49691C8 for ; Thu, 8 Jan 2026 11:52:25 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id djlgmWYT1CXb for ; Thu, 8 Jan 2026 11:52:24 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898344; bh=jAZ87fLRiil0mu0UHiSRb6H/mjkijUxCaHSWFfAUjpQ=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=jJXS88P7i3ODYUgYQORG41FKZSyrcwlvz5QP5cfUGG7hKh8f6lRKuGzG+8lCGoqtK 7ceQ/SgjPYr54AT7Oblk+6EUpxiOsUbReiD4JS9/n+YC907PeDNAP7Rt9CALc1hFvB U1ntINXfJj3BMyZ5LKacjUKPcsbdDlKNR+MtFoljD7QCszpLXJMpDABR3OMZRdOktf uJPKsfMZnjeXjfBW00/12pPvEeATrS/kqC36hKGu4lCU6qisrhnuvQGzQ36z4ZHwJL 1evOlhSPlrtRNyrfW94zN/tctRhjgXMXMpdyXnmaehl4DPZdBswqAqMUzNT3i5prrB 975vjVg3uaO4w== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E971A691CC for ; Thu, 8 Jan 2026 11:52:24 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898342; bh=K9sNiWdg42rvGN0d5oQRlbrs1zUIzlqp01WeHlqOjxw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Dh75jehr/+towFEpVR6C9d6lWQUbjjQNoqKvkKC0+PJBx77wh5Sd/a2wEowSWvGRS tGUN3DsvohzAyQoQEIfTFpwAjkZps3RuknSQnOjB+AS1fPYbgG8SdwABUzUqJdrjTa wA1vvbDQ1a/xwnI1XOsepNxupqVvBdPalOjdGT8gxgHN5jpRgItSXMrsWQ2DeSjsvU 6U3H44OG9kr+ULcgxk+k6r1Pg7IOAfW3Zn5Dd68JGh4baNmGQWhjJAYV6KAhNWQGVL j1Os2v8NSmLGx0qLdeI02+gT0ynoty514YehRn3sJUKgvJ27y2zY6XLgyQBno7EOPD e3Ggn6LDfkqAA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id AD9EE691C4; Thu, 8 Jan 2026 11:52:22 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id pw_KEbZfoiwG; Thu, 8 Jan 2026 11:52:22 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898342; bh=2rawxvQFd1N37kQBKvarPz4RqLsSqFeFzDkqfXs6j/o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kYO5TG+8dnIQnNMJO4PQyVIKMRbx7H8QASahtBN4QPoiZxxL1kuZt/ZxYtNPAz8CT gbSXVxaWRCqXTdvPgt6JQFb1VTluCbniBC9YfYoEUCr9hnPF8mW3FyJRW0tPHFyGLr jHc4koeugllJEHRqkTo2ybYBpX1n53wskxmbqBTAlA2xJwa1UkmAnY8grk8P5cay0N ViXty6YegTGYXeKlx/UxCOqLW5GvhVGndqd7/UYtnME6KtutWmnKuFJNGa47vd7cHM hBNvNZxBKu8aZeOOAm7Bwu9FdpWrT+I0+E4cQWC1NXqRgyg96IiboJ/SN2p7Hd1vaK MOe1yOR896kIw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 2B80D69101; Thu, 8 Jan 2026 11:52:22 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 8 Jan 2026 11:51:19 -0700 Message-ID: <20260108185149.1995917-5-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260108185149.1995917-1-sjg@u-boot.org> References: <20260108185149.1995917-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: SRGNQDCRZXBLJK2LKJOE3EEFAXDKQFEX X-Message-ID-Hash: SRGNQDCRZXBLJK2LKJOE3EEFAXDKQFEX X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 04/21] ext4l: Use math64.h instead of defining locally List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass U-Boot has a linux/math64.h header which is supported on most boards. Use that instead of defining a new function. Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index f3dede424df..5676f76d4b4 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -3095,12 +3096,6 @@ static inline struct new_utsname *init_utsname(void) /* test_and_set_bit_lock - test and set a bit atomically */ #define test_and_set_bit_lock(nr, addr) test_and_set_bit(nr, addr) -/* div64_u64 - 64-bit by 64-bit division */ -static inline u64 div64_u64(u64 dividend, u64 divisor) -{ - return dividend / divisor; -} - /* time_is_before_jiffies - check if time is before current jiffies */ #define time_is_before_jiffies(a) ({ (void)(a); 0; }) From patchwork Thu Jan 8 18:51:20 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1346 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898349; bh=Xpn+gOUIM0JCgAMNmGSwEUxOdQBcKNVZgPTaM2XcUEQ=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=m7LkjUYb+6qOZtP6iVMCb/e1JZ3lr731OW/CRm3Lzw5b1LBGV82jlFA8qHWNdNboc uFJqarfoKcWJr0j5b87MWBTMbmbnioKzXKgeVCJkpR9/Sj/DgmGDsNKP7fPUWbkuCA 3mynnNPveYngEXHfmtvfzkfPUS2dnu5d1T6PLo8HKC9908OwgiMNWdQuHCJ5Dkhyn7 J6DvUKLBo7GMZUdD8Vzs7Ql7j2NoulQALaUJbYXvDO+3UqwOX3mZ9FI6V/IPMu9sBa obPEWAgUondJN8mTsWdUQjR3dVGsDiAxAfCUYxkXn1zFo0axgitQhyNGhu6sEwTG1x du8UG7UO3WfjA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 742F1691CB for ; Thu, 8 Jan 2026 11:52:29 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id Dwu6h7UisZ1q for ; Thu, 8 Jan 2026 11:52:29 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898349; bh=Xpn+gOUIM0JCgAMNmGSwEUxOdQBcKNVZgPTaM2XcUEQ=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=m7LkjUYb+6qOZtP6iVMCb/e1JZ3lr731OW/CRm3Lzw5b1LBGV82jlFA8qHWNdNboc uFJqarfoKcWJr0j5b87MWBTMbmbnioKzXKgeVCJkpR9/Sj/DgmGDsNKP7fPUWbkuCA 3mynnNPveYngEXHfmtvfzkfPUS2dnu5d1T6PLo8HKC9908OwgiMNWdQuHCJ5Dkhyn7 J6DvUKLBo7GMZUdD8Vzs7Ql7j2NoulQALaUJbYXvDO+3UqwOX3mZ9FI6V/IPMu9sBa obPEWAgUondJN8mTsWdUQjR3dVGsDiAxAfCUYxkXn1zFo0axgitQhyNGhu6sEwTG1x du8UG7UO3WfjA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 62AC4691C4 for ; Thu, 8 Jan 2026 11:52:29 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898347; bh=8URt8HelkXMzKup1j0Ndj3a9Z+HYxJ14um4jwr2gMrg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WNoD0jlahI8JPmZdyKDyvB5UwfpXacMMqDUX+2V0wYshukUQlumYLgZtzroraXM04 g9O8e4jTEgCNM05frTnqDPO0Pl8hvixWAQTFg7EGeiJKuc2Mp5FdQjizF91WTT30Sx ZvsDACbZM9Gxhpl72u2Q7jJOuF7vlJX9tT09DDzTACxihWfEdmD7cyISJvPr23j3GG KsBy9uZ1/xadtIMQz1JUomxh1L8ZI4rny8fObZAMOT3AQbriCNrgyQ5Pox+h9TzTNS zW/+SKXzIM4XYJPX0ANL6Yfpmiq+UgMOhb1kJ+UYQ2xI7p2n5PHAXhUelVMUUJxSTz urcKY2/Lv79CQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 71EA5691BF; Thu, 8 Jan 2026 11:52:27 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id 7QNrOF69eqVi; Thu, 8 Jan 2026 11:52:27 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898343; bh=4Frth0ufDXqjvkhPSfGpWxht/+gTEzjLGNNWWUmj9A0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jtqwRE7uVNY9fV689BWRZRcSdOfqqGK6x0ya867joFpP2s6Ulsm1TdHjhw7HmUhUW iIoqnjhctgmr9ZSQkrLq9d5R3TJ06Hj83+EVVPn2P8adX6A86EaPfK0qjujP+LSlBi axlFkwhEOswZq+Kdh6nVU2CAMaW/nVUf5mqQjuzQO7607UT3XNVZlbYJ7+qu7ou2Ob oNIM6T+QdfPG2lHptP3w2DqMdTTKJDKyKjSM68whBiB8ZVB4LL7c7Bor5YezoYuJB9 OBf35xi1QT9zSrBpyj9lRnFkQZMzy9c0nBoFYqqUBsruKBzXHwZKv3zQMtGLnNnlfi RVS3ZzfzzGomg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 01F6369101; Thu, 8 Jan 2026 11:52:22 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 8 Jan 2026 11:51:20 -0700 Message-ID: <20260108185149.1995917-6-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260108185149.1995917-1-sjg@u-boot.org> References: <20260108185149.1995917-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: HBNOWFQA4XCRQVODVXJ4P3DOGMGX2OXB X-Message-ID-Hash: HBNOWFQA4XCRQVODVXJ4P3DOGMGX2OXB X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 05/21] ext4l: Use 64-bit operations for block calculations List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass The current implementation is designed for 64-bit machines. Use the available functions and macros so that probing and reading work correctly on all machines. Signed-off-by: Simon Glass --- fs/ext4l/interface.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/fs/ext4l/interface.c b/fs/ext4l/interface.c index f581c32359e..9a3fda48300 100644 --- a/fs/ext4l/interface.c +++ b/fs/ext4l/interface.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include "ext4_uboot.h" @@ -387,7 +388,7 @@ int ext4l_probe(struct blk_desc *fs_dev_desc, /* Read sectors containing the superblock */ if (blk_dread(fs_dev_desc, - (part_offset + BLOCK_SIZE) / fs_dev_desc->blksz, + div_u64(part_offset + BLOCK_SIZE, fs_dev_desc->blksz), 2, buf) != 2) { ret = -EIO; goto err_free_buf; @@ -414,7 +415,7 @@ int ext4l_probe(struct blk_desc *fs_dev_desc, * If write returns 0, the device is read-only (e.g. LUKS/blkmap_crypt) */ if (blk_dwrite(fs_dev_desc, - (part_offset + BLOCK_SIZE) / fs_dev_desc->blksz, + div_u64(part_offset + BLOCK_SIZE, fs_dev_desc->blksz), 2, buf) != 2) { sb->s_bdev->read_only = true; sb->s_flags |= SB_RDONLY; @@ -846,9 +847,11 @@ int ext4l_read(const char *filename, void *buf, loff_t offset, loff_t len, dst = buf; while (bytes_left > 0) { + u32 rem; + /* Calculate logical block number and offset within block */ - block = offset / blksize; - blk_off = offset % blksize; + block = div_u64_rem(offset, blksize, &rem); + blk_off = rem; /* Read the block */ bh = ext4_bread(NULL, inode, block, 0); From patchwork Thu Jan 8 18:51:21 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1347 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898354; bh=Ua3tO4HBnk9RYHTMfulSoIt0JIxh8cMg0SNxuEA04MA=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=p5QH49YE3PngRmdUtM5i97G1m0s1ELb8BF1IaPjh5eSR90+h4HrwAeZRT3FbhBwg+ bSyzPU0U8a1h4EvgEmUSagh1E/v/OTVnrrNNCQWXTzxHT4wmjD7UAa1t5LBd9pDxUm wXVeSPfcU+Or37H3xpMJ2uLC0/wU/4hfQSeRWvbdIH1IODgX/J2j9QU7r98UgLZa7Q Bw93dbSNs0VpOtJWrdvfcmfbHhbjsYunBMc78GZA8sIvP+eTEwl695fUoYXWEyPRxv ndXeL54dcilHy5HT2adT40Otdfx80d5ZPE2PxO6CvZs1tmSszfS3SGvgrfiaITJmzp 8K4XpOvWG0uxg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 391FB691CC for ; Thu, 8 Jan 2026 11:52:34 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id LEp2Lg9CRddT for ; Thu, 8 Jan 2026 11:52:34 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898354; bh=Ua3tO4HBnk9RYHTMfulSoIt0JIxh8cMg0SNxuEA04MA=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=p5QH49YE3PngRmdUtM5i97G1m0s1ELb8BF1IaPjh5eSR90+h4HrwAeZRT3FbhBwg+ bSyzPU0U8a1h4EvgEmUSagh1E/v/OTVnrrNNCQWXTzxHT4wmjD7UAa1t5LBd9pDxUm wXVeSPfcU+Or37H3xpMJ2uLC0/wU/4hfQSeRWvbdIH1IODgX/J2j9QU7r98UgLZa7Q Bw93dbSNs0VpOtJWrdvfcmfbHhbjsYunBMc78GZA8sIvP+eTEwl695fUoYXWEyPRxv ndXeL54dcilHy5HT2adT40Otdfx80d5ZPE2PxO6CvZs1tmSszfS3SGvgrfiaITJmzp 8K4XpOvWG0uxg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 27828691C4 for ; Thu, 8 Jan 2026 11:52:34 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898351; bh=AJJUVMDYNMVWXsiCivto/YAnLv3/59Bd73M3TX1xIu4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LzcSSWqFYTxJ8jrzeZzw32cXMbw88m4l57KOtxVc4SJ71MoQDcFV7M8S8O4OQoKII aNzyXdlDO/lgv049iVerame378heh2lwfP9hZ5vPnWizocgjTAuaziNIkTyqVVGgu5 hUqQUouY8ZOAydhWcwesZ6STUwNYhX9dJj8oHVIhELrl8wBBXBFY5wlQMaiScIIr32 3M+vZZxNUVB9D3GKveflf8cXIFVQGfBWjhm409umBMFta9SypZ76VEHoa58XzZ05yz dILQyitp0jHCUvtp9h7C+0Oq2FuvgIawnrlhpUIyEyBcUByrZ3jKxRExAHrHLRN59v /Bqd4f5RRDY4w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id DB04D691BF; Thu, 8 Jan 2026 11:52:31 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id C9lSejAvyJ5c; Thu, 8 Jan 2026 11:52:31 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898347; bh=0OW0vzzAwJTbBbklNNqkB42Igdh+tXKHK8+jiTKXNaw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rqk5pDSXJMgz5a3LOuFRemquHNVyoh7h8Blj8s0XvU0X1wTkIBf46LHDT4CNMs1Iz 97hIqrmUauJKZ0ZR8lwj+cT/Eqo8uISGX65pjt3UElZAQL8Q/G/JhziGTznTRBOrOW RjpkJD8e9npfRGHhRmNARzv9fN0oMZHLc7ogEyzEQ8wGg1GVAo+AcxVEZ2jQshUUrk r/0CnDxKFvCjvHjDnzMtK9M7rNA77Kr1H4zCykYV09DcQ4MuGggLTyGX0mS78KhNv2 C7+xTdrhfpMOt07B/4UCT6/UowNXd17SfUHd2pCOoQePXFzR1nYsoscSiLVQ+FSrxg 4/G5nWhJBtZeA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 92FD169101; Thu, 8 Jan 2026 11:52:27 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 8 Jan 2026 11:51:21 -0700 Message-ID: <20260108185149.1995917-7-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260108185149.1995917-1-sjg@u-boot.org> References: <20260108185149.1995917-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: WXMY66T24YSWW63JBBRAY7B33CZVTJJ2 X-Message-ID-Hash: WXMY66T24YSWW63JBBRAY7B33CZVTJJ2 X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 06/21] ext4l: sandbox: Use volatile in set_bit() etc. List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Other archs use a volatile address so update sandbox to match. This will prevent warnings in common code. Update the ext4 stub functions too. Signed-off-by: Simon Glass --- arch/sandbox/include/asm/bitops.h | 6 +++--- fs/ext4l/stub.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/sandbox/include/asm/bitops.h b/arch/sandbox/include/asm/bitops.h index f27d5e98c56..2fdc0116da0 100644 --- a/arch/sandbox/include/asm/bitops.h +++ b/arch/sandbox/include/asm/bitops.h @@ -34,11 +34,11 @@ /* * Function prototypes to keep gcc -Wall happy. */ -extern void set_bit(int nr, void *addr); +extern void set_bit(int nr, volatile void *addr); -extern void clear_bit(int nr, void *addr); +extern void clear_bit(int nr, volatile void *addr); -extern void change_bit(int nr, void *addr); +extern void change_bit(int nr, volatile void *addr); static inline void __change_bit(int nr, void *addr) { diff --git a/fs/ext4l/stub.c b/fs/ext4l/stub.c index af0bb045d5f..2084faa3b50 100644 --- a/fs/ext4l/stub.c +++ b/fs/ext4l/stub.c @@ -79,21 +79,21 @@ typedef struct journal_s journal_t; * Bit operations - sandbox declares these extern but doesn't implement them. * These work on bitmaps where nr is the absolute bit number. */ -void set_bit(int nr, void *addr) +void set_bit(int nr, volatile void *addr) { unsigned long *p = (unsigned long *)addr + (nr / BITS_PER_LONG); *p |= (1UL << (nr % BITS_PER_LONG)); } -void clear_bit(int nr, void *addr) +void clear_bit(int nr, volatile void *addr) { unsigned long *p = (unsigned long *)addr + (nr / BITS_PER_LONG); *p &= ~(1UL << (nr % BITS_PER_LONG)); } -void change_bit(int nr, void *addr) +void change_bit(int nr, volatile void *addr) { unsigned long *p = (unsigned long *)addr + (nr / BITS_PER_LONG); From patchwork Thu Jan 8 18:51:22 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1348 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898358; bh=bX3oij+PDRkE6gpxauhkf0ktslfRY923QmF02GWcfCs=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=TgZ2hb6L84uUs56JB1lwNP7fiYL2vzuRDURGPOPUjH+z0iu4AjruC4DPNxTWFtWoK eq1Qvk7NzRXskgntwKi9U69xAsz51Qgb+DIOcF4gwfFb9ozVI2IWsJJCFcW9tlv6IY w0u0ymFDd2M0ST7j1Q0wPksCHGwxKXRBiMOqjIHkxcUCiuOCO5EPDy1GdlKBTS4iI0 JrIHOpJQvz5WQB9xLbOyfBXJmwSc3EoqZwEC4yTDj6XgQLVDfHje4FIUJmSP2Nn//3 6FL9u7xNc4C5BaNxwz/VaE2WdJS+m8X4AAhYWcm2nDPtaHK+jFQewU7yiyE3/sOtrD xKTIuuron1+2Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id AEA43691CE for ; Thu, 8 Jan 2026 11:52:38 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id KYUOvxUyiEYe for ; Thu, 8 Jan 2026 11:52:38 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898358; bh=bX3oij+PDRkE6gpxauhkf0ktslfRY923QmF02GWcfCs=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=TgZ2hb6L84uUs56JB1lwNP7fiYL2vzuRDURGPOPUjH+z0iu4AjruC4DPNxTWFtWoK eq1Qvk7NzRXskgntwKi9U69xAsz51Qgb+DIOcF4gwfFb9ozVI2IWsJJCFcW9tlv6IY w0u0ymFDd2M0ST7j1Q0wPksCHGwxKXRBiMOqjIHkxcUCiuOCO5EPDy1GdlKBTS4iI0 JrIHOpJQvz5WQB9xLbOyfBXJmwSc3EoqZwEC4yTDj6XgQLVDfHje4FIUJmSP2Nn//3 6FL9u7xNc4C5BaNxwz/VaE2WdJS+m8X4AAhYWcm2nDPtaHK+jFQewU7yiyE3/sOtrD xKTIuuron1+2Q== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9CC80691C8 for ; Thu, 8 Jan 2026 11:52:38 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898356; bh=a2UGFJ3Jnfra3vkzOOhfTBTFa/xHGCaJ4ioATKXTU7U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sKul2adN+CyBypZWi3s4jvGmPFhdbeieES9dGdVkMHOy4TII98FOHMpvwkvJeFaoP OFm2WX2/ECa+/6MSMPi33og0Wa7Hme67SwJ1KUv+xPXSdV4ZVLrMY3sGjzTkEExqD1 h5uSB5y8BtJW4u6sZABNwfe3lw3dwhaI6wcFKZK7lfGr9Ezk0pmB8MaFF3C+D7zfOs 1EcZiNmREQ4p0MJ2yTD6Gci2m66HqDf2fE05Ro3wNTXq7oEhe8CGHHtqraSgZxa2EG Q2qeWlhXhDwGR7rN7CdgUNt7k0lena3pQsrSX/XkNQgW47AM/B1gAYRCK32f4qHxGX FOTTLfMEZ5gmQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 99AAC69057; Thu, 8 Jan 2026 11:52:36 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id 5Cu26MJb3DXS; Thu, 8 Jan 2026 11:52:36 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898352; bh=jhq03zWxz018SnLTquknqwKDdq9U21QyEuZDcLqfWLI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J8QC+Demp91G6my7ZNlincB3E7pkqTr/zREBTFs4rl7w2BOL5kqUHX95Ahq0HpIj3 buPwOLnJLuQRUGSaJ7w0S8r99KzV1Dyvx9MmZYhPD67g/mw5fXeBD7EMPZklWO5aO3 QqMo5wljnGGxbmgMZkhxa2HtkySxV1gi5TGLHWfjAAW8qtWTJ+cYtTiwNOL95Zk4G5 xrh9r1Ze3AhZOyOiW5cYbNl6RDGCm0p7gT3glKnVpQ6vqDpOcS9PuWqYz4JQRDrBGW /aglKUK2a7wn0Zx+CDJBHI2PaSqxdxmFhUfW7BofHsr+hMidlO4/09aY42YGzZ/txT OY3z4YvFQ+fEg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 2F06869101; Thu, 8 Jan 2026 11:52:32 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 8 Jan 2026 11:51:22 -0700 Message-ID: <20260108185149.1995917-8-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260108185149.1995917-1-sjg@u-boot.org> References: <20260108185149.1995917-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: J7IJEVQZTY32TMXIR6X654NFDOWQD7MF X-Message-ID-Hash: J7IJEVQZTY32TMXIR6X654NFDOWQD7MF X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 07/21] ext4l: Correct type of invalidate_folio() List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass This function in struct address_space_operations should use size_t for its last two args, to match the ext4l code. Fix it. Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 5676f76d4b4..21caecc2ada 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -1368,7 +1368,7 @@ struct address_space_operations { int (*read_folio)(struct file *, struct folio *); void (*readahead)(struct readahead_control *); sector_t (*bmap)(struct address_space *, sector_t); - void (*invalidate_folio)(struct folio *, unsigned long, unsigned long); + void (*invalidate_folio)(struct folio *, size_t, size_t); bool (*release_folio)(struct folio *, gfp_t); int (*write_begin)(const struct kiocb *, struct address_space *, loff_t, unsigned, struct folio **, void **); int (*write_end)(const struct kiocb *, struct address_space *, loff_t, unsigned, unsigned, struct folio *, void *); From patchwork Thu Jan 8 18:51:23 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1349 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898360; bh=a+R7Hk2agpSTSsFN6l9Oj3Grkt4eW0+hHu24JVnAlOI=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=AoRWXHuMR4+K+U0hPII5EmsqY0GE3spSz2/c2zllPqjMJPrCkOqHrYSMjZ807/6GB f7fruqKkvvx9qe0V9kt6YcFEbcTwg7EtytWMwyuoCQ0HboWkKdy3nLRlStcg9y0ucC CkxibQWelKN8wohE2l52QYCvCrHnqOYJKoHY7qzz7SYZntZqypSQOIq6l/EiOQpAqM EOfnTpzW9vpOQUlptLhPFL5f76ImeB39j0J5/QtvTBokCkr0jPsUklCyTbYqrqTzPn 5IxwG8cBeOzRN+LX/KVlAcYPqfLpKMrBOR1AG2gIviYJK9I3hK6EFSS+Zr7MWoJofb R/pHkhh88MYag== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2BF0C691DC for ; Thu, 8 Jan 2026 11:52:40 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 4mtilcIic-X8 for ; Thu, 8 Jan 2026 11:52:40 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898359; bh=a+R7Hk2agpSTSsFN6l9Oj3Grkt4eW0+hHu24JVnAlOI=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=fys7TmdnublCX//MmGEhEsivqGRq9cOwO/LCNgQvRY2F9TZhvjtJKILNbdm+JPQez BVIoGzpq3SPYBjjDnVxMF7UjgQiziXtj12olR3qYqj9kLIJSPJwwbRUT/RVvEM8d1e M/H2q4Cb3sKodyfpugoIl4rIBZZAlOoC3PuWpsItFLY7vOJWYr7IAsGfSTlzrdedkY qm8Mm1ThQM86BTB0G2c/05TjQU2NhEkunY8ap4zUKLxQpUFrpNcd+XlZDmLmeGPGUE m0saE0+Mdhl5taiMsbi+arcQhDH4VzSHIITAZJvfDGkiOe4jXLsnG/1tE4fZuogB7T 35J0JTRmIu/8Q== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 15312691C8 for ; Thu, 8 Jan 2026 11:52:39 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898357; bh=bbA39X4WmtAtuUClqC/H/HuxSQsh/Q40uvXnH9lh7Ow=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ngTqLhSj9+W2XeFMd7hKoazy1tek2O5oPSqISCJvyMuxit8gG+4XA3jwEANR8/Qrj Yuf4gu7ZmjqOAo9V28ucqoPqrKCxydeOxUFGe6GnfQ82eLkTBiHEYQ9uIrDoJiDO1W dMR7Di8RYbv3xSURr3LA1/ULXUjFgkQq8ZuRERiix+voPtGtqiAwWyNdT6/6He9S3T SENbMk5JxGN5+BsZyJ73IQpjZ8w0ClfYkjZxPQQToBz5NtpydP/YAlo2fq8jd31zOu g2yGQgodaKuZkhOCza0KIMWuxwscyz7Ev7mpc/2gnXDUd5uAhvPGUvAdYaKxaY1hEF W4PDoTU+a3tEw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5F0A3691C4; Thu, 8 Jan 2026 11:52:37 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id BOyi5xCQ0FS6; Thu, 8 Jan 2026 11:52:37 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898357; bh=sprIlTKBmpF6a/K6D14rkSZZiCM/s+AVv2AHtk2rdxk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oAROT9dO0I6Il/dAYAy3TThNVpywB+8G8kR7DyqfLaq9y0Hlw9TnyhiQ8A9QS5nlF Sz11bBRUKUxQ8pDYwE+iJjB+63zExf0e9cOU79ZUYFZ498Xwvjf8KdNCLkpUG3dBl5 seLKLnm/EarJdT/2zNZBjILLIAg+Us1hkre+AhMMDz/rY8kN3lf2KAQNsXPVYLcdeN Cdvmw9yyMcKETa4Qlxaek/reRH3GaSrT5aGH3FvaSNrbbLqtWQw3SQ019eYWAwoiWj j5LYqvy+GluA8wEAS0x4zMZx9Z+JEbgzR3Brs2vm1Jr/bURPe/dca6I+j6QeCA0NYC j6fEqruVX1A0Q== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id B98D569101; Thu, 8 Jan 2026 11:52:36 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 8 Jan 2026 11:51:23 -0700 Message-ID: <20260108185149.1995917-9-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260108185149.1995917-1-sjg@u-boot.org> References: <20260108185149.1995917-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: ZZ5XEJCTDQ4RET7X6Q5SIWWOCUVAT3ND X-Message-ID-Hash: ZZ5XEJCTDQ4RET7X6Q5SIWWOCUVAT3ND X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 08/21] ext4l: Tie verbose messages to CONFIG_EXT4L_DEBUG List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass The ext4 code contains many detailed error messages that consume about 20K of rodata. These messages are helpful for debugging mount failures but not essential for normal operation. Use CONFIG_EXT4L_DEBUG directly in ext4.h so that when debug is disabled, the message macros (ext4_msg, ext4_error, ext4_warning, etc.) use generic empty strings instead of detailed format strings. This allows the compiler to eliminate the string literals from rodata. Add a separate CONFIG_EXT4L_PRINT option to control whether messages are printed to the console. Messages are always recorded internally for programmatic access; this option only affects console output. Mount failures are still reported, but without specific details about what went wrong. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/Kconfig | 18 +++++++++++++++++- fs/ext4l/ext4.h | 6 +++++- fs/ext4l/ext4_uboot.h | 10 ---------- fs/ext4l/super.c | 4 ++-- 4 files changed, 24 insertions(+), 14 deletions(-) diff --git a/fs/ext4l/Kconfig b/fs/ext4l/Kconfig index be989208ec5..1f1e9bdb3ed 100644 --- a/fs/ext4l/Kconfig +++ b/fs/ext4l/Kconfig @@ -29,8 +29,24 @@ config EXT4_JOURNAL config EXT4L_DEBUG bool "Enable ext4l debug messages" depends on FS_EXT4L + default y if SANDBOX help Enable debug and informational messages from the ext4l filesystem. - This includes mount messages and other ext4_msg() output. + This includes mount messages, error details, and other ext4_msg() + output with full format strings. + + Disabling this option replaces detailed error messages with generic + strings, saving about 20K of rodata. Mount failures will still be + reported but without specific details about what went wrong. + + If unsure, say N. + +config EXT4L_PRINT + bool "Print ext4l messages to console" + depends on EXT4L_DEBUG + help + Print ext4l messages to the console in addition to recording them. + Messages are always recorded and can be retrieved programmatically; + this option controls whether they are also printed. If unsure, say N. diff --git a/fs/ext4l/ext4.h b/fs/ext4l/ext4.h index 34dbc4f12b8..8a42d8f9bde 100644 --- a/fs/ext4l/ext4.h +++ b/fs/ext4l/ext4.h @@ -3266,7 +3266,11 @@ void __ext4_grp_locked_error(const char *, unsigned int, #define ext4_abort(sb, err, fmt, a...) \ __ext4_error((sb), __func__, __LINE__, true, (err), 0, (fmt), ## a) -#ifdef EXT4L_PRINTF +/* + * When CONFIG_EXT4L_DEBUG is enabled, pass full messages through the error + * macros. When disabled, use empty strings to save rodata space. + */ +#ifdef CONFIG_EXT4L_DEBUG #define ext4_error_inode(inode, func, line, block, fmt, ...) \ __ext4_error_inode(inode, func, line, block, 0, fmt, ##__VA_ARGS__) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 21caecc2ada..a34f5d74dfa 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -40,16 +40,6 @@ #include /* Real rbtree implementation */ #include /* For crc32() used by crc32_be */ -/* - * Enable ext4_msg() and other diagnostic macros to pass full messages. - * This is required for message recording to work. Without this, the - * ext4_msg macro passes empty strings to __ext4_msg(). - * - * Use EXT4L_PRINTF instead of CONFIG_PRINTK since U-Boot requires CONFIG_ - * options to be defined in Kconfig. - */ -#define EXT4L_PRINTF 1 - /* * __CHAR_UNSIGNED__ - directory hash algorithm selection * diff --git a/fs/ext4l/super.c b/fs/ext4l/super.c index 48c87eb0e97..b2c95118220 100644 --- a/fs/ext4l/super.c +++ b/fs/ext4l/super.c @@ -971,8 +971,8 @@ void __ext4_msg(struct super_block *sb, /* Record in message buffer */ ext4l_record_msg(buf, len); - /* Also print if debug is enabled */ - if (IS_ENABLED(CONFIG_EXT4L_DEBUG)) + /* Also print if requested */ + if (IS_ENABLED(CONFIG_EXT4L_PRINT)) printf("%s", buf); } From patchwork Thu Jan 8 18:51:24 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1350 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898364; bh=Pj0SARvP7GVcTcgd6JjTEA1AwDt1++hhkkWePdNFCis=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=e55aTfHft+7F3kpGkbrl0Ora2aGxwxXGDSAl81rnRPgYS3kf/5jVIBWSYpFera9rC nRTx4HtS/QeSwjmPUEsU/UaNiq5sNTN1lJER3PV7d7vc/p2ouZN6EFmmoazTuwQSHq y4dwm/Kw5nXxFj87z/W4JRfBQPv98ycJ6uVmTt1QTQ5qvYcvcBXKs9fcZmAhwWFs4U VYR/pxQMeRgveJhVWNnoK5/UCEnbBbIg6hVxzVJWxfu34AgO9TWC1oJlWRx8P7J/6q a43xRwuAClYSpB7JVsEr6eVvPxlcqq5TUv92miuPx0P4PqYuRtMtfor0xcs4RRL76x TBaErCDzQWFRA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 91A9E691C4 for ; Thu, 8 Jan 2026 11:52:44 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 7juXoj54I_uJ for ; Thu, 8 Jan 2026 11:52:44 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898364; bh=Pj0SARvP7GVcTcgd6JjTEA1AwDt1++hhkkWePdNFCis=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=e55aTfHft+7F3kpGkbrl0Ora2aGxwxXGDSAl81rnRPgYS3kf/5jVIBWSYpFera9rC nRTx4HtS/QeSwjmPUEsU/UaNiq5sNTN1lJER3PV7d7vc/p2ouZN6EFmmoazTuwQSHq y4dwm/Kw5nXxFj87z/W4JRfBQPv98ycJ6uVmTt1QTQ5qvYcvcBXKs9fcZmAhwWFs4U VYR/pxQMeRgveJhVWNnoK5/UCEnbBbIg6hVxzVJWxfu34AgO9TWC1oJlWRx8P7J/6q a43xRwuAClYSpB7JVsEr6eVvPxlcqq5TUv92miuPx0P4PqYuRtMtfor0xcs4RRL76x TBaErCDzQWFRA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 80988691C8 for ; Thu, 8 Jan 2026 11:52:44 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898362; bh=glNxx1btVbXspZQYMzs74DIUUp2uN34sqhEnwWsU6Vk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ub6nSuij9PrjDZU2xsAUMPiCkeWwc9DT/SxomGthGV5Dl29Y47nBTONjdTR8HGah5 bdx+VbpfJpUrgby2Gk1N70jKE4z6vC5+HmeKnootaxYAcUQ+sr6iyx7TlXzPzWVDNZ fzBfUwna8YFDXJ8HJ+u3E/Le3tOb88GdmGxByB9cdSzq8emCl4FUdDrq8mYEz+3B+F RBTUUvtsKGFtWooT5XO9WX8Cc0tz1B7GJds01HSbMTjOYwTPJV/6OtiaUUnt63/X+e PQQHRcHxQKVIvE9F8STsiE0RU0ZIDPcb++pls3NtbBd0qcQEe93lQFBcFk8VZfCYNY GHsiBmkTHCLFg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 633C0691C4; Thu, 8 Jan 2026 11:52:42 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id ZGYlLBWAQ562; Thu, 8 Jan 2026 11:52:42 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898358; bh=jfWme1DzpLhXIolfisAhg35pgJL0aAZt+qB1mAWLpzw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tSkWAawcfRxNjASHDiXoPQZXZtX2uOJwG5dTTCdfjd0E81l5GCudAEs48G1FEROey ysOx+pq9BqLHoDZ2rCtqkKWlsVXK2wfXQ8Ny5L8DPVqFIYBO8qaxLktru35Ed/TgoM nCmV5XIND+al3QUlZbes/CzfUOvB2DOvVY8KXHJ3ncmjx0qWYMnj9CHy3XIdcSCI79 1Aj1IwGbaTubdt4EuZgMZukQS/sozytFPMfOBPyyeFy2/B35m81Tx6CWiiI9UJkiiB f96rsfB+SUvW9jx6BUiGQFCAqzr8PVSWErKXX4YFUaXb7rSe2dzd+2agcRb1FgnQNi qr2rxMkTe5ufQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id A102D69101; Thu, 8 Jan 2026 11:52:37 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 8 Jan 2026 11:51:24 -0700 Message-ID: <20260108185149.1995917-10-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260108185149.1995917-1-sjg@u-boot.org> References: <20260108185149.1995917-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: QX3TNJFCNKICAWOB37IHIARHCTATG2Z4 X-Message-ID-Hash: QX3TNJFCNKICAWOB37IHIARHCTATG2Z4 X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 09/21] ext4l: Add Kconfig options for optional features List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add configuration options to disable unused ext4 features: - CONFIG_EXT4_RESIZE: Online filesystem resize - CONFIG_EXT4_MIGRATE: Indirect/extent migration - CONFIG_EXT4_MOVE_EXTENT: Move extent ioctl These features are only called from ioctl.c and are not needed for U-Boot's basic filesystem operations. They default to disabled, but could be resurrected if another API could be provided. Provide an inline stub for ext4_kvfree_array_rcu() when resize is disabled, since it is called from mballoc.c and super.c There is very little code-size impact of this change, since the code is already eliminated by the linker. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/Kconfig | 28 ++++++++++++++++++++++++++++ fs/ext4l/Makefile | 14 +++++++++----- fs/ext4l/ext4.h | 8 ++++++++ 3 files changed, 45 insertions(+), 5 deletions(-) diff --git a/fs/ext4l/Kconfig b/fs/ext4l/Kconfig index 1f1e9bdb3ed..7bb1cbe7537 100644 --- a/fs/ext4l/Kconfig +++ b/fs/ext4l/Kconfig @@ -49,4 +49,32 @@ config EXT4L_PRINT Messages are always recorded and can be retrieved programmatically; this option controls whether they are also printed. +config EXT4_RESIZE + bool "Enable ext4 online resize support" + depends on FS_EXT4L + help + Enable support for online filesystem resize. This allows + growing an ext4 filesystem while it is mounted. + + This adds about 10K to the image size. Not needed for U-Boot + in most cases. If unsure, say N. + +config EXT4_MIGRATE + bool "Enable ext4 extent migration support" + depends on FS_EXT4L + help + Enable support for migrating inodes between indirect block + mapping and extent mapping formats. + + This adds about 2.5K to the image size. Not needed for U-Boot + in most cases. If unsure, say N. + +config EXT4_MOVE_EXTENT + bool "Enable ext4 move extent ioctl support" + depends on FS_EXT4L + help + Enable support for the EXT4_IOC_MOVE_EXT ioctl which moves + extents between files. + + This adds about 1.5K to the image size. Not needed for U-Boot. If unsure, say N. diff --git a/fs/ext4l/Makefile b/fs/ext4l/Makefile index 7bb843c3fad..262384b6bbb 100644 --- a/fs/ext4l/Makefile +++ b/fs/ext4l/Makefile @@ -5,10 +5,14 @@ obj-y := interface.o support.o stub.o +# Core ext4 objects (always needed) obj-y += balloc.o bitmap.o block_validity.o dir.o ext4_jbd2.o extents.o \ extents_status.o file.o fsmap.o fsync.o hash.o ialloc.o \ - indirect.o inline.o inode.o mballoc.o migrate.o \ - mmp.o move_extent.o namei.o page-io.o readpage.o resize.o \ - super.o symlink.o xattr.o \ - xattr_hurd.o xattr_trusted.o \ - xattr_user.o fast_commit.o orphan.o + indirect.o inline.o inode.o mballoc.o mmp.o namei.o \ + page-io.o readpage.o super.o symlink.o xattr.o \ + xattr_hurd.o xattr_trusted.o xattr_user.o fast_commit.o orphan.o + +# Optional features +obj-$(CONFIG_EXT4_RESIZE) += resize.o +obj-$(CONFIG_EXT4_MIGRATE) += migrate.o +obj-$(CONFIG_EXT4_MOVE_EXTENT) += move_extent.o diff --git a/fs/ext4l/ext4.h b/fs/ext4l/ext4.h index 8a42d8f9bde..26795a595df 100644 --- a/fs/ext4l/ext4.h +++ b/fs/ext4l/ext4.h @@ -3185,7 +3185,15 @@ extern int ext4_generic_delete_entry(struct inode *dir, extern bool ext4_empty_dir(struct inode *inode); /* resize.c */ +#ifdef CONFIG_EXT4_RESIZE extern void ext4_kvfree_array_rcu(void *to_free); +#else +static inline void ext4_kvfree_array_rcu(void *to_free) +{ + kvfree(to_free); +} +#endif + extern int ext4_group_add(struct super_block *sb, struct ext4_new_group_data *input); extern int ext4_group_extend(struct super_block *sb, From patchwork Thu Jan 8 18:51:25 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1351 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898365; bh=H/qMZ0E7x9asS+WBt1hEq7NJ0nsFtqHhI4QutfsT41Y=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=KyZ7Vu6h6mr/EBXnavDsaSAhPfCJjTuMeNtJLxp3F7KOSEMO5lY3oJ6iJZtQQSbVH 0pYB0U0vXSOcFVLyyH0xdElzEuuYxrLVFpfPtFhRldbMGaiQ2DLOqHdlfLpYCL/ygW OOOSuo5/bCrbhmch8PaZHSEjaE8+IpV3yXwLrJLPno4bJ+gJgMpF6KqgephrdTA0zz 9ZEDt4jhd8bAlMfF9CuLlXE4v3uXV25XMiENeosh3cN6DTF79LNXnCCr9nunllKjNi tnvAdBxCw5tMwjYeRuFZ8YbFtl+0bsWa+t7+ZZWVNcWcvwR28RQH7jMptRc5unFlKp lm/c5G7KTIrgw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6460B691C4 for ; Thu, 8 Jan 2026 11:52:45 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id qtoIqN_rMmAI for ; Thu, 8 Jan 2026 11:52:45 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898365; bh=H/qMZ0E7x9asS+WBt1hEq7NJ0nsFtqHhI4QutfsT41Y=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=KyZ7Vu6h6mr/EBXnavDsaSAhPfCJjTuMeNtJLxp3F7KOSEMO5lY3oJ6iJZtQQSbVH 0pYB0U0vXSOcFVLyyH0xdElzEuuYxrLVFpfPtFhRldbMGaiQ2DLOqHdlfLpYCL/ygW OOOSuo5/bCrbhmch8PaZHSEjaE8+IpV3yXwLrJLPno4bJ+gJgMpF6KqgephrdTA0zz 9ZEDt4jhd8bAlMfF9CuLlXE4v3uXV25XMiENeosh3cN6DTF79LNXnCCr9nunllKjNi tnvAdBxCw5tMwjYeRuFZ8YbFtl+0bsWa+t7+ZZWVNcWcvwR28RQH7jMptRc5unFlKp lm/c5G7KTIrgw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4A397691CE for ; Thu, 8 Jan 2026 11:52:45 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898363; bh=YRdhr5fjitmnsql04uhU0ywrVHZjq7VBz0UxuIlo3M8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qAvSweULJ/tT9X8fAjpb3T/u5m3iHiE/x0WojYIB6NnF5UnLrGddRko0srnr6y/Az ErzTgn5Xi6tplJ45Rf3vMGB+wmuXpwzaObAOqKAo88Gu+cKqg6w1rICmS0Qv3o/QrA GphjFPJZ6AStRm/X6zYlmgR+DkOoq7w/+kEdJWCfXBmH1JCYY48glFZOzqq8qZhzJj xcxn2C3+4mtKpJuKijx68yuN01csa6CyCaY2lPu3/CGmdus4/Ah6RYjk4wIaohyNrQ FjKWwnbUpKbbhgYPwq5Fe6iQU/BbEsFUK9/X2rUFxtOy1hNAKVVC4zRpMUAtkMQ0aS LOoxGHHkSJW5g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 163A069101; Thu, 8 Jan 2026 11:52:43 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id xC6rAxaAbWtp; Thu, 8 Jan 2026 11:52:43 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898362; bh=zuh2AqEOh1fh3n6/+dsH1rLZ0njWW500hk0M8qyKicE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Tl+PND3z2ZQkE5RzUpA9bia2dGBb2s6vA1BXmUUCfBDVDmqXCywB2LIdLdK6LZS8K C7Gj2tH6B8b+yVq19IBhgY6CKL6/+/+VtWWz+KGw1FHRM+dUQyt/KyxYB5PMGP3dmY JH4iCo5sCpyhAwx5+UT3u6krGY4jC0Dpm3zK/xvVChqLShJ6O/vkx3nbHon9H1njnn hltUruwwxTJ6LbUrgl8/+LHaNzra/5G87D9bMv5KCD/aGXLB2f/13/CzGfKLAhB8UH GNmCiL2RcxhNLDC23ISa4IXyCCAu3bVDzt0Hp2rTtZnlx1QdPZCPuzbMfshtCCEWKN BKvmmzArfpugQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 502AE69057; Thu, 8 Jan 2026 11:52:42 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 8 Jan 2026 11:51:25 -0700 Message-ID: <20260108185149.1995917-11-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260108185149.1995917-1-sjg@u-boot.org> References: <20260108185149.1995917-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: DU2JPDEQ3K2QTS26LQN7ICXPDBAFMMUG X-Message-ID-Hash: DU2JPDEQ3K2QTS26LQN7ICXPDBAFMMUG X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 10/21] ext4l: Make extended attributes (xattr) optional List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add CONFIG_EXT4_XATTR to allow disabling support for extended attributes. This saves about 14K on Thumb2 (e.g. firefly-rk3288). When disabled, inline stub functions return -EOPNOTSUPP or 0 as appropriate. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/Kconfig | 10 ++++++ fs/ext4l/Makefile | 5 +-- fs/ext4l/ext4_uboot.h | 2 ++ fs/ext4l/super.c | 2 +- fs/ext4l/xattr.h | 83 +++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 99 insertions(+), 3 deletions(-) diff --git a/fs/ext4l/Kconfig b/fs/ext4l/Kconfig index 7bb1cbe7537..ee7b9bb2dd6 100644 --- a/fs/ext4l/Kconfig +++ b/fs/ext4l/Kconfig @@ -78,3 +78,13 @@ config EXT4_MOVE_EXTENT This adds about 1.5K to the image size. Not needed for U-Boot. If unsure, say N. + +config EXT4_XATTR + bool "Enable ext4 extended attributes support" + depends on FS_EXT4L + help + Enable support for extended attributes (xattrs) on ext4 + filesystems. This is required for ACLs, security labels, + and user-defined attributes. + + This adds about 14K to the image size. If unsure, say N. diff --git a/fs/ext4l/Makefile b/fs/ext4l/Makefile index 262384b6bbb..720181908f8 100644 --- a/fs/ext4l/Makefile +++ b/fs/ext4l/Makefile @@ -9,10 +9,11 @@ obj-y := interface.o support.o stub.o obj-y += balloc.o bitmap.o block_validity.o dir.o ext4_jbd2.o extents.o \ extents_status.o file.o fsmap.o fsync.o hash.o ialloc.o \ indirect.o inline.o inode.o mballoc.o mmp.o namei.o \ - page-io.o readpage.o super.o symlink.o xattr.o \ - xattr_hurd.o xattr_trusted.o xattr_user.o fast_commit.o orphan.o + page-io.o readpage.o super.o symlink.o fast_commit.o orphan.o # Optional features obj-$(CONFIG_EXT4_RESIZE) += resize.o obj-$(CONFIG_EXT4_MIGRATE) += migrate.o obj-$(CONFIG_EXT4_MOVE_EXTENT) += move_extent.o +obj-$(CONFIG_EXT4_XATTR) += xattr.o xattr_hurd.o xattr_trusted.o \ + xattr_user.o diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index a34f5d74dfa..4a7e41a75a1 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -420,9 +420,11 @@ struct super_block; struct buffer_head; struct qstr; +#ifdef CONFIG_EXT4_XATTR int __ext4_xattr_set_credits(struct super_block *sb, struct inode *inode, struct buffer_head *block_bh, size_t value_len, bool is_create); +#endif /* ext4_init_security is provided by xattr.h */ /* inode state stubs */ diff --git a/fs/ext4l/super.c b/fs/ext4l/super.c index b2c95118220..d3e1b85ac5d 100644 --- a/fs/ext4l/super.c +++ b/fs/ext4l/super.c @@ -5421,7 +5421,7 @@ static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb) needs_recovery = 0; } - if (!test_opt(sb, NO_MBCACHE)) { + if (!test_opt(sb, NO_MBCACHE) && IS_ENABLED(CONFIG_EXT4_XATTR)) { sbi->s_ea_block_cache = ext4_xattr_create_cache(); if (!sbi->s_ea_block_cache) { ext4_msg(sb, KERN_ERR, diff --git a/fs/ext4l/xattr.h b/fs/ext4l/xattr.h index 1fedf44d4fb..f7b6de1743e 100644 --- a/fs/ext4l/xattr.h +++ b/fs/ext4l/xattr.h @@ -175,6 +175,7 @@ static inline void ext4_write_unlock_xattr(struct inode *inode, int *save) up_write(&EXT4_I(inode)->xattr_sem); } +#ifdef CONFIG_EXT4_XATTR extern ssize_t ext4_listxattr(struct dentry *, char *, size_t); extern int ext4_xattr_get(struct inode *, int, const char *, void *, size_t); @@ -216,6 +217,88 @@ __xattr_check_inode(struct inode *inode, struct ext4_xattr_ibody_header *header, #define xattr_check_inode(inode, header, end) \ __xattr_check_inode((inode), (header), (end), __func__, __LINE__) +#else /* !CONFIG_EXT4_XATTR */ + +static inline ssize_t ext4_listxattr(struct dentry *d, char *b, size_t s) +{ + return -EOPNOTSUPP; +} + +static inline int ext4_xattr_delete_inode(handle_t *handle, struct inode *inode, + struct ext4_xattr_inode_array **array, + int extra_credits) +{ + return 0; +} + +static inline void ext4_xattr_inode_array_free(struct ext4_xattr_inode_array *a) +{ +} + +static inline void ext4_evict_ea_inode(struct inode *inode) +{ +} + +#define ext4_xattr_handlers NULL + +static inline struct mb_cache *ext4_xattr_create_cache(void) +{ + return NULL; +} + +static inline void ext4_xattr_destroy_cache(struct mb_cache *c) +{ +} + +static inline int +__xattr_check_inode(struct inode *inode, struct ext4_xattr_ibody_header *header, + void *end, const char *function, unsigned int line) +{ + return 0; +} + +#define xattr_check_inode(inode, header, end) \ + __xattr_check_inode((inode), (header), (end), __func__, __LINE__) + +static inline int __ext4_xattr_set_credits(struct super_block *sb, + struct inode *inode, + struct buffer_head *block_bh, + size_t value_len, bool is_create) +{ + return 0; +} + +static inline int ext4_expand_extra_isize_ea(struct inode *inode, + int new_extra_isize, + struct ext4_inode *raw_inode, + handle_t *handle) +{ + return 0; +} + +static inline int ext4_xattr_ibody_find(struct inode *inode, + struct ext4_xattr_info *i, + struct ext4_xattr_ibody_find *is) +{ + return -EOPNOTSUPP; +} + +static inline int ext4_xattr_ibody_get(struct inode *inode, int name_index, + const char *name, void *buffer, + size_t buffer_size) +{ + return -EOPNOTSUPP; +} + +static inline int ext4_xattr_ibody_set(handle_t *handle, struct inode *inode, + struct ext4_xattr_info *i, + struct ext4_xattr_ibody_find *is) +{ + return -EOPNOTSUPP; +} + +#endif /* CONFIG_EXT4_XATTR */ + #ifdef CONFIG_EXT4_FS_SECURITY extern int ext4_init_security(handle_t *handle, struct inode *inode, struct inode *dir, const struct qstr *qstr); From patchwork Thu Jan 8 18:51:26 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1352 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898368; bh=RIM9EgBN5UkKDrJzfug/AnetT7zX4VsoF+OUFkR/4ps=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=OzUH+JFfmDRsR8gbqCrydyhCNOI/2LBbp87+rfwEfgQm/80m752dX1Y/p432xPTBP S9VLob0vS32MJvO3vHzixX6MEusGv3jUcMoDl82f8HEaK88xTimVvCJGxQybTA0Vtu uPWsJ9gfebbXSsEslBmyDf2m77waygmzU94Fe3Pwgdr7vd5NaU1IquOmXhtANB4tsA C9ZTgsZwQdiYiLWdDk8iUtSjIBjABxJIM6joxs8WfHjw8B1qy0c3Gn7gTWfLUknQwg u3x1Z4pim0ejtuh/YAt7DvK5+sfSJB8jsF3U+6Pr0/s2EFJTMoYKccv443qAvIeqha kguQMb3aJQiHQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C2971691CE for ; Thu, 8 Jan 2026 11:52:48 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 7R1E_AppOaKK for ; Thu, 8 Jan 2026 11:52:48 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898368; bh=RIM9EgBN5UkKDrJzfug/AnetT7zX4VsoF+OUFkR/4ps=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=OzUH+JFfmDRsR8gbqCrydyhCNOI/2LBbp87+rfwEfgQm/80m752dX1Y/p432xPTBP S9VLob0vS32MJvO3vHzixX6MEusGv3jUcMoDl82f8HEaK88xTimVvCJGxQybTA0Vtu uPWsJ9gfebbXSsEslBmyDf2m77waygmzU94Fe3Pwgdr7vd5NaU1IquOmXhtANB4tsA C9ZTgsZwQdiYiLWdDk8iUtSjIBjABxJIM6joxs8WfHjw8B1qy0c3Gn7gTWfLUknQwg u3x1Z4pim0ejtuh/YAt7DvK5+sfSJB8jsF3U+6Pr0/s2EFJTMoYKccv443qAvIeqha kguQMb3aJQiHQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B0400691C8 for ; Thu, 8 Jan 2026 11:52:48 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898367; bh=cwsNX8fEgLT6vVE+zye5ieZ8qoOg9HOUJBjGM1vw0ow=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pQJsyKQyMz487xu6V+fAVBV7G99PhRuKOfH47SQz3gEkRV+rIpFb0t/9NNPx84Zbm a6o/CZK98+DMzJByqxhA5EWGCqiKfYNsgtfjrQdVbxSd+lVXOZVWikiUoQd0j7T2n+ 3HZFvAhRMTVc0NBnxWD1HC3d9wSXj04PjGqmTohH4tU4caIFwYRUsP3wNbcL6mKbxK h/iuCsgcPccGaDxZnDQ1/XsC1bOV2/WmFY69PZDHe6KGzAqFHGRuPXLoKdNwiGxkFG fSm1rZ8sbUWgcKUcn2U1/odPCdSJpCVoyxSwB8iWlY9dyVf1G5GKvVoGnlVg1yJZEK xFOltHY2d3LEA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B960B69101; Thu, 8 Jan 2026 11:52:47 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id 2ccWSoYv1MI2; Thu, 8 Jan 2026 11:52:47 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898363; bh=AdfTZO0TscH15PYyjWeLdYaLXRRc9iewajH4+JuBmzQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I6idZJHeVE/Nw0kVT7uNMGIJJ+jxSzuX4p8iiZVdBauarX+RDTqXc9f9zh8hSmPPw DW57UY0jVxAfg1LKyoTk1BEKkdL/acqWQnjE3HRDC6+rxygoNfRhZeRy1xHZor+dt3 WDs4EFLIknIlLLe4jlvrSzGIxLnjY39TUEDRA9PJtvPU4VYZqrBE8AlQX7NyhTvui+ 3/sbG2Z/GXYc6OMiVxaDMvATtRr7/DUu3e9Lbv2AawnbexcDvSptfRS1rtdk9qFuR1 rKM4ogAkX6ocym1uHAceDnmkDqQsc71uTsUopiQHOZ9CmWCkX7qnyQFozxPUf/8EYi FI10lZpAZgfjA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 584C369057; Thu, 8 Jan 2026 11:52:43 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 8 Jan 2026 11:51:26 -0700 Message-ID: <20260108185149.1995917-12-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260108185149.1995917-1-sjg@u-boot.org> References: <20260108185149.1995917-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 3XSGWPWVZSX6YL67G5IJX6UPMJL33EIY X-Message-ID-Hash: 3XSGWPWVZSX6YL67G5IJX6UPMJL33EIY X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 11/21] ext4l: Add optional inline data and indirect-block support List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add CONFIG_EXT4_INLINE_DATA for inline data support (stores small files in the inode). This depends on xattr and adds ~8K. Disabled by default; filesystems with inline_data are rejected if disabled. Add CONFIG_EXT4_INDIRECT for legacy indirect block mapping used by ext2/ext3. Modern ext4 uses extents instead. Adds ~5K. Enabled by default for ext2/ext3 compatibility. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/Kconfig | 22 +++++++++ fs/ext4l/Makefile | 4 +- fs/ext4l/ext4.h | 118 ++++++++++++++++++++++++++++++++++++++++++++++ fs/ext4l/super.c | 16 +++++++ 4 files changed, 159 insertions(+), 1 deletion(-) diff --git a/fs/ext4l/Kconfig b/fs/ext4l/Kconfig index ee7b9bb2dd6..e494c66e8dc 100644 --- a/fs/ext4l/Kconfig +++ b/fs/ext4l/Kconfig @@ -88,3 +88,25 @@ config EXT4_XATTR and user-defined attributes. This adds about 14K to the image size. If unsure, say N. + +config EXT4_INLINE_DATA + bool "Enable ext4 inline data support" + depends on FS_EXT4L && EXT4_XATTR + help + Enable support for inline data, which stores small files + directly in the inode. This is an uncommon feature that + requires creating the filesystem with -O inline_data. + + Filesystems with inline_data feature will be rejected if + this is disabled. Adds about 8K. If unsure, say N. + +config EXT4_INDIRECT + bool "Enable ext4 indirect block support (ext2/3 compatibility)" + depends on FS_EXT4L + default y + help + Enable support for indirect block mapping used by ext2/ext3 + filesystems. Modern ext4 filesystems use extents instead. + + Filesystems without the extents feature will be rejected if + this is disabled. Adds about 5K. If unsure, say N. diff --git a/fs/ext4l/Makefile b/fs/ext4l/Makefile index 720181908f8..85ddaaa104e 100644 --- a/fs/ext4l/Makefile +++ b/fs/ext4l/Makefile @@ -8,7 +8,7 @@ obj-y := interface.o support.o stub.o # Core ext4 objects (always needed) obj-y += balloc.o bitmap.o block_validity.o dir.o ext4_jbd2.o extents.o \ extents_status.o file.o fsmap.o fsync.o hash.o ialloc.o \ - indirect.o inline.o inode.o mballoc.o mmp.o namei.o \ + inode.o mballoc.o mmp.o namei.o \ page-io.o readpage.o super.o symlink.o fast_commit.o orphan.o # Optional features @@ -17,3 +17,5 @@ obj-$(CONFIG_EXT4_MIGRATE) += migrate.o obj-$(CONFIG_EXT4_MOVE_EXTENT) += move_extent.o obj-$(CONFIG_EXT4_XATTR) += xattr.o xattr_hurd.o xattr_trusted.o \ xattr_user.o +obj-$(CONFIG_EXT4_INLINE_DATA) += inline.o +obj-$(CONFIG_EXT4_INDIRECT) += indirect.o diff --git a/fs/ext4l/ext4.h b/fs/ext4l/ext4.h index 26795a595df..d01955bf59a 100644 --- a/fs/ext4l/ext4.h +++ b/fs/ext4l/ext4.h @@ -3132,12 +3132,30 @@ static inline bool is_special_ino(struct super_block *sb, unsigned long ino) } /* indirect.c */ +#ifdef CONFIG_EXT4_INDIRECT extern int ext4_ind_map_blocks(handle_t *handle, struct inode *inode, struct ext4_map_blocks *map, int flags); extern int ext4_ind_trans_blocks(struct inode *inode, int nrblocks); extern void ext4_ind_truncate(handle_t *, struct inode *inode); extern int ext4_ind_remove_space(handle_t *handle, struct inode *inode, ext4_lblk_t start, ext4_lblk_t end); +#else +static inline int ext4_ind_map_blocks(handle_t *handle, struct inode *inode, + struct ext4_map_blocks *map, int flags) +{ + return -EOPNOTSUPP; +} +static inline int ext4_ind_trans_blocks(struct inode *inode, int nrblocks) +{ + return 0; +} +static inline void ext4_ind_truncate(handle_t *h, struct inode *inode) {} +static inline int ext4_ind_remove_space(handle_t *handle, struct inode *inode, + ext4_lblk_t start, ext4_lblk_t end) +{ + return -EOPNOTSUPP; +} +#endif /* ioctl.c */ extern long ext4_ioctl(struct file *, unsigned int, unsigned long); @@ -3675,6 +3693,7 @@ extern const struct file_operations ext4_file_operations; extern loff_t ext4_llseek(struct file *file, loff_t offset, int origin); /* inline.c */ +#ifdef CONFIG_EXT4_INLINE_DATA extern int ext4_get_max_inline_size(struct inode *inode); extern int ext4_find_inline_data_nolock(struct inode *inode); extern int ext4_destroy_inline_data(handle_t *handle, struct inode *inode); @@ -3733,6 +3752,105 @@ static inline int ext4_has_inline_data(struct inode *inode) return ext4_test_inode_flag(inode, EXT4_INODE_INLINE_DATA) && EXT4_I(inode)->i_inline_off; } +#else /* !CONFIG_EXT4_INLINE_DATA */ +static inline int ext4_get_max_inline_size(struct inode *inode) { return 0; } +static inline int ext4_find_inline_data_nolock(struct inode *inode) { return 0; } +static inline int ext4_destroy_inline_data(handle_t *h, struct inode *i) +{ + return 0; +} +static inline void ext4_update_final_de(void *de_buf, int old_size, + int new_size) {} +static inline int ext4_readpage_inline(struct inode *inode, struct folio *folio) +{ + return -EOPNOTSUPP; +} +static inline int ext4_try_to_write_inline_data(struct address_space *mapping, + struct inode *inode, + loff_t pos, unsigned len, + struct folio **foliop) +{ + return 0; +} +static inline int ext4_write_inline_data_end(struct inode *inode, loff_t pos, + unsigned len, unsigned copied, + struct folio *folio) +{ + return 0; +} +static inline int ext4_generic_write_inline_data(struct address_space *mapping, + struct inode *inode, + loff_t pos, unsigned len, + struct folio **foliop, + void **fsdata, bool da) +{ + return 0; +} +static inline int ext4_try_add_inline_entry(handle_t *handle, + struct ext4_filename *fname, + struct inode *dir, + struct inode *inode) +{ + return 0; +} +static inline int ext4_try_create_inline_dir(handle_t *handle, + struct inode *parent, + struct inode *inode) +{ + return 0; +} +static inline int ext4_read_inline_dir(struct file *filp, + struct dir_context *ctx, + int *has_inline_data) +{ + return 0; +} +static inline int ext4_inlinedir_to_tree(struct file *dir_file, + struct inode *dir, ext4_lblk_t block, + struct dx_hash_info *hinfo, + __u32 start_hash, __u32 start_minor_hash, + int *has_inline_data) +{ + return 0; +} +static inline struct buffer_head *ext4_find_inline_entry(struct inode *dir, + struct ext4_filename *fname, + struct ext4_dir_entry_2 **res_dir, + int *has_inline_data) +{ + return NULL; +} +static inline int ext4_delete_inline_entry(handle_t *handle, struct inode *dir, + struct ext4_dir_entry_2 *de_del, + struct buffer_head *bh, + int *has_inline_data) +{ + return 0; +} +static inline bool empty_inline_dir(struct inode *dir, int *has_inline_data) +{ + return true; +} +static inline struct buffer_head *ext4_get_first_inline_block(struct inode *in, + struct ext4_dir_entry_2 **parent_de, + int *retval) +{ + return NULL; +} +static inline void *ext4_read_inline_link(struct inode *inode) { return NULL; } +struct iomap; +static inline int ext4_inline_data_iomap(struct inode *inode, struct iomap *m) +{ + return 0; +} +static inline int ext4_inline_data_truncate(struct inode *inode, + int *has_inline) +{ + return 0; +} +static inline int ext4_convert_inline_data(struct inode *inode) { return 0; } +static inline int ext4_has_inline_data(struct inode *inode) { return 0; } +#endif /* CONFIG_EXT4_INLINE_DATA */ /* namei.c */ extern const struct inode_operations ext4_dir_inode_operations; diff --git a/fs/ext4l/super.c b/fs/ext4l/super.c index d3e1b85ac5d..4bad3677db3 100644 --- a/fs/ext4l/super.c +++ b/fs/ext4l/super.c @@ -3553,6 +3553,22 @@ int ext4_feature_set_ok(struct super_block *sb, int readonly) return 0; } + if (!IS_ENABLED(CONFIG_EXT4_INLINE_DATA) && + ext4_has_feature_inline_data(sb)) { + ext4_msg(sb, KERN_ERR, + "Filesystem with inline_data feature cannot be " + "mounted without CONFIG_EXT4_INLINE_DATA"); + return 0; + } + + if (!IS_ENABLED(CONFIG_EXT4_INDIRECT) && + !ext4_has_feature_extents(sb)) { + ext4_msg(sb, KERN_ERR, + "Filesystem without extents feature requires " + "CONFIG_EXT4_INDIRECT for indirect block support"); + return 0; + } + if (readonly) return 1; From patchwork Thu Jan 8 18:51:27 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1353 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898374; bh=j6/hmHdIdGVR6IaMpS7YvpngFkzu3m2MXnLpi/VRbp4=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=q5Vw0kME4o1s334zmLy4Cl5yh/+LagycyxooJfCfDs8c82RSmi1esKCRHHL+FPFDe 6RkqHufBbhcM0vDZ8BbjgGn0tCTaGQjB+zY/D5oSlt4WhR5C95oja5jzrd5iD5xKTR dNODBYkcFTKethFj0HaxNXvV5wKWfd43brL3rtBgAX5Dkxkk3ebg90u8ypp+LxYtJH AjdxZqcQyOcEwRUxdbTOgtkFX2ykvda98KDETMRlsnljI2AxTb2nU4KUnwQeO+1Bmh +0FGuDtDEqS07sFFA1LqC+9TtMRIz3C9ykW/zgXUhL5Kzg+OsuR0Myfza2C3Rzbaa/ SgOyO297G/ewg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4B9E0691CC for ; Thu, 8 Jan 2026 11:52:54 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id IAwmkC8UWE4h for ; Thu, 8 Jan 2026 11:52:54 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898374; bh=j6/hmHdIdGVR6IaMpS7YvpngFkzu3m2MXnLpi/VRbp4=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=q5Vw0kME4o1s334zmLy4Cl5yh/+LagycyxooJfCfDs8c82RSmi1esKCRHHL+FPFDe 6RkqHufBbhcM0vDZ8BbjgGn0tCTaGQjB+zY/D5oSlt4WhR5C95oja5jzrd5iD5xKTR dNODBYkcFTKethFj0HaxNXvV5wKWfd43brL3rtBgAX5Dkxkk3ebg90u8ypp+LxYtJH AjdxZqcQyOcEwRUxdbTOgtkFX2ykvda98KDETMRlsnljI2AxTb2nU4KUnwQeO+1Bmh +0FGuDtDEqS07sFFA1LqC+9TtMRIz3C9ykW/zgXUhL5Kzg+OsuR0Myfza2C3Rzbaa/ SgOyO297G/ewg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3C123691C4 for ; Thu, 8 Jan 2026 11:52:54 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898372; bh=pExGZwOVGGyu0ukP26JA/fgvySOkxyAJdx2HMUwGlA0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YLKC9yI5RU4z06rMv4G+Q1Jri4ixN1d2NY/lSCh/maBJokJOw5x79v2kKZia8SBcL 0Zmtjuw+Dyw7Xv7Ovk6G4eWrSMbYStjUEi2aRmmNR6RW25sKS96Dc1672RqBSFEy8b 5NGp+tiYRJdHLHLh1sVXlwlgkSKIge3Y1whSOmZb+XXOgQji5kwOjH4yNFLbc+QK2S tTOhyCP6OplZUPDiBg1ivjvW3d7ng1JaZwF6NwLnBRskvyCs37F++Pxpr2UM59AIsg DLizdEwdpM5fqVQg5Q2sywXD/D9gJhf986/wr3fbD3JbEtNpho/AAH87vHDaefhJdR Yk4+w4Yv6c8eQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 65D5169101; Thu, 8 Jan 2026 11:52:52 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id o8bIN5BXLBZ1; Thu, 8 Jan 2026 11:52:52 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898368; bh=EKOv4mB6l6bWNnkphU9QJFaEz12X4a+pKzcXzGWRgC8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OZvVC4wkf1hYaSu7+MnVK/4T71nZa2JqJSq3y+W3kl0u9wKvgcl+J5tjLGh13rCvG yJ/7ixz38/dpMwHt3wknEgeowfMQSGMT1dBP1oI6pDfg3v0x7kcJy1JpZZm8asTIgM 2av2lmlMsOgt26a83JEK56HI5ImXcSdDvhrwOd2C16OJTDf+etbwcdlbyMER+ICyPu 21d+meSurr33dpXsuw5HLwpk0p+cLtPN7OI1JDZyDn+2HXWcaG+F3YAIlH6yGRrQrI HsB1HKnQpJ5fSIvLbwBgnEma9DH2sv519opKDS44gVYUOyOQELcfBvou1B9OSdPyIU Hl30uH0Y9w95A== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 0A17469057; Thu, 8 Jan 2026 11:52:47 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 8 Jan 2026 11:51:27 -0700 Message-ID: <20260108185149.1995917-13-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260108185149.1995917-1-sjg@u-boot.org> References: <20260108185149.1995917-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: AXHBJJVPDGKIVKHRUT3YQQVG4KDWZFDU X-Message-ID-Hash: AXHBJJVPDGKIVKHRUT3YQQVG4KDWZFDU X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass , Claude X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 12/21] ext4l: Add a CONFIG_EXT4_MBALLOC_PREFETCH option List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add a Kconfig option to make mballoc prefetch support optional. The prefetch functions (ext4_mb_prefetch, ext4_mb_prefetch_fini) are used in Linux to optimise read performance by pre-loading block bitmaps during lazy initialisation. When disabled, guard the calls with IS_ENABLED() checks so gc-sections can remove the prefetch code. This removes the prefetch functions from the binary, reducing the external references to mballoc. Disable this by default as U-Boot is unlikely to gain any performance from this feature. It saves about 300 bytes. Co-developed-by: Claude Signed-off-by: Simon Glass --- fs/ext4l/Kconfig | 15 +++++++++++++++ fs/ext4l/mballoc.c | 5 ++++- fs/ext4l/super.c | 3 ++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/fs/ext4l/Kconfig b/fs/ext4l/Kconfig index e494c66e8dc..3d7578f5073 100644 --- a/fs/ext4l/Kconfig +++ b/fs/ext4l/Kconfig @@ -110,3 +110,18 @@ config EXT4_INDIRECT Filesystems without the extents feature will be rejected if this is disabled. Adds about 5K. If unsure, say N. + +config EXT4_MBALLOC_PREFETCH + bool "Enable ext4 block bitmap prefetch support" + depends on FS_EXT4L + help + Enable prefetching of block allocation bitmaps to improve + allocation performance. When enabled, the multiblock allocator + will read ahead block bitmaps during allocation and lazy + initialization. + + Disabling this saves space by allowing the multiblock allocator + prefetch code to be removed. Read performance may be slightly + reduced during lazy initialization. + + If unsure, say Y. diff --git a/fs/ext4l/mballoc.c b/fs/ext4l/mballoc.c index 1643fd54f27..86ab374d686 100644 --- a/fs/ext4l/mballoc.c +++ b/fs/ext4l/mballoc.c @@ -2858,6 +2858,9 @@ static void ext4_mb_might_prefetch(struct ext4_allocation_context *ac, { struct ext4_sb_info *sbi; + if (!IS_ENABLED(CONFIG_EXT4_MBALLOC_PREFETCH)) + return; + if (ac->ac_prefetch_grp != group) return; @@ -3069,7 +3072,7 @@ out: ac->ac_b_ex.fe_len, ac->ac_o_ex.fe_len, ac->ac_status, ac->ac_flags, ac->ac_criteria, err); - if (ac->ac_prefetch_nr) + if (IS_ENABLED(CONFIG_EXT4_MBALLOC_PREFETCH) && ac->ac_prefetch_nr) ext4_mb_prefetch_fini(sb, ac->ac_prefetch_grp, ac->ac_prefetch_nr); return err; diff --git a/fs/ext4l/super.c b/fs/ext4l/super.c index 4bad3677db3..98785935f19 100644 --- a/fs/ext4l/super.c +++ b/fs/ext4l/super.c @@ -3663,7 +3663,8 @@ static int ext4_run_li_request(struct ext4_li_request *elr) int nr = EXT4_SB(sb)->s_mb_prefetch; u64 start_time; - if (elr->lr_mode == EXT4_LI_MODE_PREFETCH_BBITMAP) { + if (IS_ENABLED(CONFIG_EXT4_MBALLOC_PREFETCH) && + elr->lr_mode == EXT4_LI_MODE_PREFETCH_BBITMAP) { elr->lr_next_group = ext4_mb_prefetch(sb, group, nr, &prefetch_ios); ext4_mb_prefetch_fini(sb, elr->lr_next_group, nr); trace_ext4_prefetch_bitmaps(sb, group, elr->lr_next_group, nr); From patchwork Thu Jan 8 18:51:28 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1354 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898377; bh=xyHyVLbb0+NXWm+Of8FzJyDNCGpPvCTuzP19aRIE4b8=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=OqwVqbqs4CQ2f14fHDfuxWhgt1TQuVu/aMrXf4k27T9Ninw/1Zxn0x8GWgxfPGWaz YLTmiOEQpZcSQg+fPXBmzZjK26MVK6q+bLZ86Z61V/rPchJlt7l8zJBSpYrh8Kg6KJ V1ApiG8LDS5c+a/lBCpbqZQSgq7djZsgSDyQZFexMGCsqghdCnSLK0WPR90ErKT2+i bXGoDQWNek5Hfva34mEUkQqNfM8tF1HsmllPQpZtTK3vJp29tbcChs0Yyc03JL+1Yi UFNrG5DiVB6qrWyQ/gT1cHjuTGpHweW5mN96PAMDpkoJxgufQqY5yZmYEVIAKLLZ0V Q+d4AVg5MWUFQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B3CE9691D0 for ; Thu, 8 Jan 2026 11:52:57 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id eE5PdqF-a6B8 for ; Thu, 8 Jan 2026 11:52:57 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898377; bh=xyHyVLbb0+NXWm+Of8FzJyDNCGpPvCTuzP19aRIE4b8=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=OqwVqbqs4CQ2f14fHDfuxWhgt1TQuVu/aMrXf4k27T9Ninw/1Zxn0x8GWgxfPGWaz YLTmiOEQpZcSQg+fPXBmzZjK26MVK6q+bLZ86Z61V/rPchJlt7l8zJBSpYrh8Kg6KJ V1ApiG8LDS5c+a/lBCpbqZQSgq7djZsgSDyQZFexMGCsqghdCnSLK0WPR90ErKT2+i bXGoDQWNek5Hfva34mEUkQqNfM8tF1HsmllPQpZtTK3vJp29tbcChs0Yyc03JL+1Yi UFNrG5DiVB6qrWyQ/gT1cHjuTGpHweW5mN96PAMDpkoJxgufQqY5yZmYEVIAKLLZ0V Q+d4AVg5MWUFQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A27B9691CC for ; Thu, 8 Jan 2026 11:52:57 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898377; bh=Rp2kh0vyBDM7mKYgfuKg66y2EhW0itjj0sslsm35ML0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wS6U/3OBcJmIHyvgKL6Rg0s8C2SJui7UX/cJx330p4BxSsWNfW/mOjFdWyikS6yoY QIL1tn/YU68z5z0kGoW8OI6YGLiuzXJjnSzH23MBkJZ1hEwDlkafgjMFoBRz731p/L VWfxp5wekaKYhkhyHsHeSOiQrshqywHdzrdeN847Gl2io0EiLwzJVoDXmB97Dg4qDj vuwaHx+H9I/ZZJwRAM3YdbEDXNkPmwxweA3comrZhormE0sAPCV9g17THGoGmKbQKO yXHrLfNhKQOoaMT5sDXoXwXz2KPmc/QEONS6dRGV12fah6PQDl+/9KN7TOo14d6sG7 RpEv0DiDatY4g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1503269101; Thu, 8 Jan 2026 11:52:57 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id ci7W63ibU1dw; Thu, 8 Jan 2026 11:52:57 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898373; bh=Oc8BYuhj/+txlJWo9R1pcbBdZ0cXped1NNOCn+7iPqA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZgwviVLtHOJ/057Ow6D32eSMoyAEFdmCm6R4g48+5jM8ujdVqXNmHTbA11swjNHVg O6JjrvavPP083YJBHpa1ZE2TgrGXT3iGFl7VxHHPYcuo79iM8RMe2uA07tbB0x78Wx mc97uBHv1lzMHnB2A2b4Pew4Y1CXBsI3PMGNqxaeu8UqH2sR9qUCOXR5LjHwECFONE 6iw1TwCabwW15zgiDDjXrkRbICi/lUTyrWtuPDDODY5oWgNkvX5s7MehyU8IQgBCHk SwSpkuv1hOD0aURqda0hhLTXGUlylnDosITAcyRh6DuyhxSAW5AQs8Aa4MMsVldFdv f2DW40FjIVPNQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id A709669057; Thu, 8 Jan 2026 11:52:52 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 8 Jan 2026 11:51:28 -0700 Message-ID: <20260108185149.1995917-14-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260108185149.1995917-1-sjg@u-boot.org> References: <20260108185149.1995917-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: FSVGG5ZNKHF3G2GIMNLOX6RHR5THQ7Z3 X-Message-ID-Hash: FSVGG5ZNKHF3G2GIMNLOX6RHR5THQ7Z3 X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass , Claude X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 13/21] ext4l: Add a CONFIG_EXT4_FAST_COMMIT_REPLAY option List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add a new Kconfig option to control fast commit replay support. Fast commit replay is needed to recover filesystems that were not cleanly unmounted and have pending fast commit records. However, this adds to code size (~8K). Enable it by default, since filesystems are likely to need this. When disabled: - Filesystems with pending fast commits cannot be recovered - Only safe if filesystems are created with -O ^fast_commit or always cleanly unmounted Guard the replay functions in fast_commit.c and provide inline stubs in ext4.h. Update firefly-rk3288_defconfig to disable this feature for space savings. Co-developed-by: Claude Signed-off-by: Simon Glass --- fs/ext4l/Kconfig | 17 +++++++++++++++++ fs/ext4l/ext4.h | 27 ++++++++++++++++++++++----- fs/ext4l/fast_commit.c | 4 ++++ 3 files changed, 43 insertions(+), 5 deletions(-) diff --git a/fs/ext4l/Kconfig b/fs/ext4l/Kconfig index 3d7578f5073..22b290778b7 100644 --- a/fs/ext4l/Kconfig +++ b/fs/ext4l/Kconfig @@ -125,3 +125,20 @@ config EXT4_MBALLOC_PREFETCH reduced during lazy initialization. If unsure, say Y. + +config EXT4_FAST_COMMIT_REPLAY + bool "Enable ext4 fast commit replay support" + depends on FS_EXT4L + default y + help + Enable support for replaying fast commit records during mount. + Fast commit is a journal optimization that records fine-grained + changes. If a filesystem was not cleanly unmounted and has + pending fast commit records, this option is needed to recover. + + Disabling this saves space (~8K) but means filesystems with + pending fast commits cannot be recovered. Only disable if you're + certain your filesystems won't have fast commit records (e.g., + created with -O ^fast_commit). + + If unsure, say Y. diff --git a/fs/ext4l/ext4.h b/fs/ext4l/ext4.h index d01955bf59a..b8e9f2d8c95 100644 --- a/fs/ext4l/ext4.h +++ b/fs/ext4l/ext4.h @@ -2946,6 +2946,28 @@ extern void ext4_end_bitmap_read(struct buffer_head *bh, int uptodate); int ext4_fc_info_show(struct seq_file *seq, void *v); void ext4_fc_init(struct super_block *sb, journal_t *journal); void ext4_fc_init_inode(struct inode *inode); + +#ifdef CONFIG_EXT4_FAST_COMMIT_REPLAY +bool ext4_fc_replay_check_excluded(struct super_block *sb, ext4_fsblk_t block); +void ext4_fc_replay_cleanup(struct super_block *sb); +int ext4_fc_record_regions(struct super_block *sb, int ino, + ext4_lblk_t lblk, ext4_fsblk_t pblk, + int len, int replay); +#else +static inline bool ext4_fc_replay_check_excluded(struct super_block *sb, + ext4_fsblk_t block) +{ + return false; +} +static inline void ext4_fc_replay_cleanup(struct super_block *sb) {} +static inline int ext4_fc_record_regions(struct super_block *sb, int ino, + ext4_lblk_t lblk, ext4_fsblk_t pblk, + int len, int replay) +{ + return 0; +} +#endif + void ext4_fc_track_range(handle_t *handle, struct inode *inode, ext4_lblk_t start, ext4_lblk_t end); void __ext4_fc_track_unlink(handle_t *handle, struct inode *inode, @@ -2960,14 +2982,9 @@ void ext4_fc_track_create(handle_t *handle, struct dentry *dentry); void ext4_fc_track_inode(handle_t *handle, struct inode *inode); void ext4_fc_mark_ineligible(struct super_block *sb, int reason, handle_t *handle); void ext4_fc_del(struct inode *inode); -bool ext4_fc_replay_check_excluded(struct super_block *sb, ext4_fsblk_t block); -void ext4_fc_replay_cleanup(struct super_block *sb); int ext4_fc_commit(journal_t *journal, tid_t commit_tid); int __init ext4_fc_init_dentry_cache(void); void ext4_fc_destroy_dentry_cache(void); -int ext4_fc_record_regions(struct super_block *sb, int ino, - ext4_lblk_t lblk, ext4_fsblk_t pblk, - int len, int replay); /* mballoc.c */ extern const struct seq_operations ext4_mb_seq_groups_ops; diff --git a/fs/ext4l/fast_commit.c b/fs/ext4l/fast_commit.c index ea5be3a079c..4383579ccb1 100644 --- a/fs/ext4l/fast_commit.c +++ b/fs/ext4l/fast_commit.c @@ -1360,6 +1360,7 @@ static void ext4_fc_cleanup(journal_t *journal, int full, tid_t tid) trace_ext4_fc_stats(sb); } +#ifdef CONFIG_EXT4_FAST_COMMIT_REPLAY /* Ext4 Replay Path Routines */ /* Helper struct for dentry replay routines */ @@ -2277,6 +2278,7 @@ static int ext4_fc_replay(journal_t *journal, struct buffer_head *bh, } return ret; } +#endif /* CONFIG_EXT4_FAST_COMMIT_REPLAY */ void ext4_fc_init(struct super_block *sb, journal_t *journal) { @@ -2285,7 +2287,9 @@ void ext4_fc_init(struct super_block *sb, journal_t *journal) * could still have fast commit blocks that need to be replayed even if * fast commit has now been turned off. */ +#ifdef CONFIG_EXT4_FAST_COMMIT_REPLAY journal->j_fc_replay_callback = ext4_fc_replay; +#endif if (!test_opt2(sb, JOURNAL_FAST_COMMIT)) return; journal->j_fc_cleanup_callback = ext4_fc_cleanup; From patchwork Thu Jan 8 18:51:29 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1355 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898383; bh=o15fur3LslkE1xCwaO7U+x7AVxSTSSvrLzAM7ChSf6c=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=bzv0QgefTkflz76D4c//WPUYL3j908bpwJ5anMbI8iCn7+zzsszTm7amB8Z417eiG QFPnFij/+Td6Hbm8gjEwOV9U1QcuSuJ5huBAlRIwa3zttMsb+SEmvVktJh1KvaifzF j6+Wc4ENI65CRLOnYE0RHKOaTpehOqMbl2rBIczLK8Y4xp7ELmyuQjjQRqr0zl1Jas zzhpc/UdqsaJNBbHtWLyFGrwKMu7TvWc5XFQYJaSszXUCbl/1+gPYyhTCBkhCzr7cR VIHlS206FDbn8bnnf27vAIPyCXuNKzooqW3SmODsphBMWLdEqWh+83xzIkn8KPNPpG EX9kzXahJmR9g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6749169101 for ; Thu, 8 Jan 2026 11:53:03 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id dk-fbJxZp36Q for ; Thu, 8 Jan 2026 11:53:03 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898383; bh=o15fur3LslkE1xCwaO7U+x7AVxSTSSvrLzAM7ChSf6c=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=bzv0QgefTkflz76D4c//WPUYL3j908bpwJ5anMbI8iCn7+zzsszTm7amB8Z417eiG QFPnFij/+Td6Hbm8gjEwOV9U1QcuSuJ5huBAlRIwa3zttMsb+SEmvVktJh1KvaifzF j6+Wc4ENI65CRLOnYE0RHKOaTpehOqMbl2rBIczLK8Y4xp7ELmyuQjjQRqr0zl1Jas zzhpc/UdqsaJNBbHtWLyFGrwKMu7TvWc5XFQYJaSszXUCbl/1+gPYyhTCBkhCzr7cR VIHlS206FDbn8bnnf27vAIPyCXuNKzooqW3SmODsphBMWLdEqWh+83xzIkn8KPNPpG EX9kzXahJmR9g== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 55830691C8 for ; Thu, 8 Jan 2026 11:53:03 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898381; bh=hkHdx3ZE3WB7211WLkBvmPLaAZGveYEAQq6CL2Zjh6A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vikCQ7XYcO/Ws7JWS8gpf/jCD3F98jZwlrUS5f/xLDYY3icS+6+N+alwGJwJhC2HX d8vjf6t5VrMAqFHMc21e21fp+xYr9wF/70wecc/P93qTDW0YdiCHXHNTzilqKqPg5e h/rirbLKvLYrkRw6F84fcQUgvY01F9S7XcA/SWaWGTnj+vJwmpS4FbaHUysYiOIYIA duIBaTpfZPxIHr4BIbW8GkJAnLOc2YbivitwyU8l9iSqyF6izwiWNyTpFpscJUNXfW TNmpIqoOzFZVB9j5tpwCjYVZr5sagv+SddZ6XEJvKTfSoZ3LHT7HedJrQe+F9mlXQq IS47C7Sa7kgTQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B3554691C4; Thu, 8 Jan 2026 11:53:01 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id D-9gIWSyFfHi; Thu, 8 Jan 2026 11:53:01 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898377; bh=9GgJI/ch2cMQdDyiWBQOfe/xSB2JXo3EnEv/8wuBfrg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hA3UfiXrt1b0udIEG5BX4SaO1Wgg5UerS/zX4gZdqiTqBxXGdQMOdwoB9ry7SUi20 ZoyQ5DOk7GxXEWD8u4aQJwCt3eKG8Xck2UC57HD1skkIgO6x8l2p2/dDGyAylb7c+x 89+X5crV8GjJAJ8tBs/EKiEteDbSVkaLrGdeIpX+7o6Kz/9nDTmnrKJXrLnY/LzTlA 8Q6KmUigQl69Rs2yn2V/VxtHg82wsT77h3T7Gff5RfLjF6/jUvdHInnT0p+3+EdSer AC/uIoctVh0dWqWEQmGlTc9xtl9ImcXSjQfJ1ZIKFEmRQPg5ArbivaXsAyAEW3s9nM MCb5z3BOGd8Ug== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 58F1969057; Thu, 8 Jan 2026 11:52:57 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 8 Jan 2026 11:51:29 -0700 Message-ID: <20260108185149.1995917-15-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260108185149.1995917-1-sjg@u-boot.org> References: <20260108185149.1995917-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: QPGAIZEOVZT7STKSQZ3IQVDIFXCLQ3FY X-Message-ID-Hash: QPGAIZEOVZT7STKSQZ3IQVDIFXCLQ3FY X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 14/21] ext4l: Add a CONFIG_EXT4_FS_POSIX_ACL option List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add Kconfig option to make POSIX ACL support optional. The acl.c and acl.h files already have proper #ifdef CONFIG_EXT4_FS_POSIX_ACL guards with stub functions when disabled. ACLs require extended attributes, so this option depends on EXT4_XATTR. It is unlikely to be useful in U-Boot but is included for completeness. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/Kconfig | 11 +++++++++++ fs/ext4l/Makefile | 1 + 2 files changed, 12 insertions(+) diff --git a/fs/ext4l/Kconfig b/fs/ext4l/Kconfig index 22b290778b7..1dce08d9474 100644 --- a/fs/ext4l/Kconfig +++ b/fs/ext4l/Kconfig @@ -142,3 +142,14 @@ config EXT4_FAST_COMMIT_REPLAY created with -O ^fast_commit). If unsure, say Y. + +config EXT4_FS_POSIX_ACL + bool "Enable ext4 POSIX Access Control Lists" + depends on FS_EXT4L && EXT4_XATTR + help + Enable POSIX Access Control Lists (ACLs) support for ext4 + filesystems. ACLs provide more fine-grained access control + than the standard Unix permission model. + + ACLs require extended attributes support (EXT4_XATTR). + If unsure, say N. diff --git a/fs/ext4l/Makefile b/fs/ext4l/Makefile index 85ddaaa104e..fd86ce56d2e 100644 --- a/fs/ext4l/Makefile +++ b/fs/ext4l/Makefile @@ -19,3 +19,4 @@ obj-$(CONFIG_EXT4_XATTR) += xattr.o xattr_hurd.o xattr_trusted.o \ xattr_user.o obj-$(CONFIG_EXT4_INLINE_DATA) += inline.o obj-$(CONFIG_EXT4_INDIRECT) += indirect.o +obj-$(CONFIG_EXT4_FS_POSIX_ACL) += acl.o From patchwork Thu Jan 8 18:51:30 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1356 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898387; bh=BNSdgwSBBQUQTAKvwINAoXQlDo0xWoPWlQBSQVWhzmQ=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=WWWYd3uZD2L6reLffRn+0a03ksX7hGKhjMpedFXjDp4CL05Nds0ewBoJzVTzrHtA4 1wDcXrYk/ICN23mbKZ7AN5A35A6ghDEsgJUR05F5WHFMbVWSajvbn6zXBYSkMBWJKF XIgQfXqgcq9f+X47WcFhmFOURjrym5yDr3UdG8c1vvy42cC/ltD/XKYtjFxkRUUP82 TSsC9OiEiJMQGO4PiBaCBADlwF2Rx5+SDxqwRE1QflsgMOPKcbuiHtaYYhCH/SS5/A xfPMBbWdE1JS2pfiEtQ0tMpicTE9m/u70BPs7nHANU7UdEfsVN8ZaloLfBdCv82f77 PVPQA05hGZwTw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E3A1A691DB for ; Thu, 8 Jan 2026 11:53:07 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id hNRuCpITdvrB for ; Thu, 8 Jan 2026 11:53:07 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898387; bh=BNSdgwSBBQUQTAKvwINAoXQlDo0xWoPWlQBSQVWhzmQ=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=WWWYd3uZD2L6reLffRn+0a03ksX7hGKhjMpedFXjDp4CL05Nds0ewBoJzVTzrHtA4 1wDcXrYk/ICN23mbKZ7AN5A35A6ghDEsgJUR05F5WHFMbVWSajvbn6zXBYSkMBWJKF XIgQfXqgcq9f+X47WcFhmFOURjrym5yDr3UdG8c1vvy42cC/ltD/XKYtjFxkRUUP82 TSsC9OiEiJMQGO4PiBaCBADlwF2Rx5+SDxqwRE1QflsgMOPKcbuiHtaYYhCH/SS5/A xfPMBbWdE1JS2pfiEtQ0tMpicTE9m/u70BPs7nHANU7UdEfsVN8ZaloLfBdCv82f77 PVPQA05hGZwTw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D0E75691CC for ; Thu, 8 Jan 2026 11:53:07 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898386; bh=7b73kPQuQG0+Wt9T69ozVGSOmXim+etU0JQY29vIqtc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mVxQxL2nf8ZDSeMd0gNAgqwBg0Kv5NbrkqyKZPtqXMcL/NMAKI5rfr29btVxuWBNH 6PfzZJynrismyqpvj7lkeQlBgT2g9AWexIyD+4GeNFbn9SF+GuMVwiJVewCDXjPELk 7MLkwqF46gndmtObPlCjfR2SuRtNGLvUZHekIvmg1zkp/dFCUQvvOJEkRrO4pi/BdV 65naKNDU5n80K7Gcslf+URbbmVVHWfcPPl5i4O4w4AwsY8Smi5sDQg3SKTQBWQ6Wai sTvxxaSdplmPdSv3iW5I3QCHehf0t9bWhHfFWa6TzQEMJwHmT/J7abrZPDhYe1TsXb GrdTNS5pIdbkA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 55BDE69101; Thu, 8 Jan 2026 11:53:06 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id n4CWyfFtrHrT; Thu, 8 Jan 2026 11:53:06 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898382; bh=3T9QdCJrQJw74teOYOEtNqaaOy4n03KgxZ3mNGD6sls=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Vn7kGEiuF4mfQ2klaYh2tlheloLVJDRbJqlhyJHyLznolT8t53kRkFr4fPnbuTypN iB9ubn48KN1hc9qdDBL7eewMrvs/GA4JK19cVcUoZPsw5kfM8I92la+WfD6mK+AuWB 0SWP/4cAKGMmCiiGDm8ySZL3qOC1oxZdjgBoZATU7qLXSCrfIafM54GccGzXLUV5ig bJlclyrEU8irNnfWo6ouyIxBkfCR1XChxLAPOYKx+Ygr+DQ2W/yiSzwPUTdbR7ag/3 5pT1A7zMU5Oy5/yy77ZhlbbXz5x46JAITvkY+5LFKPFItpqg94VXjHP3wsaxre7EZX hGcQN/XmSQNeA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 012D669057; Thu, 8 Jan 2026 11:53:01 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 8 Jan 2026 11:51:30 -0700 Message-ID: <20260108185149.1995917-16-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260108185149.1995917-1-sjg@u-boot.org> References: <20260108185149.1995917-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: UN7UONHUFG27YWLGBGRUK36BRGWWRFMX X-Message-ID-Hash: UN7UONHUFG27YWLGBGRUK36BRGWWRFMX X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 15/21] ext4l: Add a CONFIG_EXT4_FS_SECURITY option List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add Kconfig option to make security labels support optional. The xattr_security.c file and xattr.h already have proper #ifdef guards with stub functions when disabled. Security labels require extended attributes, so this option depends on EXT4_XATTR. They are unlikely to be useful in U-Boot but is included for completeness. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/Kconfig | 11 +++++++++++ fs/ext4l/Makefile | 1 + 2 files changed, 12 insertions(+) diff --git a/fs/ext4l/Kconfig b/fs/ext4l/Kconfig index 1dce08d9474..b7520aaab16 100644 --- a/fs/ext4l/Kconfig +++ b/fs/ext4l/Kconfig @@ -153,3 +153,14 @@ config EXT4_FS_POSIX_ACL ACLs require extended attributes support (EXT4_XATTR). If unsure, say N. + +config EXT4_FS_SECURITY + bool "Enable ext4 security labels" + depends on FS_EXT4L && EXT4_XATTR + help + Enable security labels support for ext4 filesystems. This + provides an extended attribute handler for file security + labels used by security modules like SELinux. + + Security labels require extended attributes support (EXT4_XATTR). + If unsure, say N. diff --git a/fs/ext4l/Makefile b/fs/ext4l/Makefile index fd86ce56d2e..0f5ee832f2e 100644 --- a/fs/ext4l/Makefile +++ b/fs/ext4l/Makefile @@ -20,3 +20,4 @@ obj-$(CONFIG_EXT4_XATTR) += xattr.o xattr_hurd.o xattr_trusted.o \ obj-$(CONFIG_EXT4_INLINE_DATA) += inline.o obj-$(CONFIG_EXT4_INDIRECT) += indirect.o obj-$(CONFIG_EXT4_FS_POSIX_ACL) += acl.o +obj-$(CONFIG_EXT4_FS_SECURITY) += xattr_security.o From patchwork Thu Jan 8 18:51:31 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1357 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898390; bh=/CGHlXrJozUEeymTjG0yXJyDGexHHV0Vf/vdRoIlENw=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=gwQ2Hz46VJguYugSrXpRLoUG4iSmXEOg87gVnGcvDBJQqCm7ElMo5HvZFLohFFaKM kud8Nw7dsrmHvEvGqUopKvldw5gbktdzj0lqCJsO/qlBsqabo+Y4z0EXnympWN7zAQ HxslvlNACDezLGPO0qKa/y2T7Ry+zHF6vw1ePSxLgigjWa9j03HX99PUMhaIhiI38s kvH3UVNM2Lax+fj0Z/iegvPW+GpHXVlk0Va0pWNgKp0nBBK6M7pScpN0lq9Lvo8WMS Hdb7m8+crdlQWy4BPDH6+PvPZozaKKZ0ClQEbNrDyzl47hWw4INF0lNeVB5y7JV280 jhAf9/yH5c1MQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 56F38691DD for ; Thu, 8 Jan 2026 11:53:10 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id aOLMwlKDJU3N for ; Thu, 8 Jan 2026 11:53:10 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898388; bh=/CGHlXrJozUEeymTjG0yXJyDGexHHV0Vf/vdRoIlENw=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=kOo5gAlyIGvLk587bvVwBSryxevqyUH/354yUEJzxmt0rX1pyKAa7ZbWCHmzDYnb1 4wsnZNaBhJMYrS3mLv9slLc3P9B1/tSN+++jLaVrtmV9QMEPV9AYzTyHBZiUkD0Qhg 7+dBJUpMPRalktTBPKJDRYkWXCmavfC3EgowwRGaL1SzJQ8q/SoKrh2EU+o7ls+IQO ECAhKILDiVrrlWsw/nkzem3OZM9R1KwNc19gGs5w8EPxUQszpgTlUjwIiaf9VYnnMh GBcNR7Fnja48TdGozmspuu2zHGRAwRfhXbzb+/9BaXRyY10/UhosJy+0dS3yZ0duon j7rjlwY91lm3A== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 912D269101 for ; Thu, 8 Jan 2026 11:53:08 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898387; bh=I1LQYBKeYZDJMU1FDh8YxkVdz/tz/6SGTNnS89Wp9YU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rFZuLs6B7MYX5vLuxqyhUnG7163hBPyJucZI3BjJafGn8HZ3Nbzl5KNeg5ToKbdy8 8mMkyep/N3Z66Ns1uTQGAsgtJy2qu1mciCmvGppZ4+G5gkFgennQogzD3E7iBeMUSd mbVu8gvffKKkari7Vj1thdLvisVSGWrLaSXJy3EVsRwUnBpg/s9LFX1grNIp8C/LSu f38BGqVUdPqpb0RHhn4CEDkFgDBwRb3Iq1Ok8DOGvanJ3zkFhT5UznX+lrgtA8s7Hc lZ+bsgBOyuOgHFjw3HsmI/S5QC0xiWVAs1BAX84qcta86P8Rg6unLa0d5xTZEFnlG4 W6Hjh67YxORLQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 51402691C4; Thu, 8 Jan 2026 11:53:07 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id pc6TTk03nBPp; Thu, 8 Jan 2026 11:53:07 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898386; bh=bubJRXzqLodFTMtYqH81R7XIBfOnzk4X1xwJPOIPtyU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H6bs/VxsHv+wx2MBxLhhbroRDkfMuqNRtKB4xR+VbFFsqltPJGhI/AmEkcIWZCV7u TgNHtrk3ebt6KXMgcgbLAc+d6IrNHO3XJ/wy6+Mz0wemJTv3C14Fn2Q53yeZChD6xk 4DNsAVLVP+zq9DVCVEZ/kJZfqiAnuKTbRXMwzU+DHQtt1wjGeR1Lnn0eUDPs11evDz m2dZh0G+ItUJQmxXyyaFvtVhuUBoTmvZlkQXKsHav9Q2jganPVX/SJ2OFY5WhEULQ9 TK1Lsr0pGOhM3R/xAiciZdsKxwEeu/CtIptGhqsMlS/OMo7WFrVmY2+Fe44c1rRGiJ VXE8t3mGNtv+A== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 9BC6F69057; Thu, 8 Jan 2026 11:53:06 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 8 Jan 2026 11:51:31 -0700 Message-ID: <20260108185149.1995917-17-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260108185149.1995917-1-sjg@u-boot.org> References: <20260108185149.1995917-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: TPND5NVLKJN2WVNSJZ5DX2WHLZVFWCZJ X-Message-ID-Hash: TPND5NVLKJN2WVNSJZ5DX2WHLZVFWCZJ X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 16/21] ext4l: Add a CONFIG_EXT4_MBALLOC option List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass The multiblock allocator (mballoc.c) is required for write operations but adds about 22K to the binary. For read-only builds, this code is unnecessary. Add a CONFIG_EXT4_MBALLOC option that makes mballoc.c conditional. When disabled, inline stubs return appropriate error codes (-EROFS for block allocation, -EOPNOTSUPP for trim) to allow the rest of ext4 to function for read operations. The option is always y when EXT4_WRITE is enabled, and the MBALLOC_PREFETCH option now depends on MBALLOC being enabled. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4/Kconfig | 1 + fs/ext4l/Kconfig | 13 +++++++++++- fs/ext4l/Makefile | 3 ++- fs/ext4l/ext4.h | 54 +++++++++++++++++++++++++++++++++++++++++------ 4 files changed, 63 insertions(+), 8 deletions(-) diff --git a/fs/ext4/Kconfig b/fs/ext4/Kconfig index d7798cfb6b9..8ead2244a3c 100644 --- a/fs/ext4/Kconfig +++ b/fs/ext4/Kconfig @@ -9,6 +9,7 @@ config FS_EXT4 config EXT4_WRITE bool "Enable ext4 filesystem write support" depends on FS_EXT4 || FS_EXT4L + select EXT4_MBALLOC if FS_EXT4L help This provides support for creating and writing new files to an existing ext4 filesystem partition. diff --git a/fs/ext4l/Kconfig b/fs/ext4l/Kconfig index b7520aaab16..fcd5953b6dd 100644 --- a/fs/ext4l/Kconfig +++ b/fs/ext4l/Kconfig @@ -111,9 +111,20 @@ config EXT4_INDIRECT Filesystems without the extents feature will be rejected if this is disabled. Adds about 5K. If unsure, say N. +config EXT4_MBALLOC + bool "Enable ext4 multiblock allocator" + depends on FS_EXT4L + help + Enable the multiblock allocator (mballoc) which is required for + writing to ext4 filesystems. This handles block allocation for + new files and extending existing files. + + For read-only builds, this can be disabled to save about 22K. + If unsure, say Y if you need write support, N for read-only. + config EXT4_MBALLOC_PREFETCH bool "Enable ext4 block bitmap prefetch support" - depends on FS_EXT4L + depends on FS_EXT4L && EXT4_MBALLOC help Enable prefetching of block allocation bitmaps to improve allocation performance. When enabled, the multiblock allocator diff --git a/fs/ext4l/Makefile b/fs/ext4l/Makefile index 0f5ee832f2e..8c5ffb8557c 100644 --- a/fs/ext4l/Makefile +++ b/fs/ext4l/Makefile @@ -8,10 +8,11 @@ obj-y := interface.o support.o stub.o # Core ext4 objects (always needed) obj-y += balloc.o bitmap.o block_validity.o dir.o ext4_jbd2.o extents.o \ extents_status.o file.o fsmap.o fsync.o hash.o ialloc.o \ - inode.o mballoc.o mmp.o namei.o \ + inode.o mmp.o namei.o \ page-io.o readpage.o super.o symlink.o fast_commit.o orphan.o # Optional features +obj-$(CONFIG_EXT4_MBALLOC) += mballoc.o obj-$(CONFIG_EXT4_RESIZE) += resize.o obj-$(CONFIG_EXT4_MIGRATE) += migrate.o obj-$(CONFIG_EXT4_MOVE_EXTENT) += move_extent.o diff --git a/fs/ext4l/ext4.h b/fs/ext4l/ext4.h index b8e9f2d8c95..8d4e20e538a 100644 --- a/fs/ext4l/ext4.h +++ b/fs/ext4l/ext4.h @@ -2987,6 +2987,7 @@ int __init ext4_fc_init_dentry_cache(void); void ext4_fc_destroy_dentry_cache(void); /* mballoc.c */ +#ifdef CONFIG_EXT4_MBALLOC extern const struct seq_operations ext4_mb_seq_groups_ops; extern const struct seq_operations ext4_mb_seq_structs_summary_ops; extern int ext4_seq_mb_stats_show(struct seq_file *seq, void *offset); @@ -2997,6 +2998,19 @@ extern ext4_fsblk_t ext4_mb_new_blocks(handle_t *, extern void ext4_discard_preallocations(struct inode *); extern int __init ext4_init_mballoc(void); extern void ext4_exit_mballoc(void); +#else +static inline int ext4_mb_init(struct super_block *sb) { return 0; } +static inline void ext4_mb_release(struct super_block *sb) {} +static inline ext4_fsblk_t ext4_mb_new_blocks(handle_t *h, + struct ext4_allocation_request *ar, int *err) +{ + *err = -EROFS; + return 0; +} +static inline void ext4_discard_preallocations(struct inode *i) {} +static inline int ext4_init_mballoc(void) { return 0; } +static inline void ext4_exit_mballoc(void) {} +#endif extern int __init ext4_init_es(void); extern void ext4_exit_es(void); @@ -3028,29 +3042,57 @@ struct ext4_fs_context { ext4_fsblk_t s_sb_block; }; +#ifdef CONFIG_EXT4_MBALLOC extern ext4_group_t ext4_mb_prefetch(struct super_block *sb, ext4_group_t group, unsigned int nr, int *cnt); extern void ext4_mb_prefetch_fini(struct super_block *sb, ext4_group_t group, unsigned int nr); - -extern void ext4_free_blocks(handle_t *handle, struct inode *inode, - struct buffer_head *bh, ext4_fsblk_t block, - unsigned long count, int flags); extern int ext4_mb_alloc_groupinfo(struct super_block *sb, ext4_group_t ngroups); extern int ext4_mb_add_groupinfo(struct super_block *sb, ext4_group_t i, struct ext4_group_desc *desc); +extern void ext4_mb_mark_bb(struct super_block *sb, ext4_fsblk_t block, + int len, bool state); +extern void ext4_free_blocks(handle_t *handle, struct inode *inode, + struct buffer_head *bh, ext4_fsblk_t block, + unsigned long count, int flags); extern int ext4_group_add_blocks(handle_t *handle, struct super_block *sb, ext4_fsblk_t block, unsigned long count); extern int ext4_trim_fs(struct super_block *, struct fstrim_range *); extern void ext4_process_freed_data(struct super_block *sb, tid_t commit_tid); -extern void ext4_mb_mark_bb(struct super_block *sb, ext4_fsblk_t block, - int len, bool state); static inline bool ext4_mb_cr_expensive(enum criteria cr) { return cr >= CR_GOAL_LEN_SLOW; } +#else +static inline ext4_group_t ext4_mb_prefetch(struct super_block *sb, + ext4_group_t group, unsigned int nr, int *cnt) +{ + *cnt = 0; + return group; +} +static inline void ext4_mb_prefetch_fini(struct super_block *sb, + ext4_group_t group, unsigned int nr) {} +static inline int ext4_mb_alloc_groupinfo(struct super_block *sb, + ext4_group_t ngroups) { return 0; } +static inline int ext4_mb_add_groupinfo(struct super_block *sb, + ext4_group_t i, struct ext4_group_desc *desc) { return 0; } +static inline void ext4_mb_mark_bb(struct super_block *sb, ext4_fsblk_t block, + int len, bool state) {} +static inline void ext4_free_blocks(handle_t *handle, struct inode *inode, + struct buffer_head *bh, ext4_fsblk_t block, + unsigned long count, int flags) {} +static inline int ext4_group_add_blocks(handle_t *handle, struct super_block *sb, + ext4_fsblk_t block, unsigned long count) { return -EROFS; } +static inline int ext4_trim_fs(struct super_block *sb, struct fstrim_range *r) +{ + return -EOPNOTSUPP; +} +static inline void ext4_process_freed_data(struct super_block *sb, + tid_t commit_tid) {} +static inline bool ext4_mb_cr_expensive(enum criteria cr) { return false; } +#endif /* inode.c */ void ext4_inode_csum_set(struct inode *inode, struct ext4_inode *raw, From patchwork Thu Jan 8 18:51:32 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1358 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898394; bh=mT91N8aGoPbRN3ZsRF9u3qx5mc0vLSWbcbbnlbNeHtM=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=GQqf3OR/6AI6ZJv4W4cWuDENLhk2OiGg3MsQ7ujnh55zHsPYdOS6jTkjZEaGV5GSO UwC9Pms2vVvLMwYaUIPxamOoISpjDBc1A4BooaYCt+Qst78pgAHMcqPT1TaEZ0Tkku mDDARbN86xpr1cxCC/UNWyhqnQObWDalDHfzMccr+KhjUVuS42qUfZmEudVZT85G+5 h8/hD2EsihcnA5b6feZU7DDwsMHRinIYM+aq/12D6clMDBZoy4FwSRx+wYnEZF1P1L XlEITpFO3HQXwK8fWVfM5Rq24u59IX4YY+QYoQy7d2QCZJEntr51JdCXxOyq/pOPUJ bB2/4iNGZ919g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 52633691C8 for ; Thu, 8 Jan 2026 11:53:14 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id mF4FzliY4isg for ; Thu, 8 Jan 2026 11:53:14 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898394; bh=mT91N8aGoPbRN3ZsRF9u3qx5mc0vLSWbcbbnlbNeHtM=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=GQqf3OR/6AI6ZJv4W4cWuDENLhk2OiGg3MsQ7ujnh55zHsPYdOS6jTkjZEaGV5GSO UwC9Pms2vVvLMwYaUIPxamOoISpjDBc1A4BooaYCt+Qst78pgAHMcqPT1TaEZ0Tkku mDDARbN86xpr1cxCC/UNWyhqnQObWDalDHfzMccr+KhjUVuS42qUfZmEudVZT85G+5 h8/hD2EsihcnA5b6feZU7DDwsMHRinIYM+aq/12D6clMDBZoy4FwSRx+wYnEZF1P1L XlEITpFO3HQXwK8fWVfM5Rq24u59IX4YY+QYoQy7d2QCZJEntr51JdCXxOyq/pOPUJ bB2/4iNGZ919g== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3D437691CC for ; Thu, 8 Jan 2026 11:53:14 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898392; bh=P/sFLS8QNeczOX/IW+GrnpT+yphoZLlHRAb9W6qkjE0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uJLdKXwGPTZ5KaXPALsuRo7X8lLrKIL8Y3LtkAd22nHx9CEXKfz0jurBrvZ8mzn0i dYymXCE31eux8ApXHlbuOy2XB+x0Fko9/c5RFrpX3qk2bmvCrDMd2eYXFyh2vNMOhf 5jTlCxLPF24ksFq1SOkYfvQ58WPzrgCW3hfW4lkYP2xk2WGpb4VLqillITqB9FMvUs Dzp53MT0hKrEr1qR2IVUKk3r/Wy2td9n4mRStWj7sfrMgOZW5J4d2CfbiUXbI6edXL jHfN4TlbOCLmeXuePKjQrYymPT/fLxDu/CfvKPqf5EWFV8u4tjUWOb4fjUNN7hBup3 90IckzwnLJhPw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9D482691C4; Thu, 8 Jan 2026 11:53:12 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id JH-sG6QyTv7F; Thu, 8 Jan 2026 11:53:12 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898387; bh=Jz54C3bOgq0JkHqvBChSweT+yhq7uIyWc7HpQDecBp4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ItdtLcyGYRkE8weIst6sRVOErXsWaVICV7wqVfFYGs56lDhQstpAD70Kiy09y1xMu J5jcj2cjB9qAQeixxHMmNHESGB/u4F+8CBUV7KgHs9G2XexG0TS1kBf1ix/ajwK8zu bYqDsxSIJa9SF+jczK7hWerm8ItYi4vfDNqWk+rALUkGmPaYuiWuN/p6iqFs4Kt9e7 YsDgMA441sAN1MHMW+tCqgXrnktJR+9ev4Ch/rlrMLeckB5we46JsG77CeoF5ydx0J hwE3gbKMf+34n8nqpUWufN3+E/Bg5/Z/+oZwHgxRLmcYYOHzumTqNZWzF4FCqVBQTd 2R9XRLBSXa6Og== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 9778169057; Thu, 8 Jan 2026 11:53:07 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 8 Jan 2026 11:51:32 -0700 Message-ID: <20260108185149.1995917-18-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260108185149.1995917-1-sjg@u-boot.org> References: <20260108185149.1995917-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: XYN5EKWYNPRBVXZEXD6Q4VW4XYI26S5C X-Message-ID-Hash: XYN5EKWYNPRBVXZEXD6Q4VW4XYI26S5C X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 17/21] ext4l: Exclude write functions from read-only builds List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass The inode_operations structs contain function pointers for write operations (create, unlink, mkdir, rename, setattr, etc.). Even when CONFIG_EXT4_WRITE is disabled, these function pointers cause the linker to include much of the write-related code. Add an EXT4_WR_OP() macro that returns the function pointer when CONFIG_EXT4_WRITE is enabled, or NULL when disabled. Apply this macro to write operation entries in structs ext4_dir_inode_operations, ext4_special_inode_operations, ext4_file_inode_operations and the symlink inode_operations structs. This reduces ext4l code size by about 15K on Thumb2 when write-support is disabled. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4.h | 11 +++++++++++ fs/ext4l/file.c | 2 +- fs/ext4l/namei.c | 28 ++++++++++++++-------------- fs/ext4l/symlink.c | 6 +++--- 4 files changed, 29 insertions(+), 18 deletions(-) diff --git a/fs/ext4l/ext4.h b/fs/ext4l/ext4.h index 8d4e20e538a..9c182ad0d89 100644 --- a/fs/ext4l/ext4.h +++ b/fs/ext4l/ext4.h @@ -22,6 +22,17 @@ #include #include +/* + * Macro for write operation function pointers in inode_operations structs. + * When CONFIG_EXT4_WRITE is disabled, these return NULL so the linker + * doesn't pull in the write functions. + */ +#ifdef CONFIG_EXT4_WRITE +#define EXT4_WR_OP(func) (func) +#else +#define EXT4_WR_OP(func) NULL +#endif + /* * The fourth extended filesystem constants/structures */ diff --git a/fs/ext4l/file.c b/fs/ext4l/file.c index 8cbc8c5f785..6f775c498cf 100644 --- a/fs/ext4l/file.c +++ b/fs/ext4l/file.c @@ -966,7 +966,7 @@ const struct file_operations ext4_file_operations = { /* U-Boot simplified inode operations */ const struct inode_operations ext4_file_inode_operations = { - .setattr = ext4_setattr, + .setattr = EXT4_WR_OP(ext4_setattr), .getattr = ext4_file_getattr, .listxattr = ext4_listxattr, .fiemap = ext4_fiemap, diff --git a/fs/ext4l/namei.c b/fs/ext4l/namei.c index bede355d497..b8b6016a136 100644 --- a/fs/ext4l/namei.c +++ b/fs/ext4l/namei.c @@ -4199,30 +4199,30 @@ static int ext4_rename2(struct mnt_idmap *idmap, * directories can handle most operations... */ const struct inode_operations ext4_dir_inode_operations = { - .create = ext4_create, + .create = EXT4_WR_OP(ext4_create), .lookup = ext4_lookup, - .link = ext4_link, - .unlink = ext4_unlink, - .symlink = ext4_symlink, - .mkdir = ext4_mkdir, - .rmdir = ext4_rmdir, - .mknod = ext4_mknod, - .tmpfile = ext4_tmpfile, - .rename = ext4_rename2, - .setattr = ext4_setattr, + .link = EXT4_WR_OP(ext4_link), + .unlink = EXT4_WR_OP(ext4_unlink), + .symlink = EXT4_WR_OP(ext4_symlink), + .mkdir = EXT4_WR_OP(ext4_mkdir), + .rmdir = EXT4_WR_OP(ext4_rmdir), + .mknod = EXT4_WR_OP(ext4_mknod), + .tmpfile = EXT4_WR_OP(ext4_tmpfile), + .rename = EXT4_WR_OP(ext4_rename2), + .setattr = EXT4_WR_OP(ext4_setattr), .getattr = ext4_getattr, .listxattr = ext4_listxattr, .get_inode_acl = ext4_get_acl, - .set_acl = ext4_set_acl, + .set_acl = EXT4_WR_OP(ext4_set_acl), .fiemap = ext4_fiemap, .fileattr_get = ext4_fileattr_get, - .fileattr_set = ext4_fileattr_set, + .fileattr_set = EXT4_WR_OP(ext4_fileattr_set), }; const struct inode_operations ext4_special_inode_operations = { - .setattr = ext4_setattr, + .setattr = EXT4_WR_OP(ext4_setattr), .getattr = ext4_getattr, .listxattr = ext4_listxattr, .get_inode_acl = ext4_get_acl, - .set_acl = ext4_set_acl, + .set_acl = EXT4_WR_OP(ext4_set_acl), }; diff --git a/fs/ext4l/symlink.c b/fs/ext4l/symlink.c index 2e4d0942a3b..dd3b82b5da2 100644 --- a/fs/ext4l/symlink.c +++ b/fs/ext4l/symlink.c @@ -115,21 +115,21 @@ static const char *ext4_get_link(struct dentry *dentry, struct inode *inode, const struct inode_operations ext4_encrypted_symlink_inode_operations = { .get_link = ext4_encrypted_get_link, - .setattr = ext4_setattr, + .setattr = EXT4_WR_OP(ext4_setattr), .getattr = ext4_encrypted_symlink_getattr, .listxattr = ext4_listxattr, }; const struct inode_operations ext4_symlink_inode_operations = { .get_link = ext4_get_link, - .setattr = ext4_setattr, + .setattr = EXT4_WR_OP(ext4_setattr), .getattr = ext4_getattr, .listxattr = ext4_listxattr, }; const struct inode_operations ext4_fast_symlink_inode_operations = { .get_link = simple_get_link, - .setattr = ext4_setattr, + .setattr = EXT4_WR_OP(ext4_setattr), .getattr = ext4_getattr, .listxattr = ext4_listxattr, }; From patchwork Thu Jan 8 18:51:33 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1359 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898396; bh=j3ggRlZfMq1yTowOzachO+l5HsOPUD+NxRn2tM+/GLA=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=QwUQyUHo+PxEP/4kTniwlL19DiLFx7283P+tLlUbd6D2215hqMJ2UkELcXrtAQaSu R5Ec3eQtjCbbuZ86+eOPJ7LfQOfPgViAke4xDzzX6oLGvLCIxAk+79SZ2tiQ5FsoeY Vs651eEwsUAV/yjrGRIIi9FmnPOnsgC5+IqWp+XOc4M76xDoco+0LRJ0fNnQf58Pue 7zzHBmdOiUQRT/Q+A60OtvcgL9ks0J97AXTZFOaFKI0vnrrEjYoWZIABnvzZSDqVKD LA4VyE1YvgQvpFf1P2o5Tk3VMMYGybDfiWOq3fUiEi94nJPvnsXuajif2aAdH3vy+a 63Iajkt006Lew== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B1EB2691DB for ; Thu, 8 Jan 2026 11:53:16 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id tTKj7zgp_jGU for ; Thu, 8 Jan 2026 11:53:16 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898395; bh=j3ggRlZfMq1yTowOzachO+l5HsOPUD+NxRn2tM+/GLA=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=b9m3N9JjbHPs5Vp6VkuS64C3gmxr+d1inlMBYbsEQKFTXzJLjxk0p3FdTKDyFP1Dy XPN/Jch0X/PyK2zH58152uwZaLvR2+4QjTIT7BynvUgZFF+Kr5UxPNKgJKdWNCLXyG ynhriyP+N0lB/74Hx5fFcma0Vgk+IDAxXlgIHBgkUDMC9ToA36rSfEFFy88zZT/keh /srk35FxwMZs48SWpqflywV70HcQ9C4tnfMAGdjssbkUJNic0y3LP+gLSBd5az2JzW LkCdnv8LmhLRN9xro8gYjg3SZ9Q/G1MItJK5oeYzxMf8vupn37szu57m/zWexsz7Wf aGmb7zluF28Og== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BA68A691C8 for ; Thu, 8 Jan 2026 11:53:15 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898393; bh=oSFiqJzKvTvPcb84/VfAc09R0ds+jixcbpbzjBRBbJc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gQw44Eg8Srk5yq2SSZT4YAsCQTQnf23zheKvoDItijZSw/mk/bZ/5/awy3+2NwqbC CMkI4J/65ZJIN5RwEuqYpStF1pqMANmE19HjT90ZNpj08BH6YYXsdJo7TaPLZDAw2S XYPNgnJWPREogWXUdPV4gmEq2RudRBZoIKLZxgZZP6dKcu1ftsEtOnyQOf5OUsWe3X JB7yB81TxyGzJaZskF0g6dyxaxnieib0mS7PN82qOi0IQUnqALHf2PU9Ktckm/HtMA oYvM85xIEX7o0mZPSNQHrTUGTF5MN5+ijmVZjVUwGjjxtY5UDCgDOLmXlV5S7DT9gK lqFDShoXWo/8w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C362A69057; Thu, 8 Jan 2026 11:53:13 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id BuwAIvPdJF-o; Thu, 8 Jan 2026 11:53:13 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898392; bh=MC6jp2+csG2KtO7qvYcAA8BOh+yeVyIVhpIwvPjX5cI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NO+fj5rvTOnjtX5d/gtjZJBV1iTzdZwMlgl620TbVPdgpIuguCccpIZMgvvafIegH QMPPl2FRtwP5T2weTyGOi6kcA0kgHI9hq2dnkw6JTIyb/jap7OiuEBjRnhUff832kD LSRu5VRcrvtrjKk8+RtcD34lSezKlADOlu1AToo4klkWDbR6oXUZxuZOAIHqkhIrH/ KKClr+AIXx8u9cvk5DScb5m0fsZ2CKJMqvXY9ZkdB7BsXobfIRfmqL33gSPULduBXq Hl/kuUbzas3efHR1AewTB8cGPJePGanbtTy9xFzilksxJJfIx6zfUU0QEiRDKnX2lh CkY0BPEvBO6Qw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 40F3E69101; Thu, 8 Jan 2026 11:53:12 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 8 Jan 2026 11:51:33 -0700 Message-ID: <20260108185149.1995917-19-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260108185149.1995917-1-sjg@u-boot.org> References: <20260108185149.1995917-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 7OAOCMASUSHSTTAFTDLTHIXTMTGVNNXY X-Message-ID-Hash: 7OAOCMASUSHSTTAFTDLTHIXTMTGVNNXY X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 18/21] ext4l: Exclude transaction commits from read-only builds List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add IS_ENABLED(CONFIG_EXT4_WRITE) guards to jbd2 journal code to exclude write-only functions from read-only ext4l builds. The kjournald2 thread and jbd2_journal_commit_transaction() are only needed when writing to the journal. For read-only builds, skip thread creation and checkpoint/commit operations during journal destroy. This saves approximately 4K on Thumb2 builds. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/jbd2/journal.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index f6478c6ca94..0d38f00e555 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c @@ -232,6 +232,14 @@ static int jbd2_journal_start_thread(journal_t *journal) { struct task_struct *t; + /* + * The journal thread handles asynchronous commits. For read-only + * builds, we don't need it - commits happen synchronously in + * jbd2_journal_stop() when write support is enabled. + */ + if (!IS_ENABLED(CONFIG_EXT4_WRITE)) + return 0; + t = kthread_run(kjournald2, journal, "jbd2/%s", journal->j_devname); if (IS_ERR(t)) @@ -2117,14 +2125,15 @@ int jbd2_journal_destroy(journal_t *journal) journal_kill_thread(journal); /* Force a final log commit */ - if (journal->j_running_transaction) + if (IS_ENABLED(CONFIG_EXT4_WRITE) && journal->j_running_transaction) jbd2_journal_commit_transaction(journal); /* Force any old transactions to disk */ /* Totally anal locking here... */ spin_lock(&journal->j_list_lock); - while (journal->j_checkpoint_transactions != NULL) { + while (IS_ENABLED(CONFIG_EXT4_WRITE) && + journal->j_checkpoint_transactions != NULL) { spin_unlock(&journal->j_list_lock); mutex_lock_io(&journal->j_checkpoint_mutex); err = jbd2_log_do_checkpoint(journal); From patchwork Thu Jan 8 18:51:34 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1360 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898401; bh=2ooNLPjDtVYA6vlbSNg+TWhJuDQ+dIxXhdSYdIbnw/w=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=uFbxuc/Lj8jlyg/221PHcRU7IfubSzJJUBByQ296MmS3HeyREnbTPTCdK6ujSKsQ7 LacF0pvttn0jWzADO0yv57AkXKsA8G03pmVFw7eCW01K6DjN//ceXMke2i7UY8eCFp tHJgc6k3VIe8mq2ck5J/ANk5QEq9C+CmtljynlShezbsmBR8OH2UBADm852yy4o6+7 hSL+ptwz/vHA1Cq8bqA7CZMEiGR34Zg+SRjZgbdFW6YW9mRAouo6vf5trT8QMpnT8k bcwsj/9yOrKYBM7I1tQQpCp4TUyw6SQ6bGPIZgPUSmgI9zG5C43TsYU8cz5QNtulil On94rWfkla8xQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4898B691C4 for ; Thu, 8 Jan 2026 11:53:21 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 085YWzGFZayz for ; Thu, 8 Jan 2026 11:53:21 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898401; bh=2ooNLPjDtVYA6vlbSNg+TWhJuDQ+dIxXhdSYdIbnw/w=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=uFbxuc/Lj8jlyg/221PHcRU7IfubSzJJUBByQ296MmS3HeyREnbTPTCdK6ujSKsQ7 LacF0pvttn0jWzADO0yv57AkXKsA8G03pmVFw7eCW01K6DjN//ceXMke2i7UY8eCFp tHJgc6k3VIe8mq2ck5J/ANk5QEq9C+CmtljynlShezbsmBR8OH2UBADm852yy4o6+7 hSL+ptwz/vHA1Cq8bqA7CZMEiGR34Zg+SRjZgbdFW6YW9mRAouo6vf5trT8QMpnT8k bcwsj/9yOrKYBM7I1tQQpCp4TUyw6SQ6bGPIZgPUSmgI9zG5C43TsYU8cz5QNtulil On94rWfkla8xQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 36F1169101 for ; Thu, 8 Jan 2026 11:53:21 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898399; bh=aGNvsKDB5fcYxIcQ4urL0NXpk32AQ6kMgQaTxLspGiA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vq3+puJnUODrtWwnE8xj5f1DTIp8WRfYFZ7DenEws/55PsXVEL19xJjGPntgfSN+Y AD6N3wo4NvppaQN+efu9qg6pimyR3ak02zSTs5AP4EJOqf2hDbPzW24qLjs6G/8V5p U8/GjbE1qrfgbcJynb1wKDmJAgFGSeT6q6vLySNPXNx230GNnDtKuEjzFuBOWOoP7t VmslijxizWJEx+7c0MeWEpNb644mSm3mKsk8z/B1mPVz+4y++Lt7zRIXiJXTpsBAMn RvjDsun3pzqA6Qir9OIBBINLbWm3KqFRenclHJNe7OQYbvy4vCp3NcFAtbnT23WNGt zCa55QtQ4j+mQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0AE51691C4; Thu, 8 Jan 2026 11:53:19 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id Zzzc__ViMDMw; Thu, 8 Jan 2026 11:53:18 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898394; bh=+UbRosPFpqfaQdYKhE7zsT/YOBkFtn5YVTumRvYAsrk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WfwlsdtCUkSUap9fH5UthpqjRDTdR1eWI3WKjpN78R+6mwf0rDPsEppe6VwMgD1P5 A7cZv9uyNMH9CxcvZxN07Ft3LEpSwhKNc3vgw1wCRsBcLs6Rza4QjFdHNuo4YaCBF1 h0/u9hIjTNt4PSl0i3Uc1fEsY4nUyByL/4PkyLvXQoPX1sCVumPVVIJf4z89AJI72g Z9xY5uITL4Ik98sz5H11E0UcBXtHu3DqkbAu+RooB0oGiK1mA/z5pdEZ0NRU5Jt22z 1g3g1p4mjxhy1aIEt6x75GP32Kojtw9B/cfj4C4em8dnulgEE4FBnh15qzJ2ktk/3i AoD55rQFojKRg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 134FE69101; Thu, 8 Jan 2026 11:53:14 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 8 Jan 2026 11:51:34 -0700 Message-ID: <20260108185149.1995917-20-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260108185149.1995917-1-sjg@u-boot.org> References: <20260108185149.1995917-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: QOBJRACC267MOFMLSMYWXETI4U23Q6FE X-Message-ID-Hash: QOBJRACC267MOFMLSMYWXETI4U23Q6FE X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 19/21] ext4l: Skip the journal flush in read-only builds List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add IS_ENABLED(CONFIG_EXT4_WRITE) guards to jbd2_journal_flush() and __jbd2_log_wait_for_space() to skip these operations in read-only builds. Journal flushing writes pending transactions to disk, which is not needed when the filesystem is mounted read-only. Similarly, waiting for journal space is only relevant when allocating space for new transactions. This eliminates jbd2_log_do_checkpoint() and saves approximately 1K on Thumb2 builds. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/jbd2/checkpoint.c | 4 ++++ fs/jbd2/journal.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/fs/jbd2/checkpoint.c b/fs/jbd2/checkpoint.c index 994e454bb5b..5b794df3384 100644 --- a/fs/jbd2/checkpoint.c +++ b/fs/jbd2/checkpoint.c @@ -48,6 +48,10 @@ __releases(&journal->j_state_lock) int nblocks, space_left; /* assert_spin_locked(&journal->j_state_lock); */ + /* Only needed for write operations */ + if (!IS_ENABLED(CONFIG_EXT4_WRITE)) + return; + nblocks = journal->j_max_transaction_buffers; while (jbd2_log_space_left(journal) < nblocks) { write_unlock(&journal->j_state_lock); diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index 0d38f00e555..e5bc62ba337 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c @@ -2409,6 +2409,10 @@ int jbd2_journal_flush(journal_t *journal, unsigned int flags) int err = 0; transaction_t *transaction = NULL; + /* Nothing to flush in read-only builds */ + if (!IS_ENABLED(CONFIG_EXT4_WRITE)) + return 0; + write_lock(&journal->j_state_lock); /* Force everything buffered to the log... */ From patchwork Thu Jan 8 18:51:35 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1361 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898403; bh=i9JNcpUdHZKzJ8eftj44mWKHyO3md3I/pA24eKeKmTg=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=HzR5dRuzcVgCt/HE1M4t0O1Wdd9MR5dxzKRatzS/lgVOjuiewtFEkYFuqM8k8JW63 Z5pvLy0HTa4RfiMIVxqYQjasICX9QIF9bhJ6dOTaOLY6E17RcZscQ1mdlXeb3iNxsQ zYHoLZWb3BnvFkdysiHmTV1Lvn3a2VdNKZ8n7+vadrmb89L/fjOdDeUoOu0IoDvN+Q PhWc2O0nwUz3/Fs5xNECgN0OZ7UrXOaQKxz/JBqMbUT+ibqVihO87DQF0G+nm5J02S 7dRgZPhQ//f2s4NrAEpscED/lpSj7Dponb9+q9B/K145Q2HubI5Jt3EZHyIw8MfVL5 nrB6oBEZTVOLw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B32CD691DB for ; Thu, 8 Jan 2026 11:53:23 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id UMdiaHrxz8xM for ; Thu, 8 Jan 2026 11:53:23 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898401; bh=i9JNcpUdHZKzJ8eftj44mWKHyO3md3I/pA24eKeKmTg=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=YqW8BfX+HXhBlQ4cFLPW0/nFaAGbX4OSr9dPxN5E4dOtBXUt6D1hF3im3SgbBb2xk Di4PjowVYTebKXw3GVN4X7A8tNeDlyM0uk9K6AN6lEt7+MIm9F5OerWWBAjn/Ao/oV JIDrwGGGRHfxFusEAW9S1GqaLolUzqi8un45AoQuTPTY+CJlF5cfPoRUiI4OmyN57L 4C+6GcyAbjFBqB1m+V1WoxdcNn7xOvLJsZJ5BsEqhtGDwkn0+XKYe1SGmYWiSyIK6s MyQnyk0RNgvRkSWlsVLwIoLkmmICLNH+9ALNU8v5HGUbKizbyPCZvzu6RZp4F8vmko /l9ObMZsEFOIg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A817069101 for ; Thu, 8 Jan 2026 11:53:21 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898399; bh=5rIKtxf4h0LlZdtq9uT6gh82XSLJX4XLpq71PA5AMow=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WGb/7aLSdCK4+JlIbm6RqEUsdF/9Pooq7KQIecuyU9x4Vf/dqrxP+Bd3XVrQ3YWYR IClT17DW3/oAPD6Lna+ZeymSFKTIGwmweRcNMLlcMIDo/yfpshDQwSgZgDgMoTGkki fHjuwCn0tjV+6DGfQJ4uBSnD5iB1OY+RqLU+6bZz/Uuztg01A6t6sI8Z2btuNyL17L kn6Z8nqDHAA7iSBDPYv7Ssmc8PnoQjvDxDpuXaVLKjeoRYQGSnrkGf9PDgjVfmZ9+/ hIrEsblZtCtbylc5uxXHeQ08CO8DjiJkFkIN5HzUURqhJ+/wg0/Vd65RMn2BYIq7Id TLDWOtM4i9xTg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6E2E169101; Thu, 8 Jan 2026 11:53:19 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id e_TTbqCKos0c; Thu, 8 Jan 2026 11:53:19 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898399; bh=7ydZyQq0nBS/0SwdL/rw4N1wmk+rWDFz73elAWA46HI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=v7xQ21naX/lHT9fcWCy/H1hPFc6ohAZqX4RfokJS407ItVmktclsqfXZsQTja0lwf EJpcL6Iijc3lsYilbAgbD9z/6TiS6N5bBXtszVt0tZUS7Y/Ss5qL0dEFgubTzaL3Ao Z84GaQ4Krg7MJrehkue7FL1jItRsDgNbA7bq5NoS8afvYdsO3lDAahwqWly1R01iYQ yHAORJZRIn6bCMhxsLI24qDUNm+kOnUfEuBFGJocwDLqMxgWOJAfDxV9pWQtSl3rl2 h0naFaxpG5Gz8wbNu1AuCwobvDsh+l02ugP3zk2l6Qjj9PL+wzKWq2ggsQzrUmtSja 9G+rxXBlwVRFA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id B251169057; Thu, 8 Jan 2026 11:53:18 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 8 Jan 2026 11:51:35 -0700 Message-ID: <20260108185149.1995917-21-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260108185149.1995917-1-sjg@u-boot.org> References: <20260108185149.1995917-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: HT4IX6AP6W64UQFCMMKRISREISHSIXEW X-Message-ID-Hash: HT4IX6AP6W64UQFCMMKRISREISHSIXEW X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 20/21] ext4l: Add a CONFIG_EXT4_MOUNT_OPTS option List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass The ext4 mount-option-parsing infrastructure includes specification tables (ext4_param_specs, ext4_mount_opts) and related functions that add about 23K of rodata. For U-Boot's typical use case of mounting with default options, this parsing is unnecessary. Even if the options are needed in the future, it might be good enough to use the flags direcrly. Add a CONFIG_EXT4_MOUNT_OPTS option that, when disabled: - Stubs out ext4_parse_param() to accept any options silently - Removes the parameter-specification tables - Stubs ext4_show_options() and related functions This reduces code size by about 3.5K Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/Kconfig | 14 ++++++++++ fs/ext4l/super.c | 69 +++++++++++++++++++++++++++++++++--------------- 2 files changed, 61 insertions(+), 22 deletions(-) diff --git a/fs/ext4l/Kconfig b/fs/ext4l/Kconfig index fcd5953b6dd..4d0f6d95926 100644 --- a/fs/ext4l/Kconfig +++ b/fs/ext4l/Kconfig @@ -49,6 +49,20 @@ config EXT4L_PRINT Messages are always recorded and can be retrieved programmatically; this option controls whether they are also printed. +config EXT4_MOUNT_OPTS + bool "Enable mount option parsing" + depends on FS_EXT4L + help + Enable parsing of ext4 mount options (e.g., "data=ordered", + "barrier=1"). This requires the mount option specification + tables which add about 2KB of rodata. + + When disabled, ext4 uses fixed default options suitable for + read-only operation. This saves space but prevents customising + mount behaviour. + + If unsure, say N. + config EXT4_RESIZE bool "Enable ext4 online resize support" depends on FS_EXT4L diff --git a/fs/ext4l/super.c b/fs/ext4l/super.c index 98785935f19..9d8fee07907 100644 --- a/fs/ext4l/super.c +++ b/fs/ext4l/super.c @@ -61,7 +61,12 @@ static int ext4_reconfigure(struct fs_context *fc); static void ext4_fc_free(struct fs_context *fc); static int ext4_init_fs_context(struct fs_context *fc); static void ext4_kill_sb(struct super_block *sb); +#ifdef CONFIG_EXT4_MOUNT_OPTS static const struct fs_parameter_spec ext4_param_specs[]; +#define EXT4_PARAM_SPECS ext4_param_specs +#else +#define EXT4_PARAM_SPECS NULL +#endif /* * Lock ordering @@ -102,7 +107,7 @@ static struct file_system_type ext2_fs_type = { .owner = THIS_MODULE, .name = "ext2", .init_fs_context = ext4_init_fs_context, - .parameters = ext4_param_specs, + .parameters = EXT4_PARAM_SPECS, .kill_sb = ext4_kill_sb, .fs_flags = FS_REQUIRES_DEV, }; @@ -118,7 +123,7 @@ static struct file_system_type ext3_fs_type = { .owner = THIS_MODULE, .name = "ext3", .init_fs_context = ext4_init_fs_context, - .parameters = ext4_param_specs, + .parameters = EXT4_PARAM_SPECS, .kill_sb = ext4_kill_sb, .fs_flags = FS_REQUIRES_DEV, }; @@ -1663,6 +1668,24 @@ enum { #endif }; +#define MOPT_SET 0x0001 +#define MOPT_CLEAR 0x0002 +#define MOPT_NOSUPPORT 0x0004 +#define MOPT_EXPLICIT 0x0008 +#ifdef CONFIG_QUOTA +#define MOPT_Q 0 +#define MOPT_QFMT 0x0010 +#else +#define MOPT_Q MOPT_NOSUPPORT +#define MOPT_QFMT MOPT_NOSUPPORT +#endif +#define MOPT_NO_EXT2 0x0020 +#define MOPT_NO_EXT3 0x0040 +#define MOPT_EXT4_ONLY (MOPT_NO_EXT2 | MOPT_NO_EXT3) +#define MOPT_SKIP 0x0080 +#define MOPT_2 0x0100 + +#ifdef CONFIG_EXT4_MOUNT_OPTS static const struct constant_table ext4_param_errors[] = { {"continue", EXT4_MOUNT_ERRORS_CONT}, {"panic", EXT4_MOUNT_ERRORS_PANIC}, @@ -1803,24 +1826,6 @@ static const struct fs_parameter_spec ext4_param_specs[] = { {} }; - -#define MOPT_SET 0x0001 -#define MOPT_CLEAR 0x0002 -#define MOPT_NOSUPPORT 0x0004 -#define MOPT_EXPLICIT 0x0008 -#ifdef CONFIG_QUOTA -#define MOPT_Q 0 -#define MOPT_QFMT 0x0010 -#else -#define MOPT_Q MOPT_NOSUPPORT -#define MOPT_QFMT MOPT_NOSUPPORT -#endif -#define MOPT_NO_EXT2 0x0020 -#define MOPT_NO_EXT3 0x0040 -#define MOPT_EXT4_ONLY (MOPT_NO_EXT2 | MOPT_NO_EXT3) -#define MOPT_SKIP 0x0080 -#define MOPT_2 0x0100 - static const struct mount_opts { int token; int mount_opt; @@ -1895,6 +1900,7 @@ static const struct mount_opts { {Opt_abort, EXT4_MOUNT2_ABORT, MOPT_SET | MOPT_2}, {Opt_err, 0, 0} }; +#endif /* CONFIG_EXT4_MOUNT_OPTS */ #if IS_ENABLED(CONFIG_UNICODE) static const struct ext4_sb_encodings { @@ -2084,6 +2090,7 @@ EXT4_SET_CTX(mount_opt2); EXT4_CLEAR_CTX(mount_opt2); EXT4_TEST_CTX(mount_opt2); +#ifdef CONFIG_EXT4_MOUNT_OPTS static int ext4_parse_param(struct fs_context *fc, struct fs_parameter *param) { struct ext4_fs_context *ctx = fc->fs_private; @@ -2377,6 +2384,13 @@ static int ext4_parse_param(struct fs_context *fc, struct fs_parameter *param) return 0; } +#else +/* Stub when mount option parsing is disabled - use defaults */ +static int ext4_parse_param(struct fs_context *fc, struct fs_parameter *param) +{ + return 0; +} +#endif /* CONFIG_EXT4_MOUNT_OPTS */ static int parse_options(struct fs_context *fc, char *options) { @@ -2862,6 +2876,7 @@ static inline void ext4_show_quota_options(struct seq_file *seq, #endif } +#ifdef CONFIG_EXT4_MOUNT_OPTS static const char *token2str(int token) { const struct fs_parameter_spec *spec; @@ -2871,7 +2886,6 @@ static const char *token2str(int token) break; return spec->name; } - /* * Show an option if * - it's set to a non-default value OR @@ -3018,6 +3032,17 @@ int ext4_seq_options_show(struct seq_file *seq, void *offset) seq_putc(seq, '\n'); return rc; } +#else +static int ext4_show_options(struct seq_file *seq, struct dentry *root) +{ + return 0; +} + +int ext4_seq_options_show(struct seq_file *seq, void *offset) +{ + return 0; +} +#endif /* CONFIG_EXT4_MOUNT_OPTS */ static int ext4_setup_super(struct super_block *sb, struct ext4_super_block *es, int read_only) @@ -7397,7 +7422,7 @@ static struct file_system_type ext4_fs_type = { .owner = THIS_MODULE, .name = "ext4", .init_fs_context = ext4_init_fs_context, - .parameters = ext4_param_specs, + .parameters = EXT4_PARAM_SPECS, .kill_sb = ext4_kill_sb, .fs_flags = FS_REQUIRES_DEV | FS_ALLOW_IDMAP | FS_MGTIME, }; From patchwork Thu Jan 8 18:51:36 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1362 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898408; bh=3Vgj0TMrBE9m0RpJxLUtBueN9VS1jPk1zR3ZlOH/AG4=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=YOPjt5w/cKyQ4gAGiZXScxQY/n9HbCEYGx4FvP0lOuhr8MQOKDfUPsHxKl0p1ESzX 14pghT8ivUfIJlxPOyRnyhTV+zpIIc3FOpvuQ5xMq9n2QxHAYlIskZtdemG+DmbtNb n/+NlLUz6wuUK750n0bP0m0nB6+65GbSYjSftYA5RwjTrSRrmwK9YuNOajLprqeIsm Obj7nOU0cqcVXoEYXOvK0C554UWEJYj+ixzTUDDUcwVTqknCBmiW3f18p24BtvQAp7 /3TtXwXth6pzsD7dYqLkV61zrri6nSAWcSxN8plG4OqCv8ZIBveXYSbXYgyXg7IVwO fe5TjKKFXfHzA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 66C2A69057 for ; Thu, 8 Jan 2026 11:53:28 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id X9koND2b-dXI for ; Thu, 8 Jan 2026 11:53:28 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898408; bh=3Vgj0TMrBE9m0RpJxLUtBueN9VS1jPk1zR3ZlOH/AG4=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=YOPjt5w/cKyQ4gAGiZXScxQY/n9HbCEYGx4FvP0lOuhr8MQOKDfUPsHxKl0p1ESzX 14pghT8ivUfIJlxPOyRnyhTV+zpIIc3FOpvuQ5xMq9n2QxHAYlIskZtdemG+DmbtNb n/+NlLUz6wuUK750n0bP0m0nB6+65GbSYjSftYA5RwjTrSRrmwK9YuNOajLprqeIsm Obj7nOU0cqcVXoEYXOvK0C554UWEJYj+ixzTUDDUcwVTqknCBmiW3f18p24BtvQAp7 /3TtXwXth6pzsD7dYqLkV61zrri6nSAWcSxN8plG4OqCv8ZIBveXYSbXYgyXg7IVwO fe5TjKKFXfHzA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 54E8C69101 for ; Thu, 8 Jan 2026 11:53:28 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898406; bh=KjR75pPy8amVm0UwE5LhOihu35OVPESHdYRY1bwJtkM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NUpQpGafOXlwBc6GUpHsgT9Gg286S2wFiBnNMFh/Aa438olwmx0Z60zVy7rvV0t34 z/UKzQAoxTOkGjsdW+0R1QoOGrnC5/jtNSWjDTwdKY0NaDspJNXzT2/levaRlLaT8Q 5xYQcAKLB+EugHmkUDbIJ4SmqzlSMyosLvin7wBEzy8ShXbQYCMWnOWU8YQLh96o14 iFhlC4vTRnU/juA9WG/uMnKk821VUPGxGMimJJ2VnY64lU4gg4Mg/ZOaIHTVqU0D7j 9PNDsi3htBjlloQvCjsfPfWlX2dkbK4N11vQGCl4nXQ1jqB0qJ6lD3hnNbmFygISrS oxxLDTAOg62MA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 03B2669101; Thu, 8 Jan 2026 11:53:26 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id AMlcLjCSCpq0; Thu, 8 Jan 2026 11:53:25 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898400; bh=a+/NQiKDH27QZYk5IgvQoPvoUOFNvUXNhxR86J/tfug=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HURPdOeF0ltOzj24Xn/4FjnIjYIj6PqD3Q3UyOjmkrj9R0qp6jGwvqSgRrP28ZFBU GbY78atm3TVwtsirUCnzOBxlO+DrnOZ51NRKuj+On3D5AW+/b31EuMYtW6UHGorJK1 UfJ7hrrO79AwyicyokGdZOGFtMrv4rUGENGO+1DLgzQIPPrtdplA92u+Zitu+GrgrN nLWTwGu87Y7eeGTRJddHtAedfVYmZMuhEJs7XchBgmhcJ/HGbE1y/DW4D5VAnzmRSC 52k8FXhMt5HXhjpBfDZpfRr9kC++AeCI4H766upjPoO8101m4/kbogkePmva/kdHd1 JAbh/BVmosbpg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id B115669057; Thu, 8 Jan 2026 11:53:19 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 8 Jan 2026 11:51:36 -0700 Message-ID: <20260108185149.1995917-22-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260108185149.1995917-1-sjg@u-boot.org> References: <20260108185149.1995917-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: SE7TCL2HACHH6VQEUMM7F2JFKL74447V X-Message-ID-Hash: SE7TCL2HACHH6VQEUMM7F2JFKL74447V X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 21/21] configs: firefly-rk3288: Enable ext4l filesystem List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Enable the Linux-ported ext4 filesystem (ext4l) for firefly-rk3288. This requires CONFIG_EXPERT and CONFIG_FS to satisfy the Kconfig dependencies. The ext4l driver provides better compatibility with modern ext4 filesystems compared to the legacy U-Boot ext4 implementation. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- configs/firefly-rk3288_defconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configs/firefly-rk3288_defconfig b/configs/firefly-rk3288_defconfig index 4d07e0b2635..8f1a0cb59e9 100644 --- a/configs/firefly-rk3288_defconfig +++ b/configs/firefly-rk3288_defconfig @@ -96,6 +96,8 @@ CONFIG_DISPLAY=y CONFIG_VIDEO_ROCKCHIP=y CONFIG_DISPLAY_ROCKCHIP_HDMI=y CONFIG_CONSOLE_SCROLL_LINES=10 +CONFIG_FS=y +CONFIG_FS_EXT4L=y CONFIG_CMD_DHRYSTONE=y CONFIG_SPL_CRC32=y CONFIG_ERRNO_STR=y