aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ordered-data.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-07-21 10:29:44 -0400
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:04:05 -0400
commit4a09675279674041862d2210635b0cc1f60be28e (patch)
tree19e4736c062f87729dcdc1bd57f4919b3227ec32 /fs/btrfs/ordered-data.c
parente5a2217ef6ff088d08a27208929a6f9c635d672c (diff)
Btrfs: Data ordered fixes
* In btrfs_delete_inode, wait for ordered extents after calling truncate_inode_pages. This is much faster, and more correct * Properly clear our the PageChecked bit everywhere we redirty the page. * Change the writepage fixup handler to lock the page range and check to see if an ordered extent had been inserted since the improperly dirtied page was discovered * Wait for ordered extents outside the transaction. This isn't required for locking rules but does improve transaction latencies * Reduce contention on the alloc_mutex by dropping it while incrementing refs on a node/leaf and while dropping refs on a leaf. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ordered-data.c')
-rw-r--r--fs/btrfs/ordered-data.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/fs/btrfs/ordered-data.c b/fs/btrfs/ordered-data.c
index c2b4a9c4ddb6..0d87795fdd8f 100644
--- a/fs/btrfs/ordered-data.c
+++ b/fs/btrfs/ordered-data.c
@@ -336,7 +336,7 @@ void btrfs_wait_ordered_range(struct inode *inode, u64 start, u64 len)
336 orig_end = start + len - 1; 336 orig_end = start + len - 1;
337 wait_end = orig_end; 337 wait_end = orig_end;
338 } 338 }
339 339again:
340 /* start IO across the range first to instantiate any delalloc 340 /* start IO across the range first to instantiate any delalloc
341 * extents 341 * extents
342 */ 342 */
@@ -369,6 +369,14 @@ void btrfs_wait_ordered_range(struct inode *inode, u64 start, u64 len)
369 break; 369 break;
370 end--; 370 end--;
371 } 371 }
372 if (test_range_bit(&BTRFS_I(inode)->io_tree, start, orig_end,
373 EXTENT_ORDERED | EXTENT_DELALLOC, 0)) {
374 printk("inode %lu still ordered or delalloc after wait "
375 "%llu %llu\n", inode->i_ino,
376 (unsigned long long)start,
377 (unsigned long long)orig_end);
378 goto again;
379 }
372} 380}
373 381
374/* 382/*
@@ -545,7 +553,6 @@ int btrfs_find_ordered_sum(struct inode *inode, u64 offset, u32 *sum)
545 sector_sums = &ordered_sum->sums; 553 sector_sums = &ordered_sum->sums;
546 for (i = 0; i < num_sectors; i++) { 554 for (i = 0; i < num_sectors; i++) {
547 if (sector_sums[i].offset == offset) { 555 if (sector_sums[i].offset == offset) {
548printk("find ordered sum inode %lu offset %Lu\n", inode->i_ino, offset);
549 *sum = sector_sums[i].sum; 556 *sum = sector_sums[i].sum;
550 ret = 0; 557 ret = 0;
551 goto out; 558 goto out;