[Concept,02/10] ext4l: Add stubs for xattr functions used by ialloc.c
Commit Message
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(-)
@@ -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)
@@ -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;
+}