Skip to contentSkip to conversation

remove or unexport unused fs_conext infrastructure

PATCH In review Christoph Hellwig 4 participants 10 messages Feb 19 – Feb 20

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

Hi all,

now that the fs_context conversion is finished, remove all the bits that did not end up having users, or unexport them if the users are always built in.

Diffstat:

 Documentation/filesystems/mount_api.rst |    4 ----
 fs/fs_context.c                         |    1 -
 fs/fs_parser.c                          |   19 +------------------
 include/linux/fs_parser.h               |    8 ++------
 4 files changed, 3 insertions(+), 29 deletions(-)
#1 lore raw

PATCH 1/4 fs: mark bool_names static

The bool_names array is only used in fs_parser.c so mark it static.

---
 fs/fs_parser.c            | 3 +--
 include/linux/fs_parser.h | 2 --
 2 files changed, 1 insertion(+), 4 deletions(-)
fs/fs_parser.c +1 -2
index c092a9f79e32..46993e31137d 100644
@@ -13,7 +13,7 @@
 #include <linux/namei.h>
 #include "internal.h"
 
-const struct constant_table bool_names[] = {
+static const struct constant_table bool_names[] = {
 	{ "0",		false },
 	{ "1",		true },
 	{ "false",	false },
@@ -22,7 +22,6 @@ const struct constant_table bool_names[] = {
 	{ "yes",	true },
 	{ },
 };
-EXPORT_SYMBOL(bool_names);
 
 static const struct constant_table *
 __lookup_constant(const struct constant_table *tbl, const char *name)
include/linux/fs_parser.h +0 -2
index 5e8a3b546033..ac8253cca2bc 100644
@@ -84,8 +84,6 @@ extern int fs_lookup_param(struct fs_context *fc,
 
 extern int lookup_constant(const struct constant_table tbl[], const char *name, int not_found);
 
-extern const struct constant_table bool_names[];
-
 #ifdef CONFIG_VALIDATE_FS_PARSER
 extern bool fs_validate_description(const char *name,
 				    const struct fs_parameter_spec *desc);
Signature · 1 line
2.47.3
#2 lore raw

PATCH 2/4 fs: remove fsparam_blob / fs_param_is_blob

In reply to Christoph Hellwig

These are not used anywhere even after the fs_context conversion is finished, so remove them.

---
 Documentation/filesystems/mount_api.rst | 2 --
 fs/fs_parser.c                          | 9 ---------
 include/linux/fs_parser.h               | 3 +--
 3 files changed, 1 insertion(+), 13 deletions(-)
Documentation/filesystems/mount_api.rst +0 -2
index a064234fed5b..b4a0f23914a6 100644
@@ -647,7 +647,6 @@ The members are as follows:
 	fs_param_is_u64		64-bit unsigned int	result->uint_64
 	fs_param_is_enum	Enum value name 	result->uint_32
 	fs_param_is_string	Arbitrary string	param->string
-	fs_param_is_blob	Binary blob		param->blob
 	fs_param_is_blockdev	Blockdev path		* Needs lookup
 	fs_param_is_path	Path			* Needs lookup
 	fs_param_is_fd		File descriptor		result->int_32
@@ -681,7 +680,6 @@ The members are as follows:
 	fsparam_u64()		fs_param_is_u64
 	fsparam_enum()		fs_param_is_enum
 	fsparam_string()	fs_param_is_string
-	fsparam_blob()		fs_param_is_blob
 	fsparam_bdev()		fs_param_is_blockdev
 	fsparam_path()		fs_param_is_path
 	fsparam_fd()		fs_param_is_fd
fs/fs_parser.c +0 -9
index 46993e31137d..79e8fe9176fa 100644
@@ -277,15 +277,6 @@ int fs_param_is_string(struct p_log *log, const struct fs_parameter_spec *p,
 }
 EXPORT_SYMBOL(fs_param_is_string);
 
-int fs_param_is_blob(struct p_log *log, const struct fs_parameter_spec *p,
-		     struct fs_parameter *param, struct fs_parse_result *result)
-{
-	if (param->type != fs_value_is_blob)
-		return fs_param_bad_value(log, param);
-	return 0;
-}
-EXPORT_SYMBOL(fs_param_is_blob);
-
 int fs_param_is_fd(struct p_log *log, const struct fs_parameter_spec *p,
 		  struct fs_parameter *param, struct fs_parse_result *result)
 {
include/linux/fs_parser.h +1 -2
index ac8253cca2bc..961562b101c5 100644
@@ -27,7 +27,7 @@ typedef int fs_param_type(struct p_log *,
  * The type of parameter expected.
  */
 fs_param_type fs_param_is_bool, fs_param_is_u32, fs_param_is_s32, fs_param_is_u64,
-	fs_param_is_enum, fs_param_is_string, fs_param_is_blob, fs_param_is_blockdev,
+	fs_param_is_enum, fs_param_is_string, fs_param_is_blockdev,
 	fs_param_is_path, fs_param_is_fd, fs_param_is_uid, fs_param_is_gid,
 	fs_param_is_file_or_string;
 
@@ -125,7 +125,6 @@ static inline bool fs_validate_description(const char *name,
 #define fsparam_enum(NAME, OPT, array)	__fsparam(fs_param_is_enum, NAME, OPT, 0, array)
 #define fsparam_string(NAME, OPT) \
 				__fsparam(fs_param_is_string, NAME, OPT, 0, NULL)
-#define fsparam_blob(NAME, OPT)	__fsparam(fs_param_is_blob, NAME, OPT, 0, NULL)
 #define fsparam_bdev(NAME, OPT)	__fsparam(fs_param_is_blockdev, NAME, OPT, 0, NULL)
 #define fsparam_path(NAME, OPT)	__fsparam(fs_param_is_path, NAME, OPT, 0, NULL)
 #define fsparam_fd(NAME, OPT)	__fsparam(fs_param_is_fd, NAME, OPT, 0, NULL)
Signature · 1 line
2.47.3
#3 lore raw

PATCH 3/4 fs: remove fsparam_path / fs_param_is_path

In reply to Christoph Hellwig

These are not used anywhere even after the fs_context conversion is finished, so remove them.

---
 Documentation/filesystems/mount_api.rst | 2 --
 fs/fs_parser.c                          | 7 -------
 include/linux/fs_parser.h               | 3 +--
 3 files changed, 1 insertion(+), 11 deletions(-)
Documentation/filesystems/mount_api.rst +0 -2
index b4a0f23914a6..e8b94357b4df 100644
@@ -648,7 +648,6 @@ The members are as follows:
 	fs_param_is_enum	Enum value name 	result->uint_32
 	fs_param_is_string	Arbitrary string	param->string
 	fs_param_is_blockdev	Blockdev path		* Needs lookup
-	fs_param_is_path	Path			* Needs lookup
 	fs_param_is_fd		File descriptor		result->int_32
 	fs_param_is_uid		User ID (u32)           result->uid
 	fs_param_is_gid		Group ID (u32)          result->gid
@@ -681,7 +680,6 @@ The members are as follows:
 	fsparam_enum()		fs_param_is_enum
 	fsparam_string()	fs_param_is_string
 	fsparam_bdev()		fs_param_is_blockdev
-	fsparam_path()		fs_param_is_path
 	fsparam_fd()		fs_param_is_fd
 	fsparam_uid()		fs_param_is_uid
 	fsparam_gid()		fs_param_is_gid
fs/fs_parser.c +0 -7
index 79e8fe9176fa..b4cc4cce518a 100644
@@ -361,13 +361,6 @@ int fs_param_is_blockdev(struct p_log *log, const struct fs_parameter_spec *p,
 }
 EXPORT_SYMBOL(fs_param_is_blockdev);
 
-int fs_param_is_path(struct p_log *log, const struct fs_parameter_spec *p,
-		     struct fs_parameter *param, struct fs_parse_result *result)
-{
-	return 0;
-}
-EXPORT_SYMBOL(fs_param_is_path);
-
 #ifdef CONFIG_VALIDATE_FS_PARSER
 /**
  * fs_validate_description - Validate a parameter specification array
include/linux/fs_parser.h +1 -2
index 961562b101c5..98b83708f92b 100644
@@ -28,7 +28,7 @@ typedef int fs_param_type(struct p_log *,
  */
 fs_param_type fs_param_is_bool, fs_param_is_u32, fs_param_is_s32, fs_param_is_u64,
 	fs_param_is_enum, fs_param_is_string, fs_param_is_blockdev,
-	fs_param_is_path, fs_param_is_fd, fs_param_is_uid, fs_param_is_gid,
+	fs_param_is_fd, fs_param_is_uid, fs_param_is_gid,
 	fs_param_is_file_or_string;
 
 /*
@@ -126,7 +126,6 @@ static inline bool fs_validate_description(const char *name,
 #define fsparam_string(NAME, OPT) \
 				__fsparam(fs_param_is_string, NAME, OPT, 0, NULL)
 #define fsparam_bdev(NAME, OPT)	__fsparam(fs_param_is_blockdev, NAME, OPT, 0, NULL)
-#define fsparam_path(NAME, OPT)	__fsparam(fs_param_is_path, NAME, OPT, 0, NULL)
 #define fsparam_fd(NAME, OPT)	__fsparam(fs_param_is_fd, NAME, OPT, 0, NULL)
 #define fsparam_file_or_string(NAME, OPT) \
 				__fsparam(fs_param_is_file_or_string, NAME, OPT, 0, NULL)
Signature · 1 line
2.47.3
Reviewed-by on v1 3/4
#4 lore raw

Re: [PATCH 3/4] fs: remove fsparam_path / fs_param_is_path

Quoted 15 lines · Christoph Hellwig

These are not used anywhere even after the fs_context conversion is finished, so remove them.

---
 Documentation/filesystems/mount_api.rst | 2 --
 fs/fs_parser.c                          | 7 -------
 include/linux/fs_parser.h               | 3 +--
 3 files changed, 1 insertion(+), 11 deletions(-)
Documentation/filesystems/mount_api.rst +0 -0
index b4a0f23914a6..e8b94357b4df 100644

Documentation/filesystems/mount_api.rst The members are as follows: · line 650

Quoted 3 lines
Documentation/filesystems/mount_api.rst +0 -0
@@ -648,7 +648,6 @@ The members are as follows:
 	fs_param_is_enum	Enum value name 	result->uint_32
 	fs_param_is_string	Arbitrary string	param->string
 	fs_param_is_blockdev	Blockdev path		* Needs lookup

Unrelated: should xfs be using fsparam_bdev for its logdev/rtdev mount options?

Or, more crazily, should it grow logfd/rtfd options that use fsparam_fd?

This patch looks ok,

--D

Quoted 55 lines
Documentation/filesystems/mount_api.rst +0 -2
-	fs_param_is_path	Path			* Needs lookup
 	fs_param_is_fd		File descriptor		result->int_32
 	fs_param_is_uid		User ID (u32)           result->uid
 	fs_param_is_gid		Group ID (u32)          result->gid
@@ -681,7 +680,6 @@ The members are as follows:
 	fsparam_enum()		fs_param_is_enum
 	fsparam_string()	fs_param_is_string
 	fsparam_bdev()		fs_param_is_blockdev
-	fsparam_path()		fs_param_is_path
 	fsparam_fd()		fs_param_is_fd
 	fsparam_uid()		fs_param_is_uid
 	fsparam_gid()		fs_param_is_gid
fs/fs_parser.c +0 -7
index 79e8fe9176fa..b4cc4cce518a 100644
@@ -361,13 +361,6 @@ int fs_param_is_blockdev(struct p_log *log, const struct fs_parameter_spec *p,
 }
 EXPORT_SYMBOL(fs_param_is_blockdev);
 
-int fs_param_is_path(struct p_log *log, const struct fs_parameter_spec *p,
-		     struct fs_parameter *param, struct fs_parse_result *result)
-{
-	return 0;
-}
-EXPORT_SYMBOL(fs_param_is_path);
-
 #ifdef CONFIG_VALIDATE_FS_PARSER
 /**
  * fs_validate_description - Validate a parameter specification array
include/linux/fs_parser.h +1 -2
index 961562b101c5..98b83708f92b 100644
@@ -28,7 +28,7 @@ typedef int fs_param_type(struct p_log *,
  */
 fs_param_type fs_param_is_bool, fs_param_is_u32, fs_param_is_s32, fs_param_is_u64,
 	fs_param_is_enum, fs_param_is_string, fs_param_is_blockdev,
-	fs_param_is_path, fs_param_is_fd, fs_param_is_uid, fs_param_is_gid,
+	fs_param_is_fd, fs_param_is_uid, fs_param_is_gid,
 	fs_param_is_file_or_string;
 
 /*
@@ -126,7 +126,6 @@ static inline bool fs_validate_description(const char *name,
 #define fsparam_string(NAME, OPT) \
 				__fsparam(fs_param_is_string, NAME, OPT, 0, NULL)
 #define fsparam_bdev(NAME, OPT)	__fsparam(fs_param_is_blockdev, NAME, OPT, 0, NULL)
-#define fsparam_path(NAME, OPT)	__fsparam(fs_param_is_path, NAME, OPT, 0, NULL)
 #define fsparam_fd(NAME, OPT)	__fsparam(fs_param_is_fd, NAME, OPT, 0, NULL)
 #define fsparam_file_or_string(NAME, OPT) \
 				__fsparam(fs_param_is_file_or_string, NAME, OPT, 0, NULL)
Signature · 1 line
2.47.3
#5 lore raw

Re: [PATCH 3/4] fs: remove fsparam_path / fs_param_is_path

Quoted 11 lines · Darrick J. Wong

Documentation/filesystems/mount_api.rst The members are as follows: · line 650

Quoted 8 lines
Documentation/filesystems/mount_api.rst +0 -0
index b4a0f23914a6..e8b94357b4df 100644
@@ -648,7 +648,6 @@ The members are as follows:
 	fs_param_is_enum	Enum value name 	result->uint_32
 	fs_param_is_string	Arbitrary string	param->string
 	fs_param_is_blockdev	Blockdev path		* Needs lookup

Unrelated: should xfs be using fsparam_bdev for its logdev/rtdev mount options?

Not sure what the point is in having separate string helpers with meaning, but maybe I'm missing something/

Quoted 1 line

Or, more crazily, should it grow logfd/rtfd options that use fsparam_fd?

What would the use case be for that?

#6 lore raw

Re: [PATCH 3/4] fs: remove fsparam_path / fs_param_is_path

Quoted 13 lines · Christoph Hellwig
Quoted 11 lines · Darrick J. Wong

Documentation/filesystems/mount_api.rst The members are as follows: · line 650

Quoted 8 lines
Documentation/filesystems/mount_api.rst +0 -0
index b4a0f23914a6..e8b94357b4df 100644
@@ -648,7 +648,6 @@ The members are as follows:
 	fs_param_is_enum	Enum value name 	result->uint_32
 	fs_param_is_string	Arbitrary string	param->string
 	fs_param_is_blockdev	Blockdev path		* Needs lookup

Unrelated: should xfs be using fsparam_bdev for its logdev/rtdev mount options?

Quoted 2 lines

Not sure what the point is in having separate string helpers with meaning, but maybe I'm missing something/

I'm not sure either -- it'd be one thing if the fsconfig code could supply us with an open struct file to an O_EXCL bdev, but looking at the sole user ext4, all it does is sample i_rdev and pass it to bdev_file_open_by_dev.

Quoted 3 lines
Quoted 1 line

Or, more crazily, should it grow logfd/rtfd options that use fsparam_fd?

What would the use case be for that?

I've no idea, I guess if we had mount helper magic then it would be useful.

--D

#7 lore raw

PATCH 4/4 fs: unexport fs_context_for_reconfigure

In reply to Christoph Hellwig

fs_context_for_reconfigure is only used by core VFS code and devtmpfs, so unexport it.

---
 fs/fs_context.c | 1 -
 1 file changed, 1 deletion(-)
fs/fs_context.c +0 -1
index 81ed94f46cac..4a7b8fde4c5c 100644
@@ -318,7 +318,6 @@ struct fs_context *fs_context_for_reconfigure(struct dentry *dentry,
 	return alloc_fs_context(dentry->d_sb->s_type, dentry, sb_flags,
 				sb_flags_mask, FS_CONTEXT_FOR_RECONFIGURE);
 }
-EXPORT_SYMBOL(fs_context_for_reconfigure);
 
 /**
  * fs_context_for_submount: allocate a new fs_context for a submount
Signature · 1 line
2.47.3
maintainer Applied
#9 lore raw
In reply to Christoph Hellwig
Quoted 4 lines · Christoph Hellwig

now that the fs_context conversion is finished, remove all the bits that did not end up having users, or unexport them if the users are always built in.

Quoted 8 lines

Diffstat:

 Documentation/filesystems/mount_api.rst |    4 ----
 fs/fs_context.c                         |    1 -
 fs/fs_parser.c                          |   19 +------------------
 include/linux/fs_parser.h               |    8 ++------
 4 files changed, 3 insertions(+), 29 deletions(-)

[...]

Applied to the vfs-7.1.misc branch of the vfs/vfs.git tree. Patches in the vfs-7.1.misc branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase, trailer updates or similar. If in doubt, please check the listed branch.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs-7.1.misc

[1/4] fs: mark bool_names static

      https://git.kernel.org/vfs/vfs/c/0d799df5b147
[2/4] fs: remove fsparam_blob / fs_param_is_blob
      https://git.kernel.org/vfs/vfs/c/8823db29744f
[3/4] fs: remove fsparam_path / fs_param_is_path
      https://git.kernel.org/vfs/vfs/c/d2f2f7cf8e89
[4/4] fs: unexport fs_context_for_reconfigure
      https://git.kernel.org/vfs/vfs/c/bc014937bc11