[Concept,33/34] ext4l: Move SB_* superblock flags to linux/fs.h
Commit Message
From: Simon Glass <simon.glass@canonical.com>
Move common superblock flags from ext4_uboot.h to linux/fs.h:
- SB_RDONLY: read-only mount flag
- SB_POSIXACL: POSIX ACL support flag
- SB_LAZYTIME: lazy time updates flag
- SB_I_VERSION: inode version update flag
- SB_INLINECRYPT: inline encryption flag
- SB_ACTIVE: superblock active flag
- SB_SILENT: silent mount errors flag
- SB_FREEZE_*: filesystem freeze level constants
Keep SB_I_CGROUPWB and SB_I_ALLOW_HSM as U-Boot stubs since these
are not supported.
Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---
fs/ext4l/ext4_uboot.h | 26 +++++++-------------------
include/linux/fs.h | 15 +++++++++++++++
2 files changed, 22 insertions(+), 19 deletions(-)
@@ -396,11 +396,7 @@ void iput(struct inode *inode);
/* _RET_IP_ - return instruction pointer */
#define _RET_IP_ ((unsigned long)__builtin_return_address(0))
-/* SB_FREEZE constants */
-#define SB_FREEZE_WRITE 1
-#define SB_FREEZE_PAGEFAULT 2
-#define SB_FREEZE_FS 3
-#define SB_FREEZE_COMPLETE 4
+/* SB_FREEZE_* constants are in linux/fs.h */
/* sb_writers stub */
struct sb_writers {
@@ -525,9 +521,7 @@ struct fstrim_range {
/* block_device is defined in linux/fs.h */
-/* Superblock flags */
-#define SB_RDONLY (1 << 0)
-#define SB_I_VERSION (1 << 26) /* Update inode version */
+/* SB_RDONLY, SB_I_VERSION, etc. superblock flags are in linux/fs.h */
/* UUID type */
typedef struct {
@@ -593,9 +587,7 @@ static inline int bdev_read_only(struct block_device *bdev)
/* Inode dirty state flags */
#define I_DIRTY_TIME (1 << 3)
-/* Superblock flags */
-#define SB_LAZYTIME (1 << 25)
-
+/* SB_LAZYTIME is in linux/fs.h */
/* ATTR_* iattr valid flags are in linux/fs.h */
/* STATX flags and attributes */
@@ -1683,8 +1675,7 @@ static inline void end_buffer_read_sync(struct buffer_head *bh, int uptodate)
}
#define REQ_OP_READ 0
-/* Superblock flags */
-#define SB_ACTIVE (1 << 30)
+/* SB_ACTIVE is in linux/fs.h */
/* Part stat - not used in U-Boot. Note: sectors[X] is passed as second arg */
#define STAT_WRITE 0
@@ -1893,12 +1884,9 @@ struct fs_parse_result {
/* I/O priority classes */
#define IOPRIO_CLASS_BE 2
-/* Superblock flags */
-#define SB_INLINECRYPT (1 << 27)
-#define SB_SILENT (1 << 15)
-#define SB_POSIXACL (1 << 16)
-#define SB_I_CGROUPWB 0
-#define SB_I_ALLOW_HSM 0
+/* SB_INLINECRYPT, SB_SILENT, SB_POSIXACL are in linux/fs.h */
+#define SB_I_CGROUPWB 0 /* Not supported in U-Boot */
+#define SB_I_ALLOW_HSM 0 /* Not supported in U-Boot */
/* Block open flags */
#define BLK_OPEN_READ (1 << 0)
@@ -208,6 +208,21 @@ static inline void inode_init_once(struct inode *inode)
#define RENAME_EXCHANGE (1 << 1)
#define RENAME_WHITEOUT (1 << 2)
+/* Superblock flags */
+#define SB_RDONLY (1 << 0) /* Read-only mount */
+#define SB_POSIXACL (1 << 16) /* POSIX ACL support */
+#define SB_LAZYTIME (1 << 25) /* Lazy time updates */
+#define SB_I_VERSION (1 << 26) /* Update inode version */
+#define SB_INLINECRYPT (1 << 27) /* Inline encryption */
+#define SB_ACTIVE (1 << 30) /* Superblock is active */
+#define SB_SILENT (1 << 15) /* Silent mount errors */
+
+/* Superblock freeze levels */
+#define SB_FREEZE_WRITE 1
+#define SB_FREEZE_PAGEFAULT 2
+#define SB_FREEZE_FS 3
+#define SB_FREEZE_COMPLETE 4
+
/* fallocate() flags */
#define FALLOC_FL_KEEP_SIZE 0x01
#define FALLOC_FL_PUNCH_HOLE 0x02