summaryrefslogtreecommitdiffstats
path: root/fs/internal.h
diff options
context:
space:
mode:
authorStefan Roesch <shr@fb.com>2022-04-25 02:10:46 +0200
committerJens Axboe <axboe@kernel.dk>2022-04-25 02:18:37 +0200
commit1a91794ce8481a293c5ef432feb440aee1455619 (patch)
tree4698eccfa4c568c18ee2d8d94d67cb866015d1ea /fs/internal.h
parentio_uring: return an error when cqe is dropped (diff)
downloadlinux-1a91794ce8481a293c5ef432feb440aee1455619.tar.xz
linux-1a91794ce8481a293c5ef432feb440aee1455619.zip
fs: split off setxattr_copy and do_setxattr function from setxattr
This splits of the setup part of the function setxattr in its own dedicated function called setxattr_copy. In addition it also exposes a new function called do_setxattr for making the setxattr call. This makes it possible to call these two functions from io_uring in the processing of an xattr request. Signed-off-by: Stefan Roesch <shr@fb.com> Acked-by: Christian Brauner <christian.brauner@ubuntu.com> Link: https://lore.kernel.org/r/20220323154420.3301504-2-shr@fb.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/internal.h')
-rw-r--r--fs/internal.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/fs/internal.h b/fs/internal.h
index 08503dc68d2b..5fb219f0d1f6 100644
--- a/fs/internal.h
+++ b/fs/internal.h
@@ -191,3 +191,27 @@ long splice_file_to_pipe(struct file *in,
struct pipe_inode_info *opipe,
loff_t *offset,
size_t len, unsigned int flags);
+
+/*
+ * fs/xattr.c:
+ */
+struct xattr_name {
+ char name[XATTR_NAME_MAX + 1];
+};
+
+struct xattr_ctx {
+ /* Value of attribute */
+ union {
+ const void __user *cvalue;
+ void __user *value;
+ };
+ void *kvalue;
+ size_t size;
+ /* Attribute name */
+ struct xattr_name *kname;
+ unsigned int flags;
+};
+
+int setxattr_copy(const char __user *name, struct xattr_ctx *ctx);
+int do_setxattr(struct user_namespace *mnt_userns, struct dentry *dentry,
+ struct xattr_ctx *ctx);