xattr_user.c 927 字节
Newer Older
1 2 3 4 5 6 7 8
/*
 * linux/fs/hfsplus/xattr_user.c
 *
 * Vyacheslav Dubeyko <slava@dubeyko.com>
 *
 * Handler for user extended attributes.
 */

9 10
#include <linux/nls.h>

11 12 13
#include "hfsplus_fs.h"
#include "xattr.h"

14
static int hfsplus_user_getxattr(const struct xattr_handler *handler,
15 16
				 struct dentry *unused, struct inode *inode,
				 const char *name, void *buffer, size_t size)
17 18
{

19
	return hfsplus_getxattr(inode, name, buffer, size,
20
				XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN);
21 22
}

23
static int hfsplus_user_setxattr(const struct xattr_handler *handler,
24 25 26
				 struct dentry *unused, struct inode *inode,
				 const char *name, const void *buffer,
				 size_t size, int flags)
27
{
28
	return hfsplus_setxattr(inode, name, buffer, size, flags,
29
				XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN);
30 31 32 33 34 35 36
}

const struct xattr_handler hfsplus_xattr_user_handler = {
	.prefix	= XATTR_USER_PREFIX,
	.get	= hfsplus_user_getxattr,
	.set	= hfsplus_user_setxattr,
};