[Concept,01/12] linux: capability: Add CAP_SYS_ADMIN constant
Commit Message
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(-)
@@ -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 */
@@ -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)