lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <TYCP286MB23233CC984811CFD38F69BC1CA349@TYCP286MB2323.JPNP286.PROD.OUTLOOK.COM>
Date:   Sun, 30 Oct 2022 21:06:08 +0800
From:   Dawei Li <set_pte_at@...look.com>
To:     viro@...iv.linux.org.uk
Cc:     brauner@...nel.org, neilb@...e.de, linux-fsdevel@...r.kernel.org,
        linux-kernel@...r.kernel.org, Dawei Li <set_pte_at@...look.com>
Subject: [PATCH v2] vfs: Make vfs_get_super() internal

For now there are no external callers of vfs_get_super(),
so just make it an internal API.

v1: https://lore.kernel.org/all/TYCP286MB2323D37F4F6400FD07D7C7F7CA319@TYCP286MB2323.JPNP286.PROD.OUTLOOK.COM/

v2: move vfs_get_super_keying to super.c, as the suggestion
from Christian Brauner.

base-commit: 3aca47127a646165965ff52803e2b269eed91afc

Signed-off-by: Dawei Li <set_pte_at@...look.com>
---
 fs/super.c                 | 13 +++++++++++--
 include/linux/fs_context.h | 14 --------------
 2 files changed, 11 insertions(+), 16 deletions(-)

diff --git a/fs/super.c b/fs/super.c
index 6a82660e1adb..24e31e458552 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -1111,6 +1111,16 @@ static int test_single_super(struct super_block *s, struct fs_context *fc)
 	return 1;
 }
 
+/*
+ * 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 */
+};
+
 /**
  * vfs_get_super - Get a superblock with a search key set in s_fs_info.
  * @fc: The filesystem context holding the parameters
@@ -1136,7 +1146,7 @@ static int test_single_super(struct super_block *s, struct fs_context *fc)
  * A permissions check is made by sget_fc() unless we're getting a superblock
  * for a kernel-internal mount or a submount.
  */
-int vfs_get_super(struct fs_context *fc,
+static 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))
@@ -1189,7 +1199,6 @@ int vfs_get_super(struct fs_context *fc,
 	deactivate_locked_super(sb);
 	return err;
 }
-EXPORT_SYMBOL(vfs_get_super);
 
 int get_tree_nodev(struct fs_context *fc,
 		  int (*fill_super)(struct super_block *sb,
diff --git a/include/linux/fs_context.h b/include/linux/fs_context.h
index 13fa6f3df8e4..87a34f2fa68d 100644
--- a/include/linux/fs_context.h
+++ b/include/linux/fs_context.h
@@ -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));
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