Skip to contentSkip to conversation

fs: simplify vfs_get_super

PATCH In review Christoph Hellwig 3 participants 4 messages Oct 31, 2022 – Nov 28, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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
index eb358a00be279..6114daf337978 100644
@@ -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
index 13fa6f3df8e46..87a34f2fa68de 100644
@@ -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
#1 lore raw
Quoted 3 lines · Christoph Hellwig

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.

Al, can you pick this one up?

maintainer
#2 lore raw
Quoted 6 lines · Christoph Hellwig
Quoted 3 lines · Christoph Hellwig

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.

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...