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(-)
@@ -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>
@@ -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 */