From patchwork Wed Jan 21 22:08: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: 1742 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=1769033416; bh=C9KQEy1tQqo7BN5X6lFVjrJyHbGBToNT89wptFw9BoA=; 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=EUwpIxbro16005SSlFdlHCPO6b6RDQvB6w5Ymir9dBz/25IpwDQGHqyaapfnvTgPl mD4Nzy7tcKMommI22xXo47C/LcmpXI80ql6keB7EVPA2Mis1dqAt85Ok8LCugbWeuu SrVXvvLcPFjSa9yPPkBEkxWdWta2IbVai3sZfrqfq7KiRkH3clwg9o3755i9+zHLgJ dMjI/RizU1rIXsN84oFQna1FjCJhtYPCUXdzadd4BO2OIlXWzUg7MpOp8WBR8WR/db U6a5Druyk7QnoubLPHq9Rs92f7arkq5Rv1vBM0D0J72jLOcEEz7kUn0BEfwti5yu6z mES5AkmBeGX1A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 31BDD69601 for ; Wed, 21 Jan 2026 15:10: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 hyNL2LqYWR3f for ; Wed, 21 Jan 2026 15:10:16 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033414; bh=C9KQEy1tQqo7BN5X6lFVjrJyHbGBToNT89wptFw9BoA=; 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=Cb5sonWDRzywG0EKv/65CDN7ca5f2UjASoLOkL7xuSn6S/CUZp5WbwCAAtmWUWvCI sr+hjya20E22Iybq4QrGr7W5BvDo3ZGg96qT1+78DT6jFceemMhfHdx3MZuNdaYiTi vFxeHYmzRhlHvm+gn9OolYRcgOWhEDDqQUaniCYWJRE8gLyG+N43Io9Nk5n2HqMS0o I4poHVmbM88S+17nCHc7Pq7yVN6u+2T7CbWs1Ij+EEqhqv6vuAKIxvid3zocECF6MN eLpQ8WzZXhE1vV0FgrZ+eHPE1ylbtSlbdjwuw/PuwReEbQR3sXk5dT7c+kWp+q1vXy gaxlH1qZQPTqA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id ED50B6960A for ; Wed, 21 Jan 2026 15:10:14 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033411; bh=DTx67ZhupuFLyo+5HNQ6DIVz2kKsJawx+FK7AATmebQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q+3sb4ao6RA7WgbIQ1WNGhOsgfKl9QvyBD4/BPEN9AeaYOUMDECRzrMSSSJCztmcC zFBha+wlc6WLDVxNetIYV5AWvF0IiJnRiF5LOI7bzKDjaPh84665ZmgvW4BiY0LZFO IpnwFtO3za80Sub5MbcRf1OZ0W7LoOPR5niRIYYnznk83gvNeNonJA8w1ZAFYn4qoG qdmfwr8Qq5/ecymeHGaF6rRWDGrB1I/joJwOP3azK0O/m9o5ryHed5mOWPOhiBmzki MYn6PkhjRqOOc3qfhW5oHJZptztWlOUpkyJg8cPv6i6o/EyxENwe30LAKLyH4L8UFm MBIFfd67zGZdg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C78E0695FD; Wed, 21 Jan 2026 15:10:11 -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 HsAiLW3y1FZl; Wed, 21 Jan 2026 15:10:11 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033405; bh=kovDswhn7pHFZH9cLXDMnMHTl3jteDeXwTLfrMTeYCk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iUKoOdbmqa5hz7QD7jFsPKl/GePT9Xg0P/xfC9MT5CJ9oMucpKdXTwBwcSUJKzkhz iLe7c9UwoVsiYMuHUlr4DMiqJ30KUIXrAmHus9LhfW1vKFJT3cHvT9txkgGClQw1c6 PFLNFFI+wgLGLyRJVKH5h7ukEiHG4hPHJTUoNmy4lmnKO2bGwWTH96HquKtntdfl7y W77peDknFNQjfpX9uLo/21y7t8rNpIwnBwW0jtXfYKbktTqNOoSPDXInhAIS1ef8K5 GjiEurcTeRx3sY94W1oI4mQW0SzDKwwREqFcYoZIixSn6uxGcGMxyprt8EA8gMP+BJ 7l8uBVfgrod5w== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 94AA5695FB; Wed, 21 Jan 2026 15:10:05 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 21 Jan 2026 15:08:28 -0700 Message-ID: <20260121220857.2137568-16-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: JIEC2ZSUBNSUKBMGSUNH3ZLE6CJMRQM5 X-Message-ID-Hash: JIEC2ZSUBNSUKBMGSUNH3ZLE6CJMRQM5 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 15/33] ext4l: Move various stubs to proper linux/ headers 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 definitions to their appropriate standard headers: - sync_mapping_buffers(), sync_inode_metadata() to linux/fs.h - DAX stubs (IS_DAX, dax_break_layout_final, dax_writeback_mapping_range, dax_zero_range, dax_break_layout_inode, daxdev_mapping_supported) to linux/dax.h - ktime_get_coarse_real_ts64() to linux/ktime.h - Remove duplicate truncate_inode_pages_range (already in pagemap.h) Also fix linux/dax.h to use mm_types.h for vm_fault_t and VM_FAULT_* definitions, and update daxdev_mapping_supported to use the 3-arg signature expected by ext4. This reduces ext4_uboot.h from 545 to 528 lines. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 19 +------------------ include/linux/dax.h | 23 +++++++++++++---------- include/linux/fs.h | 4 ++++ include/linux/ktime.h | 9 +++++++++ 4 files changed, 27 insertions(+), 28 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index f1c4a5a0fca..e21732da843 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -210,8 +210,6 @@ struct dx_hash_info { #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; }) - #include /* Memory retry wait */ @@ -254,18 +252,8 @@ struct dx_hash_info { #define finish_open_simple(f, e) (e) #define ihold(i) do { (void)(i); } while (0) -/* Sync operations - stubs */ -#define sync_mapping_buffers(m) ({ (void)(m); 0; }) -#define sync_inode_metadata(i, w) ({ (void)(i); (void)(w); 0; }) - -/* DAX stubs - DAX not supported in U-Boot */ -#define IS_DAX(inode) (0) -#define dax_break_layout_final(inode) do { } while (0) -#define dax_writeback_mapping_range(m, bd, wb) ({ (void)(m); (void)(bd); (void)(wb); 0; }) -#define dax_zero_range(i, p, l, d, op) ({ (void)(i); (void)(p); (void)(l); (void)(d); (void)(op); -EOPNOTSUPP; }) -#define dax_break_layout_inode(i, m) ({ (void)(i); (void)(m); 0; }) - #include +#include #include #include @@ -466,7 +454,6 @@ int sync_filesystem(void *sb); /* JBD2 checkpoint.c and commit.c stubs */ #include /* smp_mb__after_atomic is now in linux/smp.h */ -#define ktime_get_coarse_real_ts64(ts) do { (ts)->tv_sec = 0; (ts)->tv_nsec = 0; } while (0) #define crc32_be(crc, p, len) crc32(crc, p, len) /* ext4l support functions (support.c) */ @@ -490,10 +477,6 @@ int bmap(struct inode *inode, sector_t *block); #include -/* Block device operations for journal.c */ -#define truncate_inode_pages_range(m, s, e) \ - do { (void)(m); (void)(s); (void)(e); } while (0) - /* Memory allocation for journal.c */ #define __get_free_pages(gfp, order) ((unsigned long)memalign(PAGE_SIZE, PAGE_SIZE << (order))) #define free_pages(addr, order) free((void *)(addr)) diff --git a/include/linux/dax.h b/include/linux/dax.h index adc0f9411a2..7e80fc97cd3 100644 --- a/include/linux/dax.h +++ b/include/linux/dax.h @@ -4,6 +4,7 @@ #include #include +#include struct address_space; struct dax_device; @@ -12,11 +13,8 @@ struct iomap_ops; struct kiocb; struct iov_iter; struct vm_fault; - -typedef unsigned int vm_fault_t; - -#define VM_FAULT_SIGBUS 0x0002 -#define VM_FAULT_NOPAGE 0x0100 +struct file; +struct inode; /* DAX is not supported in U-Boot - provide stubs */ static inline ssize_t @@ -44,10 +42,15 @@ static inline bool dax_mapping(struct address_space *mapping) return false; } -static inline bool daxdev_mapping_supported(struct vm_area_struct *vma, - struct dax_device *dax_dev) -{ - return false; -} +/* 3-arg version used by ext4 */ +#define daxdev_mapping_supported(f, i, d) ({ (void)(f); (void)(i); (void)(d); 1; }) + +/* DAX stubs */ +#define IS_DAX(inode) (0) +#define dax_break_layout_final(inode) do { } while (0) +#define dax_writeback_mapping_range(m, bd, wb) ({ (void)(m); (void)(bd); (void)(wb); 0; }) +#define dax_zero_range(i, p, l, d, op) \ + ({ (void)(i); (void)(p); (void)(l); (void)(d); (void)(op); -EOPNOTSUPP; }) +#define dax_break_layout_inode(i, m) ({ (void)(i); (void)(m); 0; }) #endif /* _LINUX_DAX_H */ diff --git a/include/linux/fs.h b/include/linux/fs.h index 9ced2c78017..c8006d668b5 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -667,6 +667,10 @@ struct inode_operations { #define generic_buffers_fsync_noflush(f, s, e, d) \ ({ (void)(f); (void)(s); (void)(e); (void)(d); 0; }) +/* Sync operations - stubs */ +#define sync_mapping_buffers(m) ({ (void)(m); 0; }) +#define sync_inode_metadata(i, w) ({ (void)(i); (void)(w); 0; }) + /* Generic attribute operations */ #define generic_fillattr(m, req, i, s) do { } while (0) #define generic_fill_statx_atomic_writes(s, u_m, u_M, g) do { } while (0) diff --git a/include/linux/ktime.h b/include/linux/ktime.h index c853e694823..04767da5305 100644 --- a/include/linux/ktime.h +++ b/include/linux/ktime.h @@ -67,4 +67,13 @@ static inline ktime_t ktime_add_ns(ktime_t kt, s64 ns) */ #define ktime_get_ns() (0ULL) +/** + * ktime_get_coarse_real_ts64() - get coarse real time + * @ts: timespec64 to fill + * + * U-Boot stub - sets time to 0. + */ +#define ktime_get_coarse_real_ts64(ts) \ + do { (ts)->tv_sec = 0; (ts)->tv_nsec = 0; } while (0) + #endif /* _LINUX_KTIME_H */