[Concept,14/17] ext4l: Move super_operations to linux/fs/super_types.h

Message ID 20260120234344.495605-15-sjg@u-boot.org
State New
Headers
Series ext4l: Move compatibility stubs to standard Linux headers |

Commit Message

Simon Glass Jan. 20, 2026, 11:43 p.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

Move struct super_operations to linux/fs/super_types.h where the Linux
kernel defines it, alongside struct super_block.

Add forward declarations for the types used by super_operations members.

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

 fs/ext4l/ext4_uboot.h          | 21 +--------------------
 include/linux/fs/super_types.h | 26 ++++++++++++++++++++++++++
 2 files changed, 27 insertions(+), 20 deletions(-)
  

Patch

diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h
index 12250b8daf4..1ac7b63819a 100644
--- a/fs/ext4l/ext4_uboot.h
+++ b/fs/ext4l/ext4_uboot.h
@@ -954,26 +954,7 @@  static u64 __attribute__((unused)) __ext4_sectors[2];
 struct kstatfs;
 struct fid;
 
-/* super_operations - for VFS */
-struct super_operations {
-	struct inode *(*alloc_inode)(struct super_block *);
-	void (*free_inode)(struct inode *);
-	void (*destroy_inode)(struct inode *);
-	int (*write_inode)(struct inode *, struct writeback_control *);
-	void (*dirty_inode)(struct inode *, int);
-	int (*drop_inode)(struct inode *);
-	void (*evict_inode)(struct inode *);
-	void (*put_super)(struct super_block *);
-	int (*sync_fs)(struct super_block *, int);
-	int (*freeze_fs)(struct super_block *);
-	int (*unfreeze_fs)(struct super_block *);
-	int (*statfs)(struct dentry *, struct kstatfs *);
-	int (*show_options)(struct seq_file *, struct dentry *);
-	void (*shutdown)(struct super_block *);
-	ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t);
-	ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t);
-	struct dentry *(*get_dquots)(struct inode *);
-};
+/* super_operations is in linux/fs/super_types.h */
 
 /* export_operations and fid - use linux/exportfs.h */
 #include <linux/exportfs.h>
diff --git a/include/linux/fs/super_types.h b/include/linux/fs/super_types.h
index f3ed772ef40..67e02a04bfb 100644
--- a/include/linux/fs/super_types.h
+++ b/include/linux/fs/super_types.h
@@ -20,6 +20,10 @@  struct file_system_type;
 struct super_operations;
 struct export_operations;
 struct xattr_handler;
+struct inode;
+struct writeback_control;
+struct kstatfs;
+struct seq_file;
 
 /* sb_writers stub */
 struct sb_writers {
@@ -54,6 +58,28 @@  struct super_block {
 	struct list_head s_inodes;
 };
 
+/* super_operations - VFS superblock operations */
+struct super_operations {
+	struct inode *(*alloc_inode)(struct super_block *);
+	void (*free_inode)(struct inode *);
+	void (*destroy_inode)(struct inode *);
+	int (*write_inode)(struct inode *, struct writeback_control *);
+	void (*dirty_inode)(struct inode *, int);
+	int (*drop_inode)(struct inode *);
+	void (*evict_inode)(struct inode *);
+	void (*put_super)(struct super_block *);
+	int (*sync_fs)(struct super_block *, int);
+	int (*freeze_fs)(struct super_block *);
+	int (*unfreeze_fs)(struct super_block *);
+	int (*statfs)(struct dentry *, struct kstatfs *);
+	int (*show_options)(struct seq_file *, struct dentry *);
+	void (*shutdown)(struct super_block *);
+	ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t);
+	ssize_t (*quota_write)(struct super_block *, int, const char *, size_t,
+			       loff_t);
+	struct dentry *(*get_dquots)(struct inode *);
+};
+
 /* Superblock flags - also defined in linux/fs.h */
 #ifndef SB_RDONLY
 #define SB_RDONLY	(1 << 0)	/* Read-only mount */