aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/journal.h
diff options
context:
space:
mode:
authorMark Fasheh <mfasheh@suse.com>2009-01-29 21:17:46 -0500
committerMark Fasheh <mfasheh@suse.com>2009-04-03 14:39:16 -0400
commite7c17e43090afe558c40bfb66637744c27bd2aeb (patch)
tree4c164c4ec59eaa7599c91f865a261517454ba45f /fs/ocfs2/journal.h
parent4ed8a6bb083bfcc21f1ed66a474b03c0386e4b34 (diff)
ocfs2: Introduce dir free space list
The only operation which doesn't get faster with directory indexing is insert, which still has to walk the entire unindexed directory portion to find a free block. This patch provides an improvement in directory insert performance by maintaining a singly linked list of directory leaf blocks which have space for additional dirents. 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.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/ocfs2/journal.h b/fs/ocfs2/journal.h
index 5585dde9134..582e27e57f3 100644
--- a/fs/ocfs2/journal.h
+++ b/fs/ocfs2/journal.h
@@ -385,8 +385,8 @@ static inline int ocfs2_remove_extent_credits(struct super_block *sb)
385} 385}
386 386
387/* data block for new dir/symlink, 2 for bitmap updates (bitmap fe + 387/* data block for new dir/symlink, 2 for bitmap updates (bitmap fe +
388 * bitmap block for the new bit) */ 388 * bitmap block for the new bit) dx_root update for free list */
389#define OCFS2_DIR_LINK_ADDITIONAL_CREDITS (1 + 2) 389#define OCFS2_DIR_LINK_ADDITIONAL_CREDITS (1 + 2 + 1)
390 390
391static inline int ocfs2_add_dir_index_credits(struct super_block *sb) 391static inline int ocfs2_add_dir_index_credits(struct super_block *sb)
392{ 392{
@@ -420,19 +420,19 @@ static inline int ocfs2_mknod_credits(struct super_block *sb, int is_dir,
420#define OCFS2_SIMPLE_DIR_EXTEND_CREDITS (2) 420#define OCFS2_SIMPLE_DIR_EXTEND_CREDITS (2)
421 421
422/* file update (nlink, etc) + directory mtime/ctime + dir entry block + quota 422/* file update (nlink, etc) + directory mtime/ctime + dir entry block + quota
423 * update on dir + index leaf */ 423 * update on dir + index leaf + dx root update for free list */
424static inline int ocfs2_link_credits(struct super_block *sb) 424static inline int ocfs2_link_credits(struct super_block *sb)
425{ 425{
426 return 2*OCFS2_INODE_UPDATE_CREDITS + 2 + 426 return 2*OCFS2_INODE_UPDATE_CREDITS + 3 +
427 ocfs2_quota_trans_credits(sb); 427 ocfs2_quota_trans_credits(sb);
428} 428}
429 429
430/* inode + dir inode (if we unlink a dir), + dir entry block + orphan 430/* inode + dir inode (if we unlink a dir), + dir entry block + orphan
431 * dir inode link + dir inode index leaf */ 431 * dir inode link + dir inode index leaf + dir index root */
432static inline int ocfs2_unlink_credits(struct super_block *sb) 432static inline int ocfs2_unlink_credits(struct super_block *sb)
433{ 433{
434 /* The quota update from ocfs2_link_credits is unused here... */ 434 /* The quota update from ocfs2_link_credits is unused here... */
435 return 2 * OCFS2_INODE_UPDATE_CREDITS + 2 + ocfs2_link_credits(sb); 435 return 2 * OCFS2_INODE_UPDATE_CREDITS + 3 + ocfs2_link_credits(sb);
436} 436}
437 437
438/* dinode + orphan dir dinode + inode alloc dinode + orphan dir entry + 438/* dinode + orphan dir dinode + inode alloc dinode + orphan dir entry +