From patchwork Mon Jan 19 21:48: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: 1660 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=1768859355; bh=e/fAszVGC/x9NZFHT+E96bD0MZdBLdaOJkEL3WLP48k=; 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=eHz+5JpFoGSfOlOUeZrsG9YrGTcpr+xneZl5Fu/80vyMTnut5112aGLaOJamle6De yKfBmoGuhXbtMLAseIWItOcC6E1YBtxN5YG7G+pgirXalnnuWn8a4GJQ8EH/of2g3u g8JEvBN3S+LDqZ4Q/YiwBNpgp7YWGqC05MqlJvH9nb5+/ubgYWOxbh/8fvKJXPUutF 6V39EkScRCQI0QpxKQZP5BDVeTmrnad/ZW7obuELGeKwrQEBKuy6V3nQWHmd7RF/XQ wUmW3r5pw0MThCnXP7CnpGJH2QwdK4XDj/KFQipJ3MIrpK5CA/RYl7cAf/CEgimQXf ylLQ5yztK55Bw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BB8FA69536 for ; Mon, 19 Jan 2026 14:49: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 xzHDBnlQtuBs for ; Mon, 19 Jan 2026 14:49:15 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859355; bh=e/fAszVGC/x9NZFHT+E96bD0MZdBLdaOJkEL3WLP48k=; 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=eHz+5JpFoGSfOlOUeZrsG9YrGTcpr+xneZl5Fu/80vyMTnut5112aGLaOJamle6De yKfBmoGuhXbtMLAseIWItOcC6E1YBtxN5YG7G+pgirXalnnuWn8a4GJQ8EH/of2g3u g8JEvBN3S+LDqZ4Q/YiwBNpgp7YWGqC05MqlJvH9nb5+/ubgYWOxbh/8fvKJXPUutF 6V39EkScRCQI0QpxKQZP5BDVeTmrnad/ZW7obuELGeKwrQEBKuy6V3nQWHmd7RF/XQ wUmW3r5pw0MThCnXP7CnpGJH2QwdK4XDj/KFQipJ3MIrpK5CA/RYl7cAf/CEgimQXf ylLQ5yztK55Bw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A8E7E69533 for ; Mon, 19 Jan 2026 14:49:15 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859353; bh=lNqNLmgJCCgwmMpdVQfFZYIphsELcm0l67Gvf0mPtA0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eLHdxH274YUT0lle2C5Rig1TmOdtdGYoWiBgB5r1juiVcqdISdHImNX+ZHJowal6p 1pb6nfPWV6WqRD9Xo2DNvUbq+FQIPWiW/FfocV7s7lu/z1NfHIm1SI0QQ9t0OS1CoU PTIxmYwio/5iuYsuMKNFZVwq+0s3d/eCVIDcGp4wnsAEgs4UJzXzRqeWaBK6CP4rTm 7HAedN4cQEFlCTyMEaJ6FQ2bpIGy7G3cDcWQMuMHpf0Gdo/yn3unt8QlsI9cRKr56J sIhrHEyQlz0u/GEsiDHZL/v5XVPXdZAfiSjDxFTTSUXBtIAxkc8WQvns6PhUUqKRM6 SGES7aEeRqi3A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A3DDF69525; Mon, 19 Jan 2026 14:49: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 So8kizmoZa43; Mon, 19 Jan 2026 14:49:13 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859349; bh=drVJBPGE0J7aLE/4ioholKrojCz9xT08Luk0aQGwy+k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RKNX9ENwhkccTdyGmRsfIPOBhpbCIKTEXmUUSddQun1IrmD/kEhDPlF77UQQxCJnm iV9f20U9I5+qaw8A943uXJXPhoUO8K5m/Cjq5b9nNXUvoAhwB++y6wDm3iZnpcWbCG mcX3zMOnzImAy/Xef8CNMsb9+Q21PC1blkzlmfVQlo1ImHLRII2ejZZI/47ErUvU+L KKqjJEzCxQ55G18QvXjQexVXbpw0DbV/tX78xkgcX+o1WgvLwtbQYecvBLppEk4WBh ON4LUdlaSOeTP3yLFG2mauvTulP+Sj/IIl57Gi16Ux2S4+deFti0ioy2nbUMTuRq+8 KV0br6UQBHzmg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 571176951A; Mon, 19 Jan 2026 14:49:09 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 14:48:28 -0700 Message-ID: <20260119214846.3087611-4-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119214846.3087611-1-sjg@u-boot.org> References: <20260119214846.3087611-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: AW262SEIH7EAQCFGHH3NOWVUNUA4FSVY X-Message-ID-Hash: AW262SEIH7EAQCFGHH3NOWVUNUA4FSVY 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 03/16] ext4l: Move inode and superblock helpers 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 sb_rdonly(), inode_is_locked(), i_size_write(), i_size_read(), i_blocksize(), inode_newsize_ok(), IS_SYNC(), IS_APPEND(), and IS_IMMUTABLE() macros to include/linux/fs.h where they belong. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 16 +++------------- include/linux/fs.h | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index d6b7acc66b3..0b3b2d6f2e5 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -284,10 +284,7 @@ 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; }) -/* Inode locking - stubs */ -#define inode_is_locked(i) (1) -#define i_size_write(i, s) do { (i)->i_size = (s); } while (0) -#define i_size_read(i) ((i)->i_size) +/* inode_is_locked, i_size_write, i_size_read are in linux/fs.h */ /* spin_trylock is defined in linux/spinlock.h */ @@ -707,14 +704,9 @@ static inline unsigned long memweight(const void *ptr, size_t bytes) /* DAX device mapping check - always false in U-Boot */ #define daxdev_mapping_supported(f, i, d) ({ (void)(f); (void)(i); (void)(d); 1; }) -/* Inode time/size operations */ -#define inode_newsize_ok(i, s) ({ (void)(i); (void)(s); 0; }) +/* Inode time/size operations - inode_newsize_ok, i_blocksize, IS_SYNC are in linux/fs.h */ #define inode_set_ctime_current(i) ({ (void)(i); (struct timespec64){}; }) #define inode_set_mtime_to_ts(i, ts) ({ (void)(i); (ts); }) -#define i_blocksize(i) (1U << (i)->i_blkbits) - -/* IS_SYNC macro */ -#define IS_SYNC(inode) (0) /* Case-folding stubs - not supported in U-Boot */ #define sb_no_casefold_compat_fallback(sb) ({ (void)(sb); 1; }) @@ -925,9 +917,7 @@ extern struct inode *iget_locked(struct super_block *sb, unsigned long ino); #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) -/* Inode flag macros */ -#define IS_APPEND(inode) ((inode)->i_flags & S_APPEND) -#define IS_IMMUTABLE(inode) ((inode)->i_flags & S_IMMUTABLE) +/* IS_APPEND, IS_IMMUTABLE are in linux/fs.h */ /* File operations */ #define file_update_time(f) do { } while (0) diff --git a/include/linux/fs.h b/include/linux/fs.h index f295086523a..75e4bd3e951 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -283,4 +283,26 @@ enum { #define inode_lock_nested(inode, subclass) \ do { (void)(inode); (void)(subclass); } while (0) +/* + * Inode helper functions + */ + +/* inode_is_locked - check if inode lock is held (always true in U-Boot) */ +#define inode_is_locked(i) (1) + +/* i_size accessors */ +#define i_size_write(i, s) do { (i)->i_size = (s); } while (0) +#define i_size_read(i) ((i)->i_size) + +/* i_blocksize - get block size from inode */ +#define i_blocksize(i) (1U << (i)->i_blkbits) + +/* inode_newsize_ok - check if new size is valid (always ok in U-Boot) */ +#define inode_newsize_ok(i, s) ({ (void)(i); (void)(s); 0; }) + +/* IS_SYNC, IS_APPEND, IS_IMMUTABLE - inode flag checks */ +#define IS_SYNC(inode) (0) +#define IS_APPEND(inode) ((inode)->i_flags & S_APPEND) +#define IS_IMMUTABLE(inode) ((inode)->i_flags & S_IMMUTABLE) + #endif /* _LINUX_FS_H */