[Concept,04/10] ext4l: Add xattr_trusted.c
Commit Message
From: Simon Glass <simon.glass@canonical.com>
Add xattr_trusted.c to the ext4l build with necessary changes:
- Update xattr_trusted.c includes to use ext4_uboot.h
- Add xattr.h include to ialloc.c for ext4_init_security
- Remove duplicate ext4_init_security declaration from ext4_uboot.h
(now provided by xattr.h inline stub)
- Add ext4_xattr_get and ext4_xattr_set stubs
Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---
fs/ext4l/Makefile | 4 +++-
fs/ext4l/ext4_uboot.h | 7 +------
fs/ext4l/ialloc.c | 1 +
fs/ext4l/stub.c | 17 +++++++++++++----
fs/ext4l/xattr_trusted.c | 3 +--
5 files changed, 19 insertions(+), 13 deletions(-)
@@ -6,5 +6,7 @@
obj-y := interface.o stub.o
obj-y += balloc.o bitmap.o block_validity.o ext4_jbd2.o extents.o \
- extents_status.o hash.o ialloc.o indirect.o \
+ extents_status.o hash.o ialloc.o \
+ indirect.o \
+ xattr_trusted.o \
orphan.o
@@ -390,12 +390,7 @@ struct qstr;
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 - stub for files that don't include xattr.h */
-static inline int ext4_init_security(void *handle, struct inode *inode,
- struct inode *dir, const struct qstr *qstr)
-{
- return 0;
-}
+/* ext4_init_security is provided by xattr.h */
/* inode state stubs */
#define is_bad_inode(inode) (0)
@@ -16,6 +16,7 @@
#include "ext4_uboot.h"
#include "ext4.h"
#include "ext4_jbd2.h"
+#include "xattr.h"
/*
* ialloc.c contains the inodes allocation and deallocation routines
@@ -388,12 +388,21 @@ int __ext4_xattr_set_credits(struct super_block *sb, struct inode *inode,
return 0;
}
-struct qstr;
+/* ext4_init_security stub is provided by xattr.h */
-int ext4_init_security(void *handle, struct inode *inode, struct inode *dir,
- const struct qstr *qstr)
+/*
+ * Stubs for xattr_trusted.c
+ */
+int ext4_xattr_get(struct inode *inode, int name_index, const char *name,
+ void *buffer, size_t buffer_size)
{
- return 0;
+ return -1;
+}
+
+int ext4_xattr_set(struct inode *inode, int name_index, const char *name,
+ const void *value, size_t value_len, int flags)
+{
+ return -1;
}
/*
@@ -7,8 +7,7 @@
*/
#include <linux/string.h>
-#include <linux/capability.h>
-#include <linux/fs.h>
+#include "ext4_uboot.h"
#include "ext4_jbd2.h"
#include "ext4.h"
#include "xattr.h"