summaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/journal.h
diff options
context:
space:
mode:
authorMark Fasheh <mfasheh@suse.com>2008-11-25 02:02:08 +0100
committerMark Fasheh <mfasheh@suse.com>2009-04-03 20:39:16 +0200
commit4ed8a6bb083bfcc21f1ed66a474b03c0386e4b34 (patch)
tree89cc2629bed3949e980edcae3d807e71718a9028 /fs/ocfs2/journal.h
parentocfs2: Add a name indexed b-tree to directory inodes (diff)
downloadlinux-4ed8a6bb083bfcc21f1ed66a474b03c0386e4b34.tar.xz
linux-4ed8a6bb083bfcc21f1ed66a474b03c0386e4b34.zip
ocfs2: Store dir index records inline
Allow us to store a small number of directory index records in the ocfs2_dx_root_block. This saves us a disk read on small to medium sized directories (less than about 250 entries). The inline root is automatically turned into a root block with extents if the directory size increases beyond it's capacity. Signed-off-by: Mark Fasheh <mfasheh@suse.com> Acked-by: Joel Becker <joel.becker@oracle.com>
Diffstat (limited to 'fs/ocfs2/journal.h')
-rw-r--r--fs/ocfs2/journal.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/ocfs2/journal.h b/fs/ocfs2/journal.h
index 4939c04290ca..5585dde91344 100644
--- a/fs/ocfs2/journal.h
+++ b/fs/ocfs2/journal.h
@@ -458,6 +458,16 @@ static inline int ocfs2_rename_credits(struct super_block *sb)
#define OCFS2_DX_ROOT_REMOVE_CREDITS (OCFS2_INODE_UPDATE_CREDITS + \
OCFS2_SUBALLOC_FREE)
+static inline int ocfs2_calc_dxi_expand_credits(struct super_block *sb)
+{
+ int credits = 1 + OCFS2_SUBALLOC_ALLOC;
+
+ credits += ocfs2_clusters_to_blocks(sb, 1);
+ credits += ocfs2_quota_trans_credits(sb);
+
+ return credits;
+}
+
/*
* Please note that the caller must make sure that root_el is the root
* of extent tree. So for an inode, it should be &fe->id2.i_list. Otherwise