fs: simplify vfs_get_super
Subsystems (2)
PATCH 1/1 fs: simplify vfs_get_super
Remove the pointless keying argument and associated enum and pass the fill_super callback and a "bool reconf" instead. Also mark the function static given that there are no users outside of super.c.
--- Documentation/filesystems/mount_api.rst | 11 ----- fs/super.c | 60 ++++--------------------- include/linux/fs_context.h | 14 ------ 3 files changed, 9 insertions(+), 76 deletions(-)
Documentation/filesystems/mount_api.rst +0 -11
@@ -562,17 +562,6 @@ or looking up of superblocks. The following helpers all wrap sget_fc(): - * :: - - int vfs_get_super(struct fs_context *fc, - enum vfs_get_super_keying keying, - int (*fill_super)(struct super_block *sb, - struct fs_context *fc)) - - This creates/looks up a deviceless superblock. The keying indicates how - many superblocks of this type may exist and in what manner they may be - shared: - (1) vfs_get_single_super Only one such superblock may exist in the system. Any further
fs/super.c +9 -51
105 lines not on this page · raw message
include/linux/fs_context.h +0 -14
@@ -145,20 +145,6 @@ extern void fc_drop_locked(struct fs_context *fc);int reconfigure_single (struct super_block *s,int flags,void *data); -/* -* sget() wrappers to be called from the ->get_tree() op. -*/ -enum vfs_get_super_keying { - vfs_get_single_super,/* Only one such superblock may exist */ - vfs_get_single_reconf_super,/* As above, but reconfigure if it exists */ - vfs_get_keyed_super,/* Superblocks with different s_fs_info keys may exist */ - vfs_get_independent_super,/* Multiple independent superblocks may exist */ -}; -extern int vfs_get_super (struct fs_context *fc, -enum vfs_get_super_keying keying, -int (*fill_super)(struct super_block *sb, -struct fs_context *fc)); -extern int get_tree_nodev (struct fs_context *fc,int (*fill_super)(struct super_block *sb,struct fs_context *fc));
Signature · 1 line
2.30.2
Quoted 3 lines · Christoph Hellwig
Remove the pointless keying argument and associated enum and pass the
fill_supercallback and a "bool reconf" instead. Also mark the function static given that there are no users outside ofsuper.c.
Al, can you pick this one up?
Al Viro
maintainerQuoted 6 lines · Christoph Hellwig
Quoted 3 lines · Christoph Hellwig
Remove the pointless keying argument and associated enum and pass the
fill_supercallback and a "bool reconf" instead. Also mark the function static given that there are no users outside ofsuper.c.Al, can you pick this one up?
Applied, even though I want to see if we can lift sget_fc() out of that thing and turn it into something that would just handle the "here's a superblock, here's fc, here's fill_super callback, do the right thing" part and hopefully might be reused in bdev part...
Quoted 6 lines · Christoph Hellwig
Remove the pointless keying argument and associated enum and pass the
fill_supercallback and a "bool reconf" instead. Also mark the function static given that there are no users outside ofsuper.c.Signed-off-by Christoph Hellwig <[email protected]>---
Looks good,