Skip to contentSkip to conversation

btrfs: optmize listxattr

PATCH New Christoph Hellwig 1 participant 1 message Aug 22, 2008 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 btrfs: optmize listxattr

The ->list handler is really not useful at all, because we always call btrfs_xattr_generic_list anyway. After this is done find_btrfs_xattr_handler becomes unused, and it becomes obvious that the temporary name buffer allocation isn't needed but we can directly copy into the supplied buffer.

Tested with various getfattr -d calls on varying xattr lists.

acl.c +0 -2
Index: btrfs-unstable/acl.c
===================================================================
@@ -318,14 +318,12 @@ int btrfs_acl_chmod(struct inode *inode)
 
 struct xattr_handler btrfs_xattr_acl_default_handler = {
 	.prefix = POSIX_ACL_XATTR_DEFAULT,
-	.list	= btrfs_xattr_generic_list,
 	.get	= btrfs_xattr_acl_default_get,
 	.set	= btrfs_xattr_acl_default_set,
 };
 
 struct xattr_handler btrfs_xattr_acl_access_handler = {
 	.prefix = POSIX_ACL_XATTR_ACCESS,
-	.list	= btrfs_xattr_generic_list,
 	.get	= btrfs_xattr_acl_access_get,
 	.set	= btrfs_xattr_acl_access_set,
 };
xattr.c +11 -71

141 lines not on this page · raw message

xattr.h +0 -8
Index: btrfs-unstable/xattr.h
===================================================================
@@ -47,12 +47,4 @@ ssize_t btrfs_xattr_get(struct inode *in
 int btrfs_xattr_set(struct inode *inode, int name_index, const char *name,
 			const void *value, size_t size, int flags);
 
-/*
- * the only reason this is public is for acl.c.  There may be a point where
- * acl.c doesn't need it, and if thats the case we need to remove it and make
- * it static in xattr.c
- */
-size_t btrfs_xattr_generic_list(struct inode *inode, char *list,
-				size_t list_size, const char *name,
-				size_t name_len);
 #endif /* __XATTR__ */