diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2008-10-16 10:14:27 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2008-10-16 10:14:27 -0400 |
commit | c894058d66637c7720569fbe12957f4de64d9991 (patch) | |
tree | f13472d7fd76155f1365550515997a24aff611c9 /fs/ext4/mballoc.h | |
parent | c2774d84fd6cab2bfa2a2fae0b1ca8d8ebde48a2 (diff) |
ext4: Use an rbtree for tracking blocks freed during transaction.
With this patch we track the block freed during a transaction using
red-black tree. We also make sure contiguous blocks freed are collected
in one node in the tree.
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/mballoc.h')
-rw-r--r-- | fs/ext4/mballoc.h | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/fs/ext4/mballoc.h b/fs/ext4/mballoc.h index b3b4828f8b89..9e815c4e37df 100644 --- a/fs/ext4/mballoc.h +++ b/fs/ext4/mballoc.h | |||
@@ -98,23 +98,29 @@ | |||
98 | 98 | ||
99 | static struct kmem_cache *ext4_pspace_cachep; | 99 | static struct kmem_cache *ext4_pspace_cachep; |
100 | static struct kmem_cache *ext4_ac_cachep; | 100 | static struct kmem_cache *ext4_ac_cachep; |
101 | static struct kmem_cache *ext4_free_ext_cachep; | ||
101 | 102 | ||
102 | #ifdef EXT4_BB_MAX_BLOCKS | 103 | struct ext4_free_data { |
103 | #undef EXT4_BB_MAX_BLOCKS | 104 | /* this links the free block information from group_info */ |
104 | #endif | 105 | struct rb_node node; |
105 | #define EXT4_BB_MAX_BLOCKS 30 | ||
106 | 106 | ||
107 | struct ext4_free_metadata { | 107 | /* this links the free block information from ext4_sb_info */ |
108 | ext4_group_t group; | ||
109 | unsigned short num; | ||
110 | ext4_grpblk_t blocks[EXT4_BB_MAX_BLOCKS]; | ||
111 | struct list_head list; | 108 | struct list_head list; |
109 | |||
110 | /* group which free block extent belongs */ | ||
111 | ext4_group_t group; | ||
112 | |||
113 | /* free block extent */ | ||
114 | ext4_grpblk_t start_blk; | ||
115 | ext4_grpblk_t count; | ||
116 | |||
117 | /* transaction which freed this extent */ | ||
118 | tid_t t_tid; | ||
112 | }; | 119 | }; |
113 | 120 | ||
114 | struct ext4_group_info { | 121 | struct ext4_group_info { |
115 | unsigned long bb_state; | 122 | unsigned long bb_state; |
116 | unsigned long bb_tid; | 123 | struct rb_root bb_free_root; |
117 | struct ext4_free_metadata *bb_md_cur; | ||
118 | unsigned short bb_first_free; | 124 | unsigned short bb_first_free; |
119 | unsigned short bb_free; | 125 | unsigned short bb_free; |
120 | unsigned short bb_fragments; | 126 | unsigned short bb_fragments; |