Skip to contentSkip to conversation

fs: remove unused vfs_empty_path()

PATCH Applied Sang-Heon Jeon 3 participants 3 messages Sep 18 – Sep 25 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs: remove unused vfs_empty_path()

Since commit e896474fe485 ("getname_maybe_null() - the third variant of pathname copy-in"), vfs_empty_path() has no callers.

So remove it.

No functional change.

---
 include/linux/fs.h | 17 -----------------
 1 file changed, 17 deletions(-)
include/linux/fs.h +0 -17
index 05d05bb9c951..ef8eb5af06c5 100644
@@ -3653,23 +3653,6 @@ extern int vfs_fadvise(struct file *file, loff_t offset, loff_t len,
 extern int generic_fadvise(struct file *file, loff_t offset, loff_t len,
 			   int advice);
 
-static inline bool vfs_empty_path(int dfd, const char __user *path)
-{
-	char c;
-
-	if (dfd < 0)
-		return false;
-
-	/* We now allow NULL to be used for empty path. */
-	if (!path)
-		return true;
-
-	if (unlikely(get_user(c, path)))
-		return false;
-
-	return !c;
-}
-
 int generic_atomic_write_valid(struct kiocb *iocb, struct iov_iter *iter);
 
 static inline bool extensible_ioctl_valid(unsigned int cmd_a,
Signature · 1 line
2.43.0
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Sang-Heon Jeon

Since commit e896474fe485 ("getname_maybe_null() - the third variant of pathname copy-in"), vfs_empty_path() has no callers.

So remove it.

No functional change.

Looks good. Feel free to add:

Honza

Quoted 35 lines
---
 include/linux/fs.h | 17 -----------------
 1 file changed, 17 deletions(-)
include/linux/fs.h +0 -17
index 05d05bb9c951..ef8eb5af06c5 100644
@@ -3653,23 +3653,6 @@ extern int vfs_fadvise(struct file *file, loff_t offset, loff_t len,
 extern int generic_fadvise(struct file *file, loff_t offset, loff_t len,
 			   int advice);
 
-static inline bool vfs_empty_path(int dfd, const char __user *path)
-{
-	char c;
-
-	if (dfd < 0)
-		return false;
-
-	/* We now allow NULL to be used for empty path. */
-	if (!path)
-		return true;
-
-	if (unlikely(get_user(c, path)))
-		return false;
-
-	return !c;
-}
-
 int generic_atomic_write_valid(struct kiocb *iocb, struct iov_iter *iter);
 
 static inline bool extensible_ioctl_valid(unsigned int cmd_a,
Signature · 1 line
2.43.0
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR
maintainer Applied
#2 lore raw
In reply to Sang-Heon Jeon
Quoted 1 line · Sang-Heon Jeon

fs: remove unused vfs_empty_path()

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

[1/1] fs: remove unused vfs_empty_path()

      https://git.kernel.org/vfs/vfs/c/98abb2b35835