From patchwork Sun Dec 21 11:38:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1010 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=1766317143; bh=AP9x+s/6oUiC5OEjShgtWzu8Rtous+7ycaabo6jGxec=; 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=IdDL9Amcoe+d1hTfSfITGB2LYFWexWF5bCY7QO/t1VwBbM2dTgaxkIoYp+P1OkE7i yY3jzc2Fmb4fqnrRYYXs0gtOAi5qTONzUa/TfVwVJKJAJzAVywa4YaVOLKkl0ib9O/ BfYUHiRVA4KoakVat9gjdKhncTLGL2chBKYI5reQai8f2h2MSoipC2l9tTIat+4B2j pv6+x9GYPBcWquSjdyhb08omi8Ly1Jmp9gJZGD20abT7CbZCkRqp13TNFG28rfTqzc ROra7j5CmInt968N/uEuU2Rl/r9dSLqB8tAAzEFIwjOfHPJyGw3tus4yOEUNwAiNmU lY/TpQ2cDPZBw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2AF9B64CF3 for ; Sun, 21 Dec 2025 04:39: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 Lx08zT0dIKNo for ; Sun, 21 Dec 2025 04:39:03 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1766317143; bh=AP9x+s/6oUiC5OEjShgtWzu8Rtous+7ycaabo6jGxec=; 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=IdDL9Amcoe+d1hTfSfITGB2LYFWexWF5bCY7QO/t1VwBbM2dTgaxkIoYp+P1OkE7i yY3jzc2Fmb4fqnrRYYXs0gtOAi5qTONzUa/TfVwVJKJAJzAVywa4YaVOLKkl0ib9O/ BfYUHiRVA4KoakVat9gjdKhncTLGL2chBKYI5reQai8f2h2MSoipC2l9tTIat+4B2j pv6+x9GYPBcWquSjdyhb08omi8Ly1Jmp9gJZGD20abT7CbZCkRqp13TNFG28rfTqzc ROra7j5CmInt968N/uEuU2Rl/r9dSLqB8tAAzEFIwjOfHPJyGw3tus4yOEUNwAiNmU lY/TpQ2cDPZBw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 18A4264CF1 for ; Sun, 21 Dec 2025 04:39:03 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1766317140; bh=2f8ug+Zih6ZcV0YNlmSMalRzIriimv5OvS+RwYv7nwY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P7N+5lSrk5ZgyUtrMlyR37j0VIAxzqfJyFJeKTtjf2G0ZwKF+0GvEJ0ZyOXjQ8amj +PJrW/eityHJJGta64L61oml8zjvR5bH13JyefLmdKh+5+GNCzcQJu8dC7D0xxFenT /S+sqnVq/xuP2ueye4MjS30oVUlXW8z24Z9KCHf5kKwOuMmvuVJZCMlMvLz6/xZ1jf FBMUenjey4tupuIRidOahJFAHs6+yh0TnIvLByHZVWHx0iMZwHhFuYHLZarhzuEwxj i6VaSSR4vtMsbPHLCn2W7yobauYgSyrfpz1agV3cKV6HZYtiK04JkxPf7a99sFtUDm VcsZVarkIsdQw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1B29B64CF1; Sun, 21 Dec 2025 04:39:00 -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 rvtnBmn-TbQ2; Sun, 21 Dec 2025 04:39:00 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1766317135; bh=9Xb+pVpZFQ3BK7jaoUQS9xdId7dgFMnNktNm2BNXgYA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R2TP170yRWrv0Q79802pzDzg57Girom6MAVXQQV0x3eeDhxAFp5p2hypA3ZOiKZVA 43pejbjK3ZXMQ+HqFDMLgwJgrf6+/SQ6LgJnjHr9O2bMS6+Ko3Gv/x7ohq7mlkHfT+ jpib+lLAl5kkyGa8n0yuKAULNvnTRxGDJfoYPm/Br5w69ezxNKI+Fxd8BzGIKHLfv/ bt/QRJaS+BdmWQhjdK3kequNfzaegp5HccNdUm1PBlgsH7wdi7OKnzINX0tQEv2i6C m6zZQpUfDA6uXMHqRGxnLo6N686bG6yFyNFzW5oalomGxv+d1448kw1BudDOwSw+Ao EbOZmua9EVhdA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id F1C4464CEA; Sun, 21 Dec 2025 04:38:54 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 21 Dec 2025 04:38:12 -0700 Message-ID: <20251221113820.812060-7-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251221113820.812060-1-sjg@u-boot.org> References: <20251221113820.812060-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: GX6HD5L4XZ3RIIQIZYM6HRH6YT3CZ4JS X-Message-ID-Hash: GX6HD5L4XZ3RIIQIZYM6HRH6YT3CZ4JS 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 X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 06/10] ext4l: Add inline.c to 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 the ext4 inline data implementation file to the build. Add stubs to ext4_uboot.h: - FGP_WRITEBEGIN flag (combined from FGP_LOCK | FGP_WRITE | FGP_CREAT | FGP_STABLE) - kmap_local_folio, kunmap_local for memory mapping - folio_zero_tail, folio_zero_segment for folio zeroing - mapping_gfp_mask for address space GFP mask Remove obsolete inline data stubs from stub.c that are now provided by inline.c. Co-developed-by: Claude Signed-off-by: Simon Glass --- fs/ext4l/Makefile | 2 +- fs/ext4l/ext4_uboot.h | 12 +++++ fs/ext4l/inline.c | 6 +-- fs/ext4l/stub.c | 119 +++--------------------------------------- 4 files changed, 21 insertions(+), 118 deletions(-) diff --git a/fs/ext4l/Makefile b/fs/ext4l/Makefile index efda4ee18b5..80797722fe2 100644 --- a/fs/ext4l/Makefile +++ b/fs/ext4l/Makefile @@ -7,6 +7,6 @@ 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 inode.o namei.o super.o symlink.o xattr.o \ + indirect.o inline.o inode.o namei.o super.o symlink.o xattr.o \ xattr_hurd.o xattr_trusted.o \ xattr_user.o orphan.o diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 052067981cd..fc8a2f98bdb 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -1309,6 +1309,18 @@ static inline int generic_error_remove_folio(struct address_space *mapping, #define FGP_NOWAIT 0x00000020 #define FGP_FOR_MMAP 0x00000040 #define FGP_STABLE 0x00000080 +#define FGP_WRITEBEGIN (FGP_LOCK | FGP_WRITE | FGP_CREAT | FGP_STABLE) + +/* kmap/kunmap stubs for inline.c */ +#define kmap_local_folio(folio, off) ({ (void)(folio); (void)(off); (void *)NULL; }) +#define kunmap_local(addr) do { (void)(addr); } while (0) + +/* Folio zeroing stubs for inline.c */ +#define folio_zero_tail(f, off, kaddr) ({ (void)(f); (void)(off); (void)(kaddr); (void *)NULL; }) +#define folio_zero_segment(f, s, e) do { (void)(f); (void)(s); (void)(e); } while (0) + +/* mapping_gfp_mask stub */ +#define mapping_gfp_mask(m) ({ (void)(m); GFP_KERNEL; }) /* __filemap_get_folio stub */ static inline struct folio *__filemap_get_folio(struct address_space *mapping, diff --git a/fs/ext4l/inline.c b/fs/ext4l/inline.c index 1b094a4f386..1e5dd731388 100644 --- a/fs/ext4l/inline.c +++ b/fs/ext4l/inline.c @@ -4,11 +4,7 @@ * Written by Tao Ma */ -#include -#include -#include -#include -#include +#include "ext4_uboot.h" #include "ext4_jbd2.h" #include "ext4.h" diff --git a/fs/ext4l/stub.c b/fs/ext4l/stub.c index 4dbc055bb72..e5cb69be5b1 100644 --- a/fs/ext4l/stub.c +++ b/fs/ext4l/stub.c @@ -183,11 +183,7 @@ void ext4_discard_preallocations(struct inode *inode, unsigned int needed) } /* ext4_is_pending is now in extents_status.c */ - -int ext4_convert_inline_data(struct inode *inode) -{ - return 0; -} +/* ext4_convert_inline_data is now in inline.c */ void ext4_fc_mark_ineligible(struct super_block *sb, int reason, void *handle) @@ -250,10 +246,7 @@ int ext4_mpage_readpages(void *mapping, void *rac, void *folio) return 0; } -int ext4_readpage_inline(struct inode *inode, void *folio) -{ - return 0; -} +/* ext4_readpage_inline is now in inline.c */ /* Xattr functions are now in xattr.c */ @@ -275,11 +268,7 @@ int ext4_fc_commit(void *journal, unsigned int tid) /* ext4_force_commit is now in super.c */ -/* Inline data */ -int ext4_destroy_inline_data(void *handle, struct inode *inode) -{ - return 0; -} +/* Inline data is now in inline.c */ /* I/O submit */ void ext4_io_submit_init(void *io, void *wbc) @@ -364,21 +353,10 @@ int jbd2_journal_inode_ranged_wait(void *handle, struct inode *inode, return 0; } -/* Inline data */ -int ext4_inline_data_iomap(struct inode *inode, void *iomap) -{ - return 0; -} - +/* Inline data functions are now in inline.c */ /* __xattr_check_inode is now in xattr.c */ -int ext4_find_inline_data_nolock(struct inode *inode) -{ - return 0; -} - - /* File and inode operations symbols */ /* ext4_file_inode_operations is now in file.c */ /* ext4_file_operations is now in file.c */ @@ -391,32 +369,7 @@ int ext4_find_inline_data_nolock(struct inode *inode) /* ext4_update_dynamic_rev is now in super.c */ -/* Inline data */ -int ext4_inline_data_truncate(struct inode *inode, int *has_inline) -{ - *has_inline = 0; - return 0; -} - -int ext4_try_to_write_inline_data(struct address_space *mapping, - struct inode *inode, loff_t pos, - unsigned int len, struct folio **foliop) -{ - return 0; -} - -int ext4_generic_write_inline_data(struct address_space *mapping, - struct inode *inode, loff_t pos, - unsigned int len, struct folio **foliop) -{ - return 0; -} - -int ext4_write_inline_data_end(struct inode *inode, loff_t pos, unsigned int len, - unsigned int copied, struct folio *folio) -{ - return copied; -} +/* Inline data stubs are now in inline.c */ /* xattr stubs are now in xattr.c */ @@ -432,11 +385,7 @@ void jbd2_journal_init_jbd_inode(void *jinode, struct inode *inode) { } -/* symlink.c stub */ -void *ext4_read_inline_link(struct inode *inode) -{ - return ERR_PTR(-EOPNOTSUPP); -} +/* ext4_read_inline_link is now in inline.c */ /* * Stubs for dir.c @@ -452,61 +401,7 @@ ssize_t generic_read_dir(struct file *f, char *buf, size_t count, loff_t *ppos) /* ext4_htree_fill_tree is now in namei.c */ -int ext4_read_inline_dir(struct file *file, void *ctx, void *f_pos) -{ - return 0; -} - -struct buffer_head *ext4_find_inline_entry(struct inode *dir, void *fname, - void *res_dir, int *has_inline_data) -{ - *has_inline_data = 0; - return NULL; -} - -int ext4_try_add_inline_entry(void *handle, void *fname, void *dentry) -{ - return -ENOENT; -} - -int ext4_delete_inline_entry(void *handle, struct inode *dir, - void *de_del, struct buffer_head *bh, - int *has_inline_data) -{ - *has_inline_data = 0; - return -ENOENT; -} - -void ext4_update_final_de(void *de, int de_len, int new_de_len) -{ -} - -int ext4_try_create_inline_dir(void *handle, struct inode *parent, - struct inode *inode) -{ - return -ENOENT; -} - -int empty_inline_dir(struct inode *dir, int *has_inline_data) -{ - *has_inline_data = 0; - return 1; -} - -/* Inline dir stubs */ -int ext4_get_first_inline_block(struct inode *inode, void **de, - int *inline_size) -{ - return 0; -} - -int ext4_inlinedir_to_tree(struct file *dir, struct inode *inode, - unsigned long long start_hash, - unsigned long long *next_hash, - int has_inline_data) -{ - return 0; -} +/* Inline dir stubs are now in inline.c */ /* Fast commit stubs */ void ext4_fc_track_unlink(void *handle, struct dentry *dentry)