aboutsummaryrefslogtreecommitdiffstats
path: root/net/ceph
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2010-11-16 14:14:34 -0500
committerSage Weil <sage@newdream.net>2011-01-12 18:15:12 -0500
commit6c0f3af72cb1622a66962a1180c36ef8c41be8e2 (patch)
tree66e415bf31ea31a3e9360c0ce624fd20b6050c89 /net/ceph
parent3c0eee3fe6a3a1c745379547c7e7c904aa64f6d5 (diff)
ceph: add dir_layout to inode
Add a ceph_dir_layout to the inode, and calculate dentry hash values based on the parent directory's specified dir_hash function. This is needed because the old default Linux dcache hash function is extremely week and leads to a poor distribution of files among dir fragments. Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'net/ceph')
-rw-r--r--net/ceph/ceph_hash.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/ceph/ceph_hash.c b/net/ceph/ceph_hash.c
index 815ef882679..0a1b53bce76 100644
--- a/net/ceph/ceph_hash.c
+++ b/net/ceph/ceph_hash.c
@@ -1,5 +1,6 @@
1 1
2#include <linux/ceph/types.h> 2#include <linux/ceph/types.h>
3#include <linux/module.h>
3 4
4/* 5/*
5 * Robert Jenkin's hash function. 6 * Robert Jenkin's hash function.
@@ -104,6 +105,7 @@ unsigned ceph_str_hash(int type, const char *s, unsigned len)
104 return -1; 105 return -1;
105 } 106 }
106} 107}
108EXPORT_SYMBOL(ceph_str_hash);
107 109
108const char *ceph_str_hash_name(int type) 110const char *ceph_str_hash_name(int type)
109{ 111{
@@ -116,3 +118,4 @@ const char *ceph_str_hash_name(int type)
116 return "unknown"; 118 return "unknown";
117 } 119 }
118} 120}
121EXPORT_SYMBOL(ceph_str_hash_name);