aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent_io.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/extent_io.c')
-rw-r--r--fs/btrfs/extent_io.c20
1 files changed, 0 insertions, 20 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 7380449cb5b..9965993748d 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -97,7 +97,6 @@ void extent_io_tree_init(struct extent_io_tree *tree,
97 spin_lock_init(&tree->lock); 97 spin_lock_init(&tree->lock);
98 spin_lock_init(&tree->buffer_lock); 98 spin_lock_init(&tree->buffer_lock);
99 tree->mapping = mapping; 99 tree->mapping = mapping;
100 tree->last = NULL;
101} 100}
102EXPORT_SYMBOL(extent_io_tree_init); 101EXPORT_SYMBOL(extent_io_tree_init);
103 102
@@ -173,12 +172,6 @@ static struct rb_node *__etree_search(struct extent_io_tree *tree, u64 offset,
173 struct tree_entry *entry; 172 struct tree_entry *entry;
174 struct tree_entry *prev_entry = NULL; 173 struct tree_entry *prev_entry = NULL;
175 174
176 if (tree->last) {
177 struct extent_state *state;
178 state = tree->last;
179 if (state->start <= offset && offset <= state->end)
180 return &tree->last->rb_node;
181 }
182 while(n) { 175 while(n) {
183 entry = rb_entry(n, struct tree_entry, rb_node); 176 entry = rb_entry(n, struct tree_entry, rb_node);
184 prev = n; 177 prev = n;
@@ -189,7 +182,6 @@ static struct rb_node *__etree_search(struct extent_io_tree *tree, u64 offset,
189 else if (offset > entry->end) 182 else if (offset > entry->end)
190 n = n->rb_right; 183 n = n->rb_right;
191 else { 184 else {
192 tree->last = rb_entry(n, struct extent_state, rb_node);
193 return n; 185 return n;
194 } 186 }
195 } 187 }
@@ -223,10 +215,6 @@ static inline struct rb_node *tree_search(struct extent_io_tree *tree,
223 215
224 ret = __etree_search(tree, offset, &prev, NULL); 216 ret = __etree_search(tree, offset, &prev, NULL);
225 if (!ret) { 217 if (!ret) {
226 if (prev) {
227 tree->last = rb_entry(prev, struct extent_state,
228 rb_node);
229 }
230 return prev; 218 return prev;
231 } 219 }
232 return ret; 220 return ret;
@@ -301,8 +289,6 @@ static int merge_state(struct extent_io_tree *tree,
301 other->state == state->state) { 289 other->state == state->state) {
302 state->start = other->start; 290 state->start = other->start;
303 other->tree = NULL; 291 other->tree = NULL;
304 if (tree->last == other)
305 tree->last = state;
306 rb_erase(&other->rb_node, &tree->state); 292 rb_erase(&other->rb_node, &tree->state);
307 free_extent_state(other); 293 free_extent_state(other);
308 } 294 }
@@ -314,8 +300,6 @@ static int merge_state(struct extent_io_tree *tree,
314 other->state == state->state) { 300 other->state == state->state) {
315 other->start = state->start; 301 other->start = state->start;
316 state->tree = NULL; 302 state->tree = NULL;
317 if (tree->last == state)
318 tree->last = other;
319 rb_erase(&state->rb_node, &tree->state); 303 rb_erase(&state->rb_node, &tree->state);
320 free_extent_state(state); 304 free_extent_state(state);
321 } 305 }
@@ -378,7 +362,6 @@ static int insert_state(struct extent_io_tree *tree,
378 return -EEXIST; 362 return -EEXIST;
379 } 363 }
380 state->tree = tree; 364 state->tree = tree;
381 tree->last = state;
382 merge_state(tree, state); 365 merge_state(tree, state);
383 return 0; 366 return 0;
384} 367}
@@ -444,9 +427,6 @@ static int clear_state_bit(struct extent_io_tree *tree,
444 if (delete || state->state == 0) { 427 if (delete || state->state == 0) {
445 if (state->tree) { 428 if (state->tree) {
446 clear_state_cb(tree, state, state->state); 429 clear_state_cb(tree, state, state->state);
447 if (tree->last == state) {
448 tree->last = extent_state_next(state);
449 }
450 rb_erase(&state->rb_node, &tree->state); 430 rb_erase(&state->rb_node, &tree->state);
451 state->tree = NULL; 431 state->tree = NULL;
452 free_extent_state(state); 432 free_extent_state(state);