Re: [PATCH v3 1/2] fs: make file_listxattr and file_removexattr helpers non-static

Jan Kara <[email protected]> Mon, 27 Jul 2026 16:46:53 +0200
Newsgroups org.kernel.vger.io-uring,org.kernel.vger.linux-fsdevel,org.kernel.vger.linux-kernel
Message-ID <dyyz25zraphwgpgyrfes7uunepxcsswok4z3qpnggivd3bjjzk@l3nwvj4utuib>
On Tue 21-07-26 10:35:13, Aditya Prakash Srivastava wrote:
> In preparation for adding IORING_OP_FREMOVEXATTR and
> IORING_OP_FLISTXATTR support in io_uring, we need to invoke the VFS-layer
> helpers from within io_uring.
> 
> Make the following helpers non-static and declare them in fs/internal.h:
> - file_listxattr()
> - file_removexattr()
> 
> No functional change is introduced.
> 
> Signed-off-by: Aditya Prakash Srivastava <[email protected]>

Looks ok to me. Feel free to add:

Reviewed-by: Jan Kara <[email protected]>

								Honza

> ---
>  fs/internal.h | 2 ++
>  fs/xattr.c    | 3 +--
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/internal.h b/fs/internal.h
> index 355d93f92208..ee86b24db79a 100644
> --- a/fs/internal.h
> +++ b/fs/internal.h
> @@ -297,6 +297,8 @@ int filename_setxattr(int dfd, struct filename *filename,
>  		      unsigned int lookup_flags, struct kernel_xattr_ctx *ctx);
>  int setxattr_copy(const char __user *name, struct kernel_xattr_ctx *ctx);
>  int import_xattr_name(struct xattr_name *kname, const char __user *name);
> +ssize_t file_listxattr(struct file *f, char __user *list, size_t size);
> +int file_removexattr(struct file *f, struct xattr_name *kname);
>  
>  int may_write_xattr(struct mnt_idmap *idmap, struct inode *inode);
>  
> diff --git a/fs/xattr.c b/fs/xattr.c
> index d58979115200..31b8a5eeec1e 100644
> --- a/fs/xattr.c
> +++ b/fs/xattr.c
> @@ -953,7 +953,6 @@ listxattr(struct dentry *d, char __user *list, size_t size)
>  	return error;
>  }
>  
> -static
>  ssize_t file_listxattr(struct file *f, char __user *list, size_t size)
>  {
>  	audit_file(f);
> @@ -1036,7 +1035,7 @@ removexattr(struct mnt_idmap *idmap, struct dentry *d, const char *name)
>  	return vfs_removexattr(idmap, d, name);
>  }
>  
> -static int file_removexattr(struct file *f, struct xattr_name *kname)
> +int file_removexattr(struct file *f, struct xattr_name *kname)
>  {
>  	int error = mnt_want_write_file(f);
>  
> -- 
> 2.47.3
> 
-- 
Jan Kara <[email protected]>
SUSE Labs, CR