1 // SPDX-License-Identifier: GPL-2.0 1 // SPDX-License-Identifier: GPL-2.0 2 /* 2 /* 3 * linux/fs/hfsplus/xattr_trusted.c 3 * linux/fs/hfsplus/xattr_trusted.c 4 * 4 * 5 * Vyacheslav Dubeyko <slava@dubeyko.com> 5 * Vyacheslav Dubeyko <slava@dubeyko.com> 6 * 6 * 7 * Handler for trusted extended attributes. 7 * Handler for trusted 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_trusted_getxattr(const stru 15 static int hfsplus_trusted_getxattr(const struct xattr_handler *handler, 16 struct den 16 struct dentry *unused, struct inode *inode, 17 const char 17 const char *name, void *buffer, size_t size) 18 { 18 { 19 return hfsplus_getxattr(inode, name, b 19 return hfsplus_getxattr(inode, name, buffer, size, 20 XATTR_TRUSTED_ 20 XATTR_TRUSTED_PREFIX, 21 XATTR_TRUSTED_ 21 XATTR_TRUSTED_PREFIX_LEN); 22 } 22 } 23 23 24 static int hfsplus_trusted_setxattr(const stru 24 static int hfsplus_trusted_setxattr(const struct xattr_handler *handler, 25 struct mnt << 26 struct den 25 struct dentry *unused, struct inode *inode, 27 const char 26 const char *name, const void *buffer, 28 size_t siz 27 size_t size, int flags) 29 { 28 { 30 return hfsplus_setxattr(inode, name, b 29 return hfsplus_setxattr(inode, name, buffer, size, flags, 31 XATTR_TRUSTED_ 30 XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN); 32 } 31 } 33 32 34 const struct xattr_handler hfsplus_xattr_trust 33 const struct xattr_handler hfsplus_xattr_trusted_handler = { 35 .prefix = XATTR_TRUSTED_PREFIX, 34 .prefix = XATTR_TRUSTED_PREFIX, 36 .get = hfsplus_trusted_getxattr, 35 .get = hfsplus_trusted_getxattr, 37 .set = hfsplus_trusted_setxattr, 36 .set = hfsplus_trusted_setxattr, 38 }; 37 }; 39 38
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.