diff options
author | Tao Ma <tao.ma@oracle.com> | 2008-08-18 05:38:50 -0400 |
---|---|---|
committer | Mark Fasheh <mfasheh@suse.com> | 2008-10-13 19:57:03 -0400 |
commit | 0c044f0b24b9128ba8c297149d88bd81f2e36af3 (patch) | |
tree | 2a0d6a34fca5e5a8bdfde0d1068cb56d4252e864 /fs/ocfs2/xattr.h | |
parent | ba492615f0d32d0210b02c14b24512b4372b13d6 (diff) |
ocfs2: Add xattr bucket iteration for large numbers of EAs
Ocfs2 breaks up xattr index tree leaves into 4k regions, called buckets.
Attributes are stored within a given bucket, depending on hash value.
After a discussion with Mark, we decided that the per-bucket index
(xe_entry[]) would only exist in the 1st block of a bucket. Likewise,
name/value pairs will not straddle more than one block. This allows the
majority of operations to work directly on the buffer heads in a leaf block.
This patch adds code to iterate the buckets in an EA. A new abstration of
ocfs2_xattr_bucket is added. It records the bhs in this bucket and
ocfs2_xattr_header. This keeps the code neat, improving readibility.
Signed-off-by: Tao Ma <tao.ma@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs/ocfs2/xattr.h')
-rw-r--r-- | fs/ocfs2/xattr.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/ocfs2/xattr.h b/fs/ocfs2/xattr.h index ed32377be9db..02afa87d5e69 100644 --- a/fs/ocfs2/xattr.h +++ b/fs/ocfs2/xattr.h | |||
@@ -48,4 +48,13 @@ extern int ocfs2_xattr_set(struct inode *, int, const char *, const void *, | |||
48 | extern int ocfs2_xattr_remove(struct inode *inode, struct buffer_head *di_bh); | 48 | extern int ocfs2_xattr_remove(struct inode *inode, struct buffer_head *di_bh); |
49 | extern struct xattr_handler *ocfs2_xattr_handlers[]; | 49 | extern struct xattr_handler *ocfs2_xattr_handlers[]; |
50 | 50 | ||
51 | static inline u16 ocfs2_xattr_buckets_per_cluster(struct ocfs2_super *osb) | ||
52 | { | ||
53 | return (1 << osb->s_clustersize_bits) / OCFS2_XATTR_BUCKET_SIZE; | ||
54 | } | ||
55 | |||
56 | static inline u16 ocfs2_blocks_per_xattr_bucket(struct super_block *sb) | ||
57 | { | ||
58 | return OCFS2_XATTR_BUCKET_SIZE / (1 << sb->s_blocksize_bits); | ||
59 | } | ||
51 | #endif /* OCFS2_XATTR_H */ | 60 | #endif /* OCFS2_XATTR_H */ |