summaryrefslogtreecommitdiffstats
path: root/fs/ceph/super.c
diff options
context:
space:
mode:
authorAlex Elder <elder@dreamhost.com>2012-01-23 15:49:28 -0600
committerAlex Elder <elder@dreamhost.com>2012-03-22 10:47:46 -0500
commit3ce6cd1233046eb97d6d2bd5d80c1cd40528ea2f (patch)
tree43025c030db1741222b96156931b6aa2c8b85e51 /fs/ceph/super.c
parentaa4066ed7ba60421423c35f66b789bb3dd21d89e (diff)
downloadlinux-3ce6cd1233046eb97d6d2bd5d80c1cd40528ea2f.tar.bz2
ceph: avoid repeatedly computing the size of constant vxattr names
All names defined in the directory and file virtual extended attribute tables are constant, and the size of each is known at compile time. So there's no need to compute their length every time any file's attribute is listed. Record the length of each string and use it when needed to determine the space need to represent them. In addition, compute the aggregate size of strings in each table just once at initialization time. Signed-off-by: Alex Elder <elder@dreamhost.com> Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/super.c')
-rw-r--r--fs/ceph/super.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/ceph/super.c b/fs/ceph/super.c
index 00de2c9568cd..c3da3b32bdde 100644
--- a/fs/ceph/super.c
+++ b/fs/ceph/super.c
@@ -927,6 +927,7 @@ static int __init init_ceph(void)
if (ret)
goto out;
+ ceph_xattr_init();
ret = register_filesystem(&ceph_fs_type);
if (ret)
goto out_icache;
@@ -936,6 +937,7 @@ static int __init init_ceph(void)
return 0;
out_icache:
+ ceph_xattr_exit();
destroy_caches();
out:
return ret;
@@ -945,6 +947,7 @@ static void __exit exit_ceph(void)
{
dout("exit_ceph\n");
unregister_filesystem(&ceph_fs_type);
+ ceph_xattr_exit();
destroy_caches();
}