[PATCH] fs: remove unused vfs_empty_path()

Sang-Heon Jeon posted 1 patch 6 days, 6 hours ago
include/linux/fs.h | 17 -----------------
1 file changed, 17 deletions(-)
[PATCH] fs: remove unused vfs_empty_path()
Posted by Sang-Heon Jeon 6 days, 6 hours ago
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.

Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>
---
 include/linux/fs.h | 17 -----------------
 1 file changed, 17 deletions(-)

diff --git a/include/linux/fs.h b/include/linux/fs.h
index 05d05bb9c951..ef8eb5af06c5 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -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,
-- 
2.43.0
Re: [PATCH] fs: remove unused vfs_empty_path()
Posted by Jan Kara 1 day, 12 hours ago
On Sat 19-09-26 01:51:03, Sang-Heon Jeon wrote:
> 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.
> 
> Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>

Looks good. Feel free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
>  include/linux/fs.h | 17 -----------------
>  1 file changed, 17 deletions(-)
> 
> diff --git a/include/linux/fs.h b/include/linux/fs.h
> index 05d05bb9c951..ef8eb5af06c5 100644
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -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,
> -- 
> 2.43.0
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR