[Concept,02/10] ext4l: Add stubs for xattr functions used by ialloc.c

Message ID 20251220232355.845414-3-sjg@u-boot.org
State New
Headers
Series ext4l: Add more ext4 files to the build (part D) |

Commit Message

Simon Glass Dec. 20, 2025, 11:23 p.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

Add stub declarations and implementations for xattr functions that
ialloc.c calls but which are defined in xattr.c (not yet compiled):
- __ext4_xattr_set_credits
- ext4_init_security

Add declarations to ext4_uboot.h and implementations to stub.c.

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

 fs/ext4l/ext4_uboot.h | 10 ++++++++--
 fs/ext4l/stub.c       | 18 ++++++++++++++++++
 2 files changed, 26 insertions(+), 2 deletions(-)
  

Patch

diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h
index 41de40b4ee0..943b474cdc8 100644
--- a/fs/ext4l/ext4_uboot.h
+++ b/fs/ext4l/ext4_uboot.h
@@ -366,9 +366,15 @@  extern struct user_namespace init_user_ns;
 #ifndef _FS_EXT4_ACL_H
 #define ext4_init_acl(h, i, d)			({ (void)(h); (void)(i); (void)(d); 0; })
 #endif
-/* Note: ext4_init_security is already handled in xattr.h */
+/* xattr stubs for files that don't include xattr.h */
+struct super_block;
+struct buffer_head;
+struct qstr;
 
-/* xattr stubs - __ext4_xattr_set_credits is declared in xattr.h */
+int __ext4_xattr_set_credits(struct super_block *sb, struct inode *inode,
+			     struct buffer_head *block_bh, size_t value_len,
+			     bool is_create);
+/* ext4_init_security is declared in xattr.h */
 
 /* inode state stubs */
 #define is_bad_inode(inode)			(0)
diff --git a/fs/ext4l/stub.c b/fs/ext4l/stub.c
index 04e6cbb680a..44cc4b7f52e 100644
--- a/fs/ext4l/stub.c
+++ b/fs/ext4l/stub.c
@@ -377,3 +377,21 @@  struct buffer_head *ext4_sb_bread_nofail(struct super_block *sb,
 {
 	return NULL;
 }
+
+/*
+ * Stubs for ialloc.c - xattr functions
+ */
+int __ext4_xattr_set_credits(struct super_block *sb, struct inode *inode,
+			     struct buffer_head *block_bh, size_t value_len,
+			     bool is_create)
+{
+	return 0;
+}
+
+struct qstr;
+
+int ext4_init_security(void *handle, struct inode *inode, struct inode *dir,
+		       const struct qstr *qstr)
+{
+	return 0;
+}