diff options
author | Mark Fasheh <mfasheh@suse.com> | 2009-01-29 21:17:46 -0500 |
---|---|---|
committer | Mark Fasheh <mfasheh@suse.com> | 2009-04-03 14:39:16 -0400 |
commit | e7c17e43090afe558c40bfb66637744c27bd2aeb (patch) | |
tree | 4c164c4ec59eaa7599c91f865a261517454ba45f /fs/ocfs2/dir.h | |
parent | 4ed8a6bb083bfcc21f1ed66a474b03c0386e4b34 (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/dir.h')
-rw-r--r-- | fs/ocfs2/dir.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/ocfs2/dir.h b/fs/ocfs2/dir.h index 07b0416cdd42..e683f3deb645 100644 --- a/fs/ocfs2/dir.h +++ b/fs/ocfs2/dir.h | |||
@@ -39,11 +39,19 @@ struct ocfs2_dir_lookup_result { | |||
39 | 39 | ||
40 | struct buffer_head *dl_dx_root_bh; /* Root of indexed | 40 | struct buffer_head *dl_dx_root_bh; /* Root of indexed |
41 | * tree */ | 41 | * tree */ |
42 | |||
42 | struct buffer_head *dl_dx_leaf_bh; /* Indexed leaf block */ | 43 | struct buffer_head *dl_dx_leaf_bh; /* Indexed leaf block */ |
43 | struct ocfs2_dx_entry *dl_dx_entry; /* Target dx_entry in | 44 | struct ocfs2_dx_entry *dl_dx_entry; /* Target dx_entry in |
44 | * indexed leaf */ | 45 | * indexed leaf */ |
45 | struct ocfs2_dx_hinfo dl_hinfo; /* Name hash results */ | 46 | struct ocfs2_dx_hinfo dl_hinfo; /* Name hash results */ |
47 | |||
48 | struct buffer_head *dl_prev_leaf_bh;/* Previous entry in | ||
49 | * dir free space | ||
50 | * list. NULL if | ||
51 | * previous entry is | ||
52 | * dx root block. */ | ||
46 | }; | 53 | }; |
54 | |||
47 | void ocfs2_free_dir_lookup_result(struct ocfs2_dir_lookup_result *res); | 55 | void ocfs2_free_dir_lookup_result(struct ocfs2_dir_lookup_result *res); |
48 | 56 | ||
49 | int ocfs2_find_entry(const char *name, int namelen, | 57 | int ocfs2_find_entry(const char *name, int namelen, |