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