Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 /*
0003  * linux/fs/hfsplus/xattr_trusted.c
0004  *
0005  * Vyacheslav Dubeyko <slava@dubeyko.com>
0006  *
0007  * Handler for trusted extended attributes.
0008  */
0009 
0010 #include <linux/nls.h>
0011 
0012 #include "hfsplus_fs.h"
0013 #include "xattr.h"
0014 
0015 static int hfsplus_trusted_getxattr(const struct xattr_handler *handler,
0016                     struct dentry *unused, struct inode *inode,
0017                     const char *name, void *buffer, size_t size)
0018 {
0019     return hfsplus_getxattr(inode, name, buffer, size,
0020                 XATTR_TRUSTED_PREFIX,
0021                 XATTR_TRUSTED_PREFIX_LEN);
0022 }
0023 
0024 static int hfsplus_trusted_setxattr(const struct xattr_handler *handler,
0025                     struct user_namespace *mnt_userns,
0026                     struct dentry *unused, struct inode *inode,
0027                     const char *name, const void *buffer,
0028                     size_t size, int flags)
0029 {
0030     return hfsplus_setxattr(inode, name, buffer, size, flags,
0031                 XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN);
0032 }
0033 
0034 const struct xattr_handler hfsplus_xattr_trusted_handler = {
0035     .prefix = XATTR_TRUSTED_PREFIX,
0036     .get    = hfsplus_trusted_getxattr,
0037     .set    = hfsplus_trusted_setxattr,
0038 };