Skip to contentSkip to conversation

drop unused VFS exports

PATCH In review Christoph Hellwig 4 participants 9 messages May 11

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

Hi all,

this series drops a little dead code from the VFS.

Diffstat:

 Documentation/filesystems/porting.rst |    1 -
 fs/namei.c                            |   22 ++++------------------
 fs/super.c                            |    1 -
 include/linux/namei.h                 |    1 -
 4 files changed, 4 insertions(+), 21 deletions(-)
#1 lore raw

PATCH 1/3 fs: unexport drop_super_exclusive

drop_super_exclusive is only used by the built-in quota code.

---
 fs/super.c | 1 -
 1 file changed, 1 deletion(-)
fs/super.c +0 -1
index 378e81efe643..5d46a0d5b616 100644
@@ -882,7 +882,6 @@ void drop_super_exclusive(struct super_block *sb)
 	super_unlock_excl(sb);
 	put_super(sb);
 }
-EXPORT_SYMBOL(drop_super_exclusive);
 
 enum super_iter_flags_t {
 	SUPER_ITER_EXCL		= (1U << 0),
Signature · 1 line
2.53.0
reviewer Reviewed-by on v1 1/3
#2 lore raw

Re: [PATCH 1/3] fs: unexport drop_super_exclusive

Quoted 3 lines · Christoph Hellwig

drop_super_exclusive is only used by the built-in quota code.

Looks good. Feel free to add:

Honza

Quoted 19 lines
---
 fs/super.c | 1 -
 1 file changed, 1 deletion(-)
fs/super.c +0 -1
index 378e81efe643..5d46a0d5b616 100644
@@ -882,7 +882,6 @@ void drop_super_exclusive(struct super_block *sb)
 	super_unlock_excl(sb);
 	put_super(sb);
 }
-EXPORT_SYMBOL(drop_super_exclusive);
 
 enum super_iter_flags_t {
 	SUPER_ITER_EXCL		= (1U << 0),
Signature · 1 line
2.53.0
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR
#3 lore raw

PATCH 2/3 fs: remove start_removing_user_path_at

In reply to Christoph Hellwig

This function is entirely unused, remove it.

---
 Documentation/filesystems/porting.rst | 1 -
 fs/namei.c                            | 9 ---------
 include/linux/namei.h                 | 1 -
 3 files changed, 11 deletions(-)
Documentation/filesystems/porting.rst +0 -1
index fdf074429cd3..f546b1d3897f 100644
@@ -1297,7 +1297,6 @@ Several functions are renamed:
 -  kern_path_locked -> start_removing_path
 -  kern_path_create -> start_creating_path
 -  user_path_create -> start_creating_user_path
--  user_path_locked_at -> start_removing_user_path_at
 -  done_path_create -> end_creating_path
 
 ---
fs/namei.c +0 -9
index c7fac83c9a85..bc641838530f 100644
@@ -3029,15 +3029,6 @@ struct dentry *start_removing_path(const char *name, struct path *path)
 	return __start_removing_path(AT_FDCWD, filename, path);
 }
 
