From patchwork Sun Dec 21 21:20:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1028 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=1766352075; bh=LMvyoZDbvAcG12XHsYDQPaBIHDBbv2+2m05BtFtTQFc=; 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=sas4KJkQrevdLxHxIXoKnz+mHeD3Cnk/rQXHhOnBKrh40Tv+3qVG8nzBrpsasm0XZ TwWgNXfeDcanL/96CwtVz9pTF16nBbvumTEQ0zQaGGOyKNdTnM01qKVFhzBhItHOi8 6fJhyrZxmzeihB9EZvsWss3kW1pmmL1a17tbjc0ZgQijNx95ScuDbhyPq8mHhbhmfh n8T1SSmL74KQTnbkeBlCI4xxBXtNjEhT5Di0VZSnVzPQi8xzErA3RcZskiZ4bnhrXa RwL03Sb7cMXA7DJJM5YqJthmJBtsjEAxGIs7+S9o/HBf+tJxnxW5y9bWTnXDYIWcCz u/RMESm4OEGdQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D980864CBD for ; Sun, 21 Dec 2025 14:21:15 -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 r8nQb54xAkJO for ; Sun, 21 Dec 2025 14:21:15 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1766352075; bh=LMvyoZDbvAcG12XHsYDQPaBIHDBbv2+2m05BtFtTQFc=; 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=sas4KJkQrevdLxHxIXoKnz+mHeD3Cnk/rQXHhOnBKrh40Tv+3qVG8nzBrpsasm0XZ TwWgNXfeDcanL/96CwtVz9pTF16nBbvumTEQ0zQaGGOyKNdTnM01qKVFhzBhItHOi8 6fJhyrZxmzeihB9EZvsWss3kW1pmmL1a17tbjc0ZgQijNx95ScuDbhyPq8mHhbhmfh n8T1SSmL74KQTnbkeBlCI4xxBXtNjEhT5Di0VZSnVzPQi8xzErA3RcZskiZ4bnhrXa RwL03Sb7cMXA7DJJM5YqJthmJBtsjEAxGIs7+S9o/HBf+tJxnxW5y9bWTnXDYIWcCz u/RMESm4OEGdQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C92BF64CE3 for ; Sun, 21 Dec 2025 14:21:15 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1766352074; bh=N0oXlMXB9w9D3RaCN4A0PIZzjvspGWBYtZR+C7pcrRs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=utqGkBc3o2Glbzn+WGnWs5os938iW9KvDnPhjOmxpNQiVLjH2XjK5qcWXeNOg1VDK 3ErO91U+fxvUIlvEaMpgn/QaSrAZKc+crSnrtJbwWC+n9kA1RTONAuguyJt8HJbwTy ggg8Fc9Wpqsk/EZiZQcBZc3miUzxY5ws6ZZlGWxFzSDDzDKoTyLX3FjOssq+SMXJP2 pyA/fg+WobsCNJRvkYRbbOUI8jc6wPSskplGK+pi72HeLM+pQ5Z4na5Z3GvyIm33uE jPAPtt2fQEE7UHXnOURdhPZONd6DbcETfAsFFXtpzdVN1HjJ9yj31M1OjtpRW+3xyM W9dqNCJhWgWww== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4293C64CDE; Sun, 21 Dec 2025 14:21: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 10026) with ESMTP id LGoHSLRNZl1h; Sun, 21 Dec 2025 14:21:14 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1766352067; bh=pJT5fPQ1QUEA5UEJM1K9d3qmchSMAMnyxmdqKIzr50c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tjBVuSnDmaamguI946kun+4QFXopPIxTYVtiFGINi5SLreXr+V8LWcxvUCNgeytPt 7s0Tbq7YEzhEIFe2UtnTQwfJQjEvpl6Riw5JpXZOjjdW2nYzcX9Y/7INGk55pqooBu hOUHwR7+qVwned7K6VQ/L+56zSAKqnHqU+5Fh4IJqd/QIl1jE2tjcZcTh5B5h4WsNX O/p4bnXrP+YYZMyfL4UgPoAvpI210dWQvy0Q9cLqdDCQZHbVvNIQGp1Ey6H6uckTyA 3FrFD7GXRJxCQCwkbE+NT1THbAvQ9Z9na+GDRGL+t4Co5UNcnIjYysyXaeftNj4xcF S1b2b9AHTvicg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id AF5AB64CF3; Sun, 21 Dec 2025 14:21:06 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 21 Dec 2025 14:20:22 -0700 Message-ID: <20251221212028.857348-15-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251221212028.857348-1-sjg@u-boot.org> References: <20251221212028.857348-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 53NN3JBDYL7HPNLGX6TP3VMCXN2EFRHN X-Message-ID-Hash: 53NN3JBDYL7HPNLGX6TP3VMCXN2EFRHN 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: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 14/15] ext4l: Add resize.c to the build 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 filesystem-resize support. Use ext4_uboot.h compatibility layer and add stubs for: - test_and_set_bit_lock - forwards to test_and_set_bit - div64_u64 - simple 64-bit division - time_is_before_jiffies - always returns false Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/Makefile | 2 +- fs/ext4l/ext4_uboot.h | 19 +++++++++++++++++++ fs/ext4l/resize.c | 6 +----- fs/ext4l/stub.c | 7 +++++-- 4 files changed, 26 insertions(+), 8 deletions(-) diff --git a/fs/ext4l/Makefile b/fs/ext4l/Makefile index 4afcc43e34f..ee929539eb8 100644 --- a/fs/ext4l/Makefile +++ b/fs/ext4l/Makefile @@ -8,7 +8,7 @@ obj-y := interface.o stub.o obj-y += balloc.o bitmap.o block_validity.o dir.o ext4_jbd2.o extents.o \ extents_status.o file.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 \ + 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 diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 617ec9a8afe..8a3143a6d27 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -2969,4 +2969,23 @@ static inline struct new_utsname *init_utsname(void) #define unlock_two_nondirectories(i1, i2) \ do { (void)(i1); (void)(i2); } while (0) +/* + * Stubs for resize.c + */ + +/* 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; }) + +/* ext4_update_overhead - declaration for stub.c */ +int ext4_update_overhead(struct super_block *sb, bool force); + #endif /* __EXT4_UBOOT_H__ */ diff --git a/fs/ext4l/resize.c b/fs/ext4l/resize.c index 050f26168d9..a52eac5f8e1 100644 --- a/fs/ext4l/resize.c +++ b/fs/ext4l/resize.c @@ -9,11 +9,7 @@ * This could probably be made into a module, because it is not often in use. */ - -#include -#include -#include - +#include "ext4_uboot.h" #include "ext4_jbd2.h" struct ext4_rcu_ptr { diff --git a/fs/ext4l/stub.c b/fs/ext4l/stub.c index 1bf1e958e48..93315d10fa8 100644 --- a/fs/ext4l/stub.c +++ b/fs/ext4l/stub.c @@ -379,9 +379,12 @@ void *kvzalloc(size_t size, gfp_t flags) return calloc(1, size); } -void ext4_kvfree_array_rcu(void *p) +/* ext4_kvfree_array_rcu - now in resize.c */ + +/* ext4_update_overhead - stub for resize.c */ +int ext4_update_overhead(struct super_block *sb, bool force) { - free(p); + return 0; } /* String stubs */