diff options
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 549271607c17..5aebddd71193 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -799,7 +799,7 @@ struct extent_buffer *read_tree_block(struct btrfs_root *root, u64 bytenr, | |||
799 | ret = btree_read_extent_buffer_pages(root, buf, 0, parent_transid); | 799 | ret = btree_read_extent_buffer_pages(root, buf, 0, parent_transid); |
800 | 800 | ||
801 | if (ret == 0) | 801 | if (ret == 0) |
802 | buf->flags |= EXTENT_UPTODATE; | 802 | set_bit(EXTENT_BUFFER_UPTODATE, &buf->bflags); |
803 | else | 803 | else |
804 | WARN_ON(1); | 804 | WARN_ON(1); |
805 | return buf; | 805 | return buf; |
@@ -813,6 +813,10 @@ int clean_tree_block(struct btrfs_trans_handle *trans, struct btrfs_root *root, | |||
813 | if (btrfs_header_generation(buf) == | 813 | if (btrfs_header_generation(buf) == |
814 | root->fs_info->running_transaction->transid) { | 814 | root->fs_info->running_transaction->transid) { |
815 | WARN_ON(!btrfs_tree_locked(buf)); | 815 | WARN_ON(!btrfs_tree_locked(buf)); |
816 | |||
817 | /* ugh, clear_extent_buffer_dirty can be expensive */ | ||
818 | btrfs_set_lock_blocking(buf); | ||
819 | |||
816 | clear_extent_buffer_dirty(&BTRFS_I(btree_inode)->io_tree, | 820 | clear_extent_buffer_dirty(&BTRFS_I(btree_inode)->io_tree, |
817 | buf); | 821 | buf); |
818 | } | 822 | } |
@@ -2311,6 +2315,8 @@ void btrfs_mark_buffer_dirty(struct extent_buffer *buf) | |||
2311 | u64 transid = btrfs_header_generation(buf); | 2315 | u64 transid = btrfs_header_generation(buf); |
2312 | struct inode *btree_inode = root->fs_info->btree_inode; | 2316 | struct inode *btree_inode = root->fs_info->btree_inode; |
2313 | 2317 | ||
2318 | btrfs_set_lock_blocking(buf); | ||
2319 | |||
2314 | WARN_ON(!btrfs_tree_locked(buf)); | 2320 | WARN_ON(!btrfs_tree_locked(buf)); |
2315 | if (transid != root->fs_info->generation) { | 2321 | if (transid != root->fs_info->generation) { |
2316 | printk(KERN_CRIT "btrfs transid mismatch buffer %llu, " | 2322 | printk(KERN_CRIT "btrfs transid mismatch buffer %llu, " |
@@ -2353,7 +2359,7 @@ int btrfs_read_buffer(struct extent_buffer *buf, u64 parent_transid) | |||
2353 | int ret; | 2359 | int ret; |
2354 | ret = btree_read_extent_buffer_pages(root, buf, 0, parent_transid); | 2360 | ret = btree_read_extent_buffer_pages(root, buf, 0, parent_transid); |
2355 | if (ret == 0) | 2361 | if (ret == 0) |
2356 | buf->flags |= EXTENT_UPTODATE; | 2362 | set_bit(EXTENT_BUFFER_UPTODATE, &buf->bflags); |
2357 | return ret; | 2363 | return ret; |
2358 | } | 2364 | } |
2359 | 2365 | ||