Linux io-uring development
 help / color / mirror / Atom feed
From: Aditya Prakash Srivastava <aditya.ansh182@gmail.com>
To: Jens Axboe <axboe@kernel.dk>,
	Christian Brauner <brauner@kernel.org>,
	Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Jan Kara <jack@suse.cz>,
	io-uring@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Aditya Prakash Srivastava <aditya.ansh182@gmail.com>
Subject: [PATCH 1/2] fs: make listxattr and removexattr helpers non-static
Date: Mon, 20 Jul 2026 07:22:12 +0000	[thread overview]
Message-ID: <20260720072213.2719-2-aditya.ansh182@gmail.com> (raw)
In-Reply-To: <20260720072213.2719-1-aditya.ansh182@gmail.com>

In preparation for adding IORING_OP_REMOVEXATTR, FREMOVEXATTR,
LISTXATTR, and FLISTXATTR support in io_uring, we need to invoke
the respective VFS-layer list/remove helpers from within io_uring.

Make the following four helpers non-static and declare them in
fs/internal.h:
- file_listxattr()
- filename_listxattr()
- file_removexattr()
- filename_removexattr()

No functional change is introduced.

Signed-off-by: Aditya Prakash Srivastava <aditya.ansh182@gmail.com>
---
 fs/internal.h | 7 +++++++
 fs/xattr.c    | 8 +++-----
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/fs/internal.h b/fs/internal.h
index 355d93f92208..1294424431f3 100644
--- a/fs/internal.h
+++ b/fs/internal.h
@@ -297,6 +297,13 @@ 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);
+ssize_t filename_listxattr(int dfd, struct filename *filename,
+			   unsigned int lookup_flags,
+			   char __user *list, size_t size);
+int file_removexattr(struct file *f, struct xattr_name *kname);
+int filename_removexattr(int dfd, struct filename *filename,
+			 unsigned int lookup_flags, 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..1004b1d22cc4 100644
--- a/fs/xattr.c
+++ b/fs/xattr.c
@@ -953,14 +953,12 @@ 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);
 	return listxattr(f->f_path.dentry, list, size);
 }
 
-static
 ssize_t filename_listxattr(int dfd, struct filename *filename,
 			   unsigned int lookup_flags,
 			   char __user *list, size_t size)
@@ -1036,7 +1034,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);
 
@@ -1049,8 +1047,8 @@ static int file_removexattr(struct file *f, struct xattr_name *kname)
 	return error;
 }
 
-static int filename_removexattr(int dfd, struct filename *filename,
-				unsigned int lookup_flags, struct xattr_name *kname)
+int filename_removexattr(int dfd, struct filename *filename,
+			 unsigned int lookup_flags, struct xattr_name *kname)
 {
 	struct path path;
 	int error;
-- 
2.47.3


  reply	other threads:[~2026-07-20  7:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-20  7:22 [PATCH 0/2] io_uring: add removexattr and listxattr support Aditya Prakash Srivastava
2026-07-20  7:22 ` Aditya Prakash Srivastava [this message]
2026-07-20  7:22 ` [PATCH 2/2] " Aditya Prakash Srivastava
2026-07-20 15:25 ` [PATCH 0/2] " Gabriel Krisman Bertazi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260720072213.2719-2-aditya.ansh182@gmail.com \
    --to=aditya.ansh182@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=brauner@kernel.org \
    --cc=io-uring@vger.kernel.org \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox