From patchwork Wed Jan 21 22:08: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: 1737 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=1769033398; bh=bPFBlPAyCUSjWlDmZlfjNxAgqAzSYPXF49t9m3ljjmU=; 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=rsg93P2IVpcB2YgcFBACQG7BhZ+BdZtGZ4hB2TvFMxDlP5hMmrF88GepYZwZWOJpP /JFvwH7Lmq5eS5INN2jR44h3lnV7lTLxeMLsVpHCfdD7xFeAezDAB5YfIiWQ5QI7BP QLPuv4ljT3a+Q44/0oYHovgvqlHD6FmQ79avZc1o3vTaK2ArYKViJmO2OgxKoHYwK1 3nu2GkNLpmNmNIjcRvKRZbrAjIqdbWanG8r+hMuClMGx/dfMhG9zZ/BWzQfWNz7bPZ tzqOUF6YL2nBdMbbBAE7OjlcpMW1ihA+KnCfSuQTTVD+DmAADP0TMDpG1DADhkC/yU mIg/iojVdCypg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D5BDC69605 for ; Wed, 21 Jan 2026 15:09:58 -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 TNCNnlrng0qg for ; Wed, 21 Jan 2026 15:09:58 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033398; bh=bPFBlPAyCUSjWlDmZlfjNxAgqAzSYPXF49t9m3ljjmU=; 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=rsg93P2IVpcB2YgcFBACQG7BhZ+BdZtGZ4hB2TvFMxDlP5hMmrF88GepYZwZWOJpP /JFvwH7Lmq5eS5INN2jR44h3lnV7lTLxeMLsVpHCfdD7xFeAezDAB5YfIiWQ5QI7BP QLPuv4ljT3a+Q44/0oYHovgvqlHD6FmQ79avZc1o3vTaK2ArYKViJmO2OgxKoHYwK1 3nu2GkNLpmNmNIjcRvKRZbrAjIqdbWanG8r+hMuClMGx/dfMhG9zZ/BWzQfWNz7bPZ tzqOUF6YL2nBdMbbBAE7OjlcpMW1ihA+KnCfSuQTTVD+DmAADP0TMDpG1DADhkC/yU mIg/iojVdCypg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C4B1E695F7 for ; Wed, 21 Jan 2026 15:09:58 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033396; bh=VY71oxc8JGiawaSvaP4CLPhPJsJB8mOrq+ZW3q5eTPQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q9Ts7gYFk0llA0AFNCIfVgbW8jKos/WyDH3NkTpHha8/xrH9maqZd1X1J9pKsutgf eSctnA2qKIx2DXqVwz8NzwaUyMaIrZ1EgD/cM0IHKTGPCxHHeo98D0IfRn7UugUW1T jtleuoDdzsdAbDZ5mzGPj2YYeiNmZQo420hAtZYxjt7vt4tGROJ2llSqCr5QNZyC66 YJogYkMC4locuDIRXsATBtuG693VB5O2l9gDbc/9Gf4SqQqCZJJtuEMKQN1K8rV/UY tF8P6qL5KFyxcrLIDK48b2hYy7nE1LRhknpSgKb606i/o2IKjrHHZjQAkYxlS2KH9J ytSA0V4ir4ZUw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 84FAB695FB; Wed, 21 Jan 2026 15:09:56 -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 SUeDkJGzDK_m; Wed, 21 Jan 2026 15:09:56 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033391; bh=+WAxnzkFU9gBHMzHgW0VLNOi7DFSSr9HDrxJqsqSbXQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CaeT3BBFEH6aV3Tjudzls+olw9YFYgxHRUd9b7WPdNtKE4HhhLvcSwGPncMJCb8ne B77ZYdNhTMkpvBjEHxuLKC9VLHGS+vUX0C/0Ngl0jofYJ2tJ4LwcpQcwJ2Q7MLZJMv h29GIe+sWZgiLQCI5+St6jkdtBM81gUq0z074nGiYXM21Xh372Rwivx3yDH3jjktc+ ijK/uAwgflVKGV3/5F14G8RNyvK589ZaH8GJ/zMa74zsoWLNkBLts5Srron5Jjk35j DhnfcwWSAzBbhdT6YE+mK81USbc4Ub8Ec/JZjqiy53ixrIGj42YkPKhDewjgcNXU3X Gk7L9fRHgB3Tw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id F22C9695F2; Wed, 21 Jan 2026 15:09:50 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 21 Jan 2026 15:08:24 -0700 Message-ID: <20260121220857.2137568-12-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260121220857.2137568-1-sjg@u-boot.org> References: <20260121220857.2137568-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: JJTGIRKOFSUQG5DQN4CBMPYOTUN6N7T3 X-Message-ID-Hash: JJTGIRKOFSUQG5DQN4CBMPYOTUN6N7T3 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 11/33] ext4l: Move file_ functions to linux/fs.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 Move file-related operations from ext4_uboot.h to the standard linux/fs.h header. This includes file_modified(), file_accessed(), file_update_time(), file_write_and_wait_range(), file_check_and_advance_wb_err(), file_path(), and file_bdev(). Also remove redundant forward declarations (file_kattr, dir_context, readahead_control, fiemap_extent_info, folio) that are already in fs.h. This reduces ext4_uboot.h from 568 to 553 lines. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 15 --------------- include/linux/fs.h | 11 +++++++++++ 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index f12dbe2b76d..746d4e9a748 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -166,11 +166,6 @@ BUFFER_FNS(Cached, cached) struct pipe_inode_info; struct kstat; struct path; -struct file_kattr; -struct dir_context; -struct readahead_control; -struct fiemap_extent_info; -struct folio; #define WHITEOUT_DEV 0 #define WHITEOUT_MODE 0 @@ -213,9 +208,6 @@ struct dx_hash_info { do { } while (0) #endif -#define file_modified(file) ({ (void)(file); 0; }) -#define file_accessed(file) do { (void)(file); } while (0) - #define vfs_setpos(file, offset, maxsize) ({ (void)(file); (void)(maxsize); (offset); }) #define daxdev_mapping_supported(f, i, d) ({ (void)(f); (void)(i); (void)(d); 1; }) @@ -265,8 +257,6 @@ struct dx_hash_info { /* Sync operations - stubs */ #define sync_mapping_buffers(m) ({ (void)(m); 0; }) #define sync_inode_metadata(i, w) ({ (void)(i); (void)(w); 0; }) -#define file_write_and_wait_range(f, s, e) ({ (void)(f); (void)(s); (void)(e); 0; }) -#define file_check_and_advance_wb_err(f) ({ (void)(f); 0; }) /* DAX stubs - DAX not supported in U-Boot */ #define IS_DAX(inode) (0) @@ -293,7 +283,6 @@ extern struct inode *iget_locked(struct super_block *sb, unsigned long ino); #define posix_acl_chmod(m, i, mo) ({ (void)(m); (void)(i); (void)(mo); 0; }) /* File operations */ -#define file_update_time(f) do { } while (0) #define vmf_fs_error(e) ((vm_fault_t)VM_FAULT_SIGBUS) /* iomap stubs */ @@ -408,10 +397,6 @@ void trace_ext4_error(struct super_block *sb, const char *func, unsigned int lin /* Filesystem notification - declaration for stub.c */ void fsnotify_sb_error(struct super_block *sb, struct inode *inode, int error); -/* File path operations - declaration for stub.c */ -char *file_path(struct file *file, char *buf, int buflen); -struct block_device *file_bdev(struct file *file); - /* kobject_put is now in linux/kobject.h */ /* wait_for_completion is now a macro in linux/completion.h */ diff --git a/include/linux/fs.h b/include/linux/fs.h index 3fa54146f44..ea4d1fdf97e 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -321,6 +321,17 @@ static inline struct inode *file_inode(struct file *f) return f->f_inode; } +/* File modification tracking - stubs for U-Boot */ +#define file_modified(file) ({ (void)(file); 0; }) +#define file_accessed(file) do { (void)(file); } while (0) +#define file_update_time(f) do { } while (0) +#define file_write_and_wait_range(f, s, e) ({ (void)(f); (void)(s); (void)(e); 0; }) +#define file_check_and_advance_wb_err(f) ({ (void)(f); 0; }) + +/* File path operations - implemented in ext4l/stub.c */ +char *file_path(struct file *file, char *buf, int buflen); +struct block_device *file_bdev(struct file *file); + /* iattr - inode attributes for setattr */ struct iattr { unsigned int ia_valid;