From: Simon Glass <simon.glass@canonical.com> Add CAP_SYS_ADMIN to capability.h and update ext4_uboot.h to use the header instead of duplicating the capability definitions. Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: Simon Glass <simon.glass@canonical.com> --- fs/ext4l/ext4_uboot.h | 8 +++----- include/linux/capability.h | 1 + 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index a4baac6fc86..80a1c5c6bc9 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -138,6 +138,9 @@ typedef struct { unsigned int val; } kprojid_t; #define __GFP_MOVABLE 0 #define __GFP_FS 0 +/* Capabilities - use linux/capability.h */ +#include <linux/capability.h> + /* FIEMAP extent flags */ #define FIEMAP_EXTENT_LAST 0x00000001 #define FIEMAP_EXTENT_UNKNOWN 0x00000002 @@ -198,11 +201,6 @@ struct fiemap_extent_info { void *fi_extents_start; }; -/* Capabilities - stubs (always allow) */ -#define CAP_SYS_ADMIN 0 -#define CAP_SYS_RESOURCE 0 -#define capable(cap) (1) - /* fscrypt_str, qstr are now in ext4_fscrypt.h */ /* percpu rw semaphore is in linux/percpu.h */ diff --git a/include/linux/capability.h b/include/linux/capability.h index 1192c8a4033..5f402de52e9 100644 --- a/include/linux/capability.h +++ b/include/linux/capability.h @@ -12,6 +12,7 @@ #ifndef _LINUX_CAPABILITY_H #define _LINUX_CAPABILITY_H +#define CAP_SYS_ADMIN 21 #define CAP_SYS_RESOURCE 24 static inline bool capable(int cap) -- 2.43.0