Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux...
[linux/fpc-iii.git] / fs / ext2 / xattr_trusted.c
blob2c94d1930626269e0e4c2155ae924cd8b30e9e41
1 /*
2 * linux/fs/ext2/xattr_trusted.c
3 * Handler for trusted extended attributes.
5 * Copyright (C) 2003 by Andreas Gruenbacher, <a.gruenbacher@computer.org>
6 */
8 #include "ext2.h"
9 #include "xattr.h"
11 static bool
12 ext2_xattr_trusted_list(struct dentry *dentry)
14 return capable(CAP_SYS_ADMIN);
17 static int
18 ext2_xattr_trusted_get(const struct xattr_handler *handler,
19 struct dentry *dentry, const char *name,
20 void *buffer, size_t size)
22 return ext2_xattr_get(d_inode(dentry), EXT2_XATTR_INDEX_TRUSTED, name,
23 buffer, size);
26 static int
27 ext2_xattr_trusted_set(const struct xattr_handler *handler,
28 struct dentry *dentry, const char *name,
29 const void *value, size_t size, int flags)
31 return ext2_xattr_set(d_inode(dentry), EXT2_XATTR_INDEX_TRUSTED, name,
32 value, size, flags);
35 const struct xattr_handler ext2_xattr_trusted_handler = {
36 .prefix = XATTR_TRUSTED_PREFIX,
37 .list = ext2_xattr_trusted_list,
38 .get = ext2_xattr_trusted_get,
39 .set = ext2_xattr_trusted_set,