-struct dentry *start_removing_user_path_at(int dfd,
-					   const char __user *name,
-					   struct path *path)
-{
-	CLASS(filename, filename)(name);
-	return __start_removing_path(dfd, filename, path);
-}
-EXPORT_SYMBOL(start_removing_user_path_at);
-
 int kern_path(const char *name, unsigned int flags, struct path *path)
 {
 	CLASS(filename_kernel, filename)(name);
include/linux/namei.h +0 -1
index 2ad6dd9987b9..80488b3de0c9 100644
@@ -61,7 +61,6 @@ extern struct dentry *start_creating_path(int, const char *, struct path *, unsi
 extern struct dentry *start_creating_user_path(int, const char __user *, struct path *, unsigned int);
 extern void end_creating_path(const struct path *, struct dentry *);
 extern struct dentry *start_removing_path(const char *, struct path *);
-extern struct dentry *start_removing_user_path_at(int , const char __user *, struct path *);
 static inline void end_removing_path(const struct path *path , struct dentry *dentry)
 {
 	end_creating_path(path, dentry);
Signature · 1 line
2.53.0
reviewer Reviewed-by on v1 2/3
#4 lore raw

Re: [PATCH 2/3] fs: remove start_removing_user_path_at

Quoted 3 lines · Christoph Hellwig

This function is entirely unused, remove it.

Fair. Feel free to add:

Honza

Quoted 53 lines
---
 Documentation/filesystems/porting.rst | 1 -
 fs/namei.c                            | 9 ---------
 include/linux/namei.h                 | 1 -
 3 files changed, 11 deletions(-)
Documentation/filesystems/porting.rst +0 -1
index fdf074429cd3..f546b1d3897f 100644
@@ -1297,7 +1297,6 @@ Several functions are renamed:
 -  kern_path_locked -> start_removing_path
 -  kern_path_create -> start_creating_path
 -  user_path_create -> start_creating_user_path
--  user_path_locked_at -> start_removing_user_path_at
 -  done_path_create -> end_creating_path
 
 ---
fs/namei.c +0 -9
index c7fac83c9a85..bc641838530f 100644
@@ -3029,15 +3029,6 @@ struct dentry *start_removing_path(const char *name, struct path *path)
 	return __start_removing_path(AT_FDCWD, filename, path);
 }
 
-struct dentry *start_removing_user_path_at(int dfd,
-					   const char __user *name,
-					   struct path *path)
-{
-	CLASS(filename, filename)(name);
-	return __start_removing_path(dfd, filename, path);
-}
-EXPORT_SYMBOL(start_removing_user_path_at);
-
 int kern_path(const char *name, unsigned int flags, struct path *path)
 {
 	CLASS(filename_kernel, filename)(name);
include/linux/namei.h +0 -1
index 2ad6dd9987b9..80488b3de0c9 100644
@@ -61,7 +61,6 @@ extern struct dentry *start_creating_path(int, const char *, struct path *, unsi
 extern struct dentry *start_creating_user_path(int, const char __user *, struct path *, unsigned int);
 extern void end_creating_path(const struct path *, struct dentry *);
 extern struct dentry *start_removing_path(const char *, struct path *);
-extern struct dentry *start_removing_user_path_at(int , const char __user *, struct path *);
 static inline void end_removing_path(const struct path *path , struct dentry *dentry)
 {
 	end_creating_path(path, dentry);
Signature · 1 line
2.53.0
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR
#5 lore raw

PATCH 3/3 fs: fold __start_removing_path into start_removing_path

In reply to Christoph Hellwig

Only one caller left, and simplified this way.

---
 fs/namei.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)
fs/namei.c +4 -9
index bc641838530f..4852ca208bd4 100644
@@ -2955,15 +2955,16 @@ void end_dirop(struct dentry *de)
 EXPORT_SYMBOL(end_dirop);
 
 /* does lookup, returns the object with parent locked */
-static struct dentry *__start_removing_path(int dfd, struct filename *name,
-					   struct path *path)
+struct dentry *start_removing_path(const char *name, struct path *path)
 {
+	CLASS(filename_kernel, filename)(name);
 	struct path parent_path __free(path_put) = {};
 	struct dentry *d;
 	struct qstr last;
 	int type, error;
 
-	error = filename_parentat(dfd, name, 0, &parent_path, &last, &type);
+	error = filename_parentat(AT_FDCWD, filename, 0, &parent_path, &last,
+			&type);
 	if (error)
 		return ERR_PTR(error);
 	if (unlikely(type != LAST_NORM))
@@ -3023,12 +3024,6 @@ struct dentry *kern_path_parent(const char *name, struct path *path)
 	return d;
 }
 
-struct dentry *start_removing_path(const char *name, struct path *path)
-{
-	CLASS(filename_kernel, filename)(name);
-	return __start_removing_path(AT_FDCWD, filename, path);
-}
-
 int kern_path(const char *name, unsigned int flags, struct path *path)
 {
 	CLASS(filename_kernel, filename)(name);
Signature · 1 line
2.53.0
reviewer Reviewed-by on v1 3/3
#6 lore raw

Re: [PATCH 3/3] fs: fold __start_removing_path into start_removing_path

Quoted 3 lines · Christoph Hellwig

Only one caller left, and simplified this way.

Looks good. Seems like it's like this for 8 months so we're hopefully not breaking Neil in the middle of some of his vfs series. In the worst case he can reintroduce this once it is really needed. Feel free to add:

Honza

Quoted 44 lines
---
 fs/namei.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)
fs/namei.c +4 -9
index bc641838530f..4852ca208bd4 100644
@@ -2955,15 +2955,16 @@ void end_dirop(struct dentry *de)
 EXPORT_SYMBOL(end_dirop);
 
 /* does lookup, returns the object with parent locked */
-static struct dentry *__start_removing_path(int dfd, struct filename *name,
-					   struct path *path)
+struct dentry *start_removing_path(const char *name, struct path *path)
 {
+	CLASS(filename_kernel, filename)(name);
 	struct path parent_path __free(path_put) = {};
 	struct dentry *d;
 	struct qstr last;
 	int type, error;
 
-	error = filename_parentat(dfd, name, 0, &parent_path, &last, &type);
+	error = filename_parentat(AT_FDCWD, filename, 0, &parent_path, &last,
+			&type);
 	if (error)
 		return ERR_PTR(error);
 	if (unlikely(type != LAST_NORM))
@@ -3023,12 +3024,6 @@ struct dentry *kern_path_parent(const char *name, struct path *path)
 	return d;
 }
 
-struct dentry *start_removing_path(const char *name, struct path *path)
-{
-	CLASS(filename_kernel, filename)(name);
-	return __start_removing_path(AT_FDCWD, filename, path);
-}
-
 int kern_path(const char *name, unsigned int flags, struct path *path)
 {
 	CLASS(filename_kernel, filename)(name);
Signature · 1 line
2.53.0
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR
#7 lore raw

Re: [PATCH 3/3] fs: fold __start_removing_path into start_removing_path

Quoted 8 lines · Jan Kara
Quoted 3 lines · Christoph Hellwig

Only one caller left, and simplified this way.

Looks good. Seems like it's like this for 8 months so we're hopefully not breaking Neil in the middle of some of his vfs series. In the worst case he can reintroduce this once it is really needed. Feel free to add:

Thanks for the heads-up Jan. No objection from me.
With bcachefs gone it is reasonable to discard start_removing_user_path_at(), and with that gone there is no benefit in __start_removing_path() being separate.

I have plans for changes to start_dirop() and start_renaming() but not to the various APIs which call those.

Thanks,
NeilBrown

Quoted 53 lines

Honza

Quoted 44 lines
---
 fs/namei.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)
fs/namei.c +4 -9
index bc641838530f..4852ca208bd4 100644
@@ -2955,15 +2955,16 @@ void end_dirop(struct dentry *de)
 EXPORT_SYMBOL(end_dirop);
 
 /* does lookup, returns the object with parent locked */
-static struct dentry *__start_removing_path(int dfd, struct filename *name,
-					   struct path *path)
+struct dentry *start_removing_path(const char *name, struct path *path)
 {
+	CLASS(filename_kernel, filename)(name);
 	struct path parent_path __free(path_put) = {};
 	struct dentry *d;
 	struct qstr last;
 	int type, error;
 
-	error = filename_parentat(dfd, name, 0, &parent_path, &last, &type);
+	error = filename_parentat(AT_FDCWD, filename, 0, &parent_path, &last,
+			&type);
 	if (error)
 		return ERR_PTR(error);
 	if (unlikely(type != LAST_NORM))
@@ -3023,12 +3024,6 @@ struct dentry *kern_path_parent(const char *name, struct path *path)
 	return d;
 }
 
-struct dentry *start_removing_path(const char *name, struct path *path)
-{
-	CLASS(filename_kernel, filename)(name);
-	return __start_removing_path(AT_FDCWD, filename, path);
-}
-
 int kern_path(const char *name, unsigned int flags, struct path *path)
 {
 	CLASS(filename_kernel, filename)(name);
Signature · 1 line
2.53.0
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR
maintainer Applied
#8 lore raw
In reply to Christoph Hellwig
Quoted 10 lines · Christoph Hellwig

this series drops a little dead code from the VFS.

Diffstat:

 Documentation/filesystems/porting.rst |    1 -
 fs/namei.c                            |   22 ++++------------------
 fs/super.c                            |    1 -
 include/linux/namei.h                 |    1 -
 4 files changed, 4 insertions(+), 21 deletions(-)

[...]

Applied to the vfs-7.2.misc branch of the vfs/vfs.git tree. Patches in the vfs-7.2.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.2.misc

[1/3] fs: unexport drop_super_exclusive

      https://git.kernel.org/vfs/vfs/c/017f5962c5f7
[2/3] fs: remove start_removing_user_path_at
      https://git.kernel.org/vfs/vfs/c/a7b8abe0621c
[3/3] fs: fold __start_removing_path into start_removing_path
      https://git.kernel.org/vfs/vfs/c/6f7625314d5c