aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent_io.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-01-31 11:05:37 -0500
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:04:00 -0400
commitb0c68f8bed058d9f2023b067b16ed06a8c439544 (patch)
tree71c9024152a9f25f6b446c7e33bf25191cefff69 /fs/btrfs/extent_io.c
parent0181e58f91c1edbf835edb7a87d6dfe81374709d (diff)
Btrfs: Enable delalloc accounting
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/extent_io.c')
-rw-r--r--fs/btrfs/extent_io.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 6999b819db62..624aabc3e6f2 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -262,7 +262,7 @@ static void set_state_cb(struct extent_io_tree *tree,
262{ 262{
263 if (tree->ops && tree->ops->set_bit_hook) { 263 if (tree->ops && tree->ops->set_bit_hook) {
264 tree->ops->set_bit_hook(tree->mapping->host, state->start, 264 tree->ops->set_bit_hook(tree->mapping->host, state->start,
265 state->end, bits); 265 state->end, state->state, bits);
266 } 266 }
267} 267}
268 268
@@ -272,7 +272,7 @@ static void clear_state_cb(struct extent_io_tree *tree,
272{ 272{
273 if (tree->ops && tree->ops->set_bit_hook) { 273 if (tree->ops && tree->ops->set_bit_hook) {
274 tree->ops->clear_bit_hook(tree->mapping->host, state->start, 274 tree->ops->clear_bit_hook(tree->mapping->host, state->start,
275 state->end, bits); 275 state->end, state->state, bits);
276 } 276 }
277} 277}
278 278
@@ -298,10 +298,10 @@ static int insert_state(struct extent_io_tree *tree,
298 } 298 }
299 if (bits & EXTENT_DIRTY) 299 if (bits & EXTENT_DIRTY)
300 tree->dirty_bytes += end - start + 1; 300 tree->dirty_bytes += end - start + 1;
301 set_state_cb(tree, state, bits);
301 state->state |= bits; 302 state->state |= bits;
302 state->start = start; 303 state->start = start;
303 state->end = end; 304 state->end = end;
304 set_state_cb(tree, state, bits);
305 node = tree_insert(&tree->state, end, &state->rb_node); 305 node = tree_insert(&tree->state, end, &state->rb_node);
306 if (node) { 306 if (node) {
307 struct extent_state *found; 307 struct extent_state *found;
@@ -369,8 +369,8 @@ static int clear_state_bit(struct extent_io_tree *tree,
369 WARN_ON(range > tree->dirty_bytes); 369 WARN_ON(range > tree->dirty_bytes);
370 tree->dirty_bytes -= range; 370 tree->dirty_bytes -= range;
371 } 371 }
372 state->state &= ~bits;
373 clear_state_cb(tree, state, bits); 372 clear_state_cb(tree, state, bits);
373 state->state &= ~bits;
374 if (wake) 374 if (wake)
375 wake_up(&state->wq); 375 wake_up(&state->wq);
376 if (delete || state->state == 0) { 376 if (delete || state->state == 0) {
@@ -574,8 +574,8 @@ static void set_state_bits(struct extent_io_tree *tree,
574 u64 range = state->end - state->start + 1; 574 u64 range = state->end - state->start + 1;
575 tree->dirty_bytes += range; 575 tree->dirty_bytes += range;
576 } 576 }
577 state->state |= bits;
578 set_state_cb(tree, state, bits); 577 set_state_cb(tree, state, bits);
578 state->state |= bits;
579} 579}
580 580
581/* 581/*
@@ -997,8 +997,8 @@ search_again:
997 free_extent_state(state); 997 free_extent_state(state);
998 goto search_again; 998 goto search_again;
999 } 999 }
1000 state->state |= EXTENT_LOCKED;
1001 set_state_cb(tree, state, EXTENT_LOCKED); 1000 set_state_cb(tree, state, EXTENT_LOCKED);
1001 state->state |= EXTENT_LOCKED;
1002 if (!found) 1002 if (!found)
1003 *start = state->start; 1003 *start = state->start;
1004 found++; 1004 found++;
@@ -1497,8 +1497,8 @@ static int end_bio_extent_readpage(struct bio *bio,
1497 } else { 1497 } else {
1498 state = NULL; 1498 state = NULL;
1499 } 1499 }
1500 clear->state |= EXTENT_UPTODATE;
1501 set_state_cb(tree, clear, EXTENT_UPTODATE); 1500 set_state_cb(tree, clear, EXTENT_UPTODATE);
1501 clear->state |= EXTENT_UPTODATE;
1502 clear_state_bit(tree, clear, EXTENT_LOCKED, 1502 clear_state_bit(tree, clear, EXTENT_LOCKED,
1503 1, 0); 1503 1, 0);
1504 if (cur == start) 1504 if (cur == start)