Linux Audio

Check our new training course

Loading...
v4.6
 
 1/*
 2 * linux/fs/hfsplus/xattr_user.c
 3 *
 4 * Vyacheslav Dubeyko <slava@dubeyko.com>
 5 *
 6 * Handler for user extended attributes.
 7 */
 8
 9#include <linux/nls.h>
10
11#include "hfsplus_fs.h"
12#include "xattr.h"
13
14static int hfsplus_user_getxattr(const struct xattr_handler *handler,
15				 struct dentry *dentry, const char *name,
16				 void *buffer, size_t size)
17{
18
19	return hfsplus_getxattr(dentry, name, buffer, size,
20				XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN);
21}
22
23static int hfsplus_user_setxattr(const struct xattr_handler *handler,
24				 struct dentry *dentry, const char *name,
25				 const void *buffer, size_t size, int flags)
 
 
26{
27	return hfsplus_setxattr(dentry, name, buffer, size, flags,
28				XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN);
29}
30
31const struct xattr_handler hfsplus_xattr_user_handler = {
32	.prefix	= XATTR_USER_PREFIX,
33	.get	= hfsplus_user_getxattr,
34	.set	= hfsplus_user_setxattr,
35};
v6.2
 1// SPDX-License-Identifier: GPL-2.0
 2/*
 3 * linux/fs/hfsplus/xattr_user.c
 4 *
 5 * Vyacheslav Dubeyko <slava@dubeyko.com>
 6 *
 7 * Handler for user extended attributes.
 8 */
 9
10#include <linux/nls.h>
11
12#include "hfsplus_fs.h"
13#include "xattr.h"
14
15static int hfsplus_user_getxattr(const struct xattr_handler *handler,
16				 struct dentry *unused, struct inode *inode,
17				 const char *name, void *buffer, size_t size)
18{
19
20	return hfsplus_getxattr(inode, name, buffer, size,
21				XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN);
22}
23
24static int hfsplus_user_setxattr(const struct xattr_handler *handler,
25				 struct user_namespace *mnt_userns,
26				 struct dentry *unused, struct inode *inode,
27				 const char *name, const void *buffer,
28				 size_t size, int flags)
29{
30	return hfsplus_setxattr(inode, name, buffer, size, flags,
31				XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN);
32}
33
34const struct xattr_handler hfsplus_xattr_user_handler = {
35	.prefix	= XATTR_USER_PREFIX,
36	.get	= hfsplus_user_getxattr,
37	.set	= hfsplus_user_setxattr,
38};