diff options
author | Christoph Hellwig <hch@lst.de> | 2008-08-28 06:21:17 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:04:07 -0400 |
commit | 95819c05732c511338b43c115ffbcee978c02888 (patch) | |
tree | 4622f326207c53e42e7c9e8e8d14960e17190a30 /fs/btrfs/xattr.h | |
parent | eaa47d8612783807ef9703ebc9bf0d0f0455bf62 (diff) |
Btrfs: optimize btrget/set/removexattr
btrfs actually stores the whole xattr name, including the prefix ondisk,
so using the generic resolver that strips off the prefix is not very
helpful. Instead do the real ondisk xattrs manually and only use the
generic resolver for synthetic xattrs like ACLs.
(Sorry Josef for guiding you towards the wrong direction here intially)
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/xattr.h')
-rw-r--r-- | fs/btrfs/xattr.h | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/fs/btrfs/xattr.h b/fs/btrfs/xattr.h index 825e55bd4960..5b1d08f8e68d 100644 --- a/fs/btrfs/xattr.h +++ b/fs/btrfs/xattr.h | |||
@@ -20,31 +20,20 @@ | |||
20 | #define __XATTR__ | 20 | #define __XATTR__ |
21 | 21 | ||
22 | #include <linux/xattr.h> | 22 | #include <linux/xattr.h> |
23 | #include "ctree.h" | ||
24 | 23 | ||
25 | /* Name indexes */ | ||
26 | enum { | ||
27 | BTRFS_XATTR_INDEX_USER, | ||
28 | BTRFS_XATTR_INDEX_POSIX_ACL_ACCESS, | ||
29 | BTRFS_XATTR_INDEX_POSIX_ACL_DEFAULT, | ||
30 | BTRFS_XATTR_INDEX_TRUSTED, | ||
31 | BTRFS_XATTR_INDEX_SECURITY, | ||
32 | BTRFS_XATTR_INDEX_SYSTEM, | ||
33 | BTRFS_XATTR_INDEX_END, | ||
34 | }; | ||
35 | |||
36 | extern struct xattr_handler btrfs_xattr_user_handler; | ||
37 | extern struct xattr_handler btrfs_xattr_trusted_handler; | ||
38 | extern struct xattr_handler btrfs_xattr_acl_access_handler; | 24 | extern struct xattr_handler btrfs_xattr_acl_access_handler; |
39 | extern struct xattr_handler btrfs_xattr_acl_default_handler; | 25 | extern struct xattr_handler btrfs_xattr_acl_default_handler; |
40 | extern struct xattr_handler btrfs_xattr_security_handler; | ||
41 | extern struct xattr_handler btrfs_xattr_system_handler; | ||
42 | |||
43 | extern struct xattr_handler *btrfs_xattr_handlers[]; | 26 | extern struct xattr_handler *btrfs_xattr_handlers[]; |
44 | 27 | ||
45 | ssize_t btrfs_xattr_get(struct inode *inode, int name_index, const char *name, | 28 | extern ssize_t __btrfs_getxattr(struct inode *inode, const char *name, |
46 | void *buffer, size_t size); | 29 | void *buffer, size_t size); |
47 | int btrfs_xattr_set(struct inode *inode, int name_index, const char *name, | 30 | extern int __btrfs_setxattr(struct inode *inode, const char *name, |
48 | const void *value, size_t size, int flags); | 31 | const void *value, size_t size, int flags); |
32 | |||
33 | extern ssize_t btrfs_getxattr(struct dentry *dentry, const char *name, | ||
34 | void *buffer, size_t size); | ||
35 | extern int btrfs_setxattr(struct dentry *dentry, const char *name, | ||
36 | const void *value, size_t size, int flags); | ||
37 | extern int btrfs_removexattr(struct dentry *dentry, const char *name); | ||
49 | 38 | ||
50 | #endif /* __XATTR__ */ | 39 | #endif /* __XATTR__ */ |