diff mbox series

[1/4] fs: export copy_fsxattr_from_user()

Message ID 20240509151459.3622910-3-aalbersh@redhat.com (mailing list archive)
State New
Headers show
Series Introduce XFS_IOC_SETFSXATTRAT/XFS_IOC_GETFSXATTRAT ioctls | expand

Commit Message

Andrey Albershteyn May 9, 2024, 3:14 p.m. UTC
Export copy_fsxattr_from_user(). This function will be used in
further patch by XFS in XFS_IOC_SETFSXATTRAT ioctl.

Signed-off-by: Andrey Albershteyn <aalbersh@redhat.com>
---
 fs/ioctl.c               | 11 +++++++++--
 include/linux/fileattr.h |  1 +
 2 files changed, 10 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/fs/ioctl.c b/fs/ioctl.c
index 1d5abfdf0f22..2017c928194e 100644
--- a/fs/ioctl.c
+++ b/fs/ioctl.c
@@ -559,8 +559,14 @@  int copy_fsxattr_to_user(const struct fileattr *fa, struct fsxattr __user *ufa)
 }
 EXPORT_SYMBOL(copy_fsxattr_to_user);
 
-static int copy_fsxattr_from_user(struct fileattr *fa,
-				  struct fsxattr __user *ufa)
+/**
+ * copy_fsxattr_from_user - copy fsxattr from userspace.
+ * @fa:		fileattr pointer
+ * @ufa:	fsxattr user pointer
+ *
+ * Return: 0 on success, or -EFAULT on failure.
+ */
+int copy_fsxattr_from_user(struct fileattr *fa, struct fsxattr __user *ufa)
 {
 	struct fsxattr xfa;
 
@@ -575,6 +581,7 @@  static int copy_fsxattr_from_user(struct fileattr *fa,
 
 	return 0;
 }
+EXPORT_SYMBOL(copy_fsxattr_from_user);
 
 /*
  * Generic function to check FS_IOC_FSSETXATTR/FS_IOC_SETFLAGS values and reject
diff --git a/include/linux/fileattr.h b/include/linux/fileattr.h
index 47c05a9851d0..3c4f8c75abc0 100644
--- a/include/linux/fileattr.h
+++ b/include/linux/fileattr.h
@@ -34,6 +34,7 @@  struct fileattr {
 };
 
 int copy_fsxattr_to_user(const struct fileattr *fa, struct fsxattr __user *ufa);
+int copy_fsxattr_from_user(struct fileattr *fa, struct fsxattr __user *ufa)
 
 void fileattr_fill_xflags(struct fileattr *fa, u32 xflags);
 void fileattr_fill_flags(struct fileattr *fa, u32 flags);