[Concept,02/17] ext4l: Move inode helpers to standard linux headers

Message ID 20260120234344.495605-3-sjg@u-boot.org
State New
Headers
Series ext4l: Move compatibility stubs to standard Linux headers |

Commit Message

Simon Glass Jan. 20, 2026, 11:43 p.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

Move several inode-related stubs to their canonical Linux header
locations:

- inode_needs_sync and is_bad_inode to linux/fs.h
- in_group_p to linux/cred.h

These are standard Linux kernel interfaces that belong in their
respective headers rather than in the ext4l compatibility layer.

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 fs/ext4l/ext4_uboot.h | 9 +++------
 include/linux/cred.h  | 3 +++
 include/linux/fs.h    | 6 ++++++
 3 files changed, 12 insertions(+), 6 deletions(-)
  

Patch

diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h
index 2255458a46d..d21462407a8 100644
--- a/fs/ext4l/ext4_uboot.h
+++ b/fs/ext4l/ext4_uboot.h
@@ -197,8 +197,7 @@  static inline void memalloc_nofs_restore(unsigned int flags) { }
 struct buffer_head *sb_getblk(struct super_block *sb, sector_t block);
 /* wait_on_bit_io is now in linux/wait_bit.h */
 
-/* inode_needs_sync - stub */
-#define inode_needs_sync(inode)		(0)
+/* inode_needs_sync is in linux/fs.h */
 
 /* Memory barriers are now in linux/smp.h */
 
@@ -222,8 +221,7 @@  struct buffer_head *sb_getblk(struct super_block *sb, sector_t block);
 
 /* percpu_counter operations are in linux/percpu_counter.h */
 
-/* Group permission - stub */
-#define in_group_p(gid)			(0)
+/* in_group_p is in linux/cred.h */
 
 /* Quota operations - use linux/quotaops.h */
 #include <linux/quotaops.h>
@@ -270,8 +268,7 @@  int __ext4_xattr_set_credits(struct super_block *sb, struct inode *inode,
 #endif
 /* ext4_init_security is provided by xattr.h */
 
-/* inode state stubs */
-#define is_bad_inode(inode)			(0)
+/* is_bad_inode is in linux/fs.h */
 
 /* Block device operations - stubs */
 #define sb_issue_zeroout(sb, blk, num, gfp)	({ (void)(sb); (void)(blk); (void)(num); (void)(gfp); 0; })
diff --git a/include/linux/cred.h b/include/linux/cred.h
index a3a972a5a73..32b15dfc72e 100644
--- a/include/linux/cred.h
+++ b/include/linux/cred.h
@@ -59,4 +59,7 @@  struct user_namespace {
 
 extern struct user_namespace init_user_ns;
 
+/* in_group_p - check if current process is in group (always false in U-Boot) */
+#define in_group_p(gid)		(0)
+
 #endif /* _LINUX_CRED_H */
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 1b0059ca1a7..b6a0596a9de 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -305,6 +305,12 @@  enum {
 #define IS_APPEND(inode)	((inode)->i_flags & S_APPEND)
 #define IS_IMMUTABLE(inode)	((inode)->i_flags & S_IMMUTABLE)
 
+/* inode_needs_sync - check if inode needs synchronous writes (always false) */
+#define inode_needs_sync(inode)	(0)
+
+/* is_bad_inode - check if inode is marked bad (always false in U-Boot) */
+#define is_bad_inode(inode)	(0)
+
 /**
  * struct fstrim_range - fstrim ioctl argument
  * @start: first byte to trim