[Concept,30/33] ext4l: Move O_SYNC, S_NOQUOTA and kfree_link to headers

Message ID 20260121220857.2137568-31-sjg@u-boot.org
State New
Headers
Series Reorganise ext4l compatibility stubs |

Commit Message

Simon Glass Jan. 21, 2026, 10:08 p.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

Move definitions to their canonical Linux kernel locations:
- O_SYNC and S_NOQUOTA to linux/fs.h
- kfree_link to linux/namei.h

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 fs/ext4l/ext4_uboot.h | 5 -----
 include/linux/fs.h    | 4 ++++
 include/linux/namei.h | 3 +++
 3 files changed, 7 insertions(+), 5 deletions(-)
  

Patch

diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h
index a7c7abf30b8..11d1d8b0d48 100644
--- a/fs/ext4l/ext4_uboot.h
+++ b/fs/ext4l/ext4_uboot.h
@@ -94,9 +94,6 @@ 
 #include <linux/sched/mm.h>
 
 #define EXT4_FIEMAP_EXTENT_HOLE		0x08000000
-#define O_SYNC		0
-#define S_NOQUOTA		0
-
 #ifndef PAGE_SHIFT
 #define PAGE_SHIFT	12
 #endif
@@ -210,8 +207,6 @@  struct path;
 
 #include <linux/delayed_call.h>
 
-#define kfree_link		kfree
-
 /*
  * Additional stubs for super.c
  */
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 69178235141..0d6da467026 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -387,6 +387,10 @@  static inline void inode_init_once(struct inode *inode)
 #define S_ENCRYPTED	64	/* Encrypted */
 #define S_CASEFOLD	128	/* Case-folded */
 #define S_VERITY	256	/* Verity enabled */
+#define S_NOQUOTA	0	/* No quota (stub) */
+
+/* Open flags - stubs for U-Boot */
+#define O_SYNC		0
 
 /* Permission mode constants */
 #define S_IRWXUGO	(S_IRWXU | S_IRWXG | S_IRWXO)
diff --git a/include/linux/namei.h b/include/linux/namei.h
index 10ea86dc49d..0b9000e8472 100644
--- a/include/linux/namei.h
+++ b/include/linux/namei.h
@@ -31,4 +31,7 @@  static inline void nd_terminate_link(void *name, loff_t len, int maxlen)
 	((char *)name)[min_t(loff_t, len, maxlen)] = '\0';
 }
 
+/* kfree_link - free a symlink target allocated with kmalloc */
+#define kfree_link		kfree
+
 #endif /* _LINUX_NAMEI_H */