1 // SPDX-License-Identifier: GPL-2.0 1 // SPDX-License-Identifier: GPL-2.0 2 /* 2 /* 3 * linux/fs/hfsplus/xattr_user.c 3 * linux/fs/hfsplus/xattr_user.c 4 * 4 * 5 * Vyacheslav Dubeyko <slava@dubeyko.com> 5 * Vyacheslav Dubeyko <slava@dubeyko.com> 6 * 6 * 7 * Handler for user extended attributes. 7 * Handler for user extended attributes. 8 */ 8 */ 9 9 10 #include <linux/nls.h> 10 #include <linux/nls.h> 11 11 12 #include "hfsplus_fs.h" 12 #include "hfsplus_fs.h" 13 #include "xattr.h" 13 #include "xattr.h" 14 14 15 static int hfsplus_user_getxattr(const struct 15 static int hfsplus_user_getxattr(const struct xattr_handler *handler, 16 struct dentry 16 struct dentry *unused, struct inode *inode, 17 const char *n 17 const char *name, void *buffer, size_t size) 18 { 18 { 19 19 20 return hfsplus_getxattr(inode, name, b 20 return hfsplus_getxattr(inode, name, buffer, size, 21 XATTR_USER_PRE 21 XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN); 22 } 22 } 23 23 24 static int hfsplus_user_setxattr(const struct 24 static int hfsplus_user_setxattr(const struct xattr_handler *handler, 25 struct mnt_id !! 25 struct user_namespace *mnt_userns, 26 struct dentry 26 struct dentry *unused, struct inode *inode, 27 const char *n 27 const char *name, const void *buffer, 28 size_t size, 28 size_t size, int flags) 29 { 29 { 30 return hfsplus_setxattr(inode, name, b 30 return hfsplus_setxattr(inode, name, buffer, size, flags, 31 XATTR_USER_PRE 31 XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN); 32 } 32 } 33 33 34 const struct xattr_handler hfsplus_xattr_user_ 34 const struct xattr_handler hfsplus_xattr_user_handler = { 35 .prefix = XATTR_USER_PREFIX, 35 .prefix = XATTR_USER_PREFIX, 36 .get = hfsplus_user_getxattr, 36 .get = hfsplus_user_getxattr, 37 .set = hfsplus_user_setxattr, 37 .set = hfsplus_user_setxattr, 38 }; 38 }; 39 39
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.