diff options
Diffstat (limited to 'fs/btrfs/file-item.c')
| -rw-r--r-- | fs/btrfs/file-item.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c index b910694f61ed..c7fb3a4247d3 100644 --- a/fs/btrfs/file-item.c +++ b/fs/btrfs/file-item.c | |||
| @@ -91,8 +91,7 @@ struct btrfs_csum_item *btrfs_lookup_csum(struct btrfs_trans_handle *trans, | |||
| 91 | struct btrfs_csum_item *item; | 91 | struct btrfs_csum_item *item; |
| 92 | struct extent_buffer *leaf; | 92 | struct extent_buffer *leaf; |
| 93 | u64 csum_offset = 0; | 93 | u64 csum_offset = 0; |
| 94 | u16 csum_size = | 94 | u16 csum_size = btrfs_super_csum_size(root->fs_info->super_copy); |
| 95 | btrfs_super_csum_size(&root->fs_info->super_copy); | ||
| 96 | int csums_in_item; | 95 | int csums_in_item; |
| 97 | 96 | ||
| 98 | file_key.objectid = BTRFS_EXTENT_CSUM_OBJECTID; | 97 | file_key.objectid = BTRFS_EXTENT_CSUM_OBJECTID; |
| @@ -162,8 +161,7 @@ static int __btrfs_lookup_bio_sums(struct btrfs_root *root, | |||
| 162 | u64 item_last_offset = 0; | 161 | u64 item_last_offset = 0; |
| 163 | u64 disk_bytenr; | 162 | u64 disk_bytenr; |
| 164 | u32 diff; | 163 | u32 diff; |
| 165 | u16 csum_size = | 164 | u16 csum_size = btrfs_super_csum_size(root->fs_info->super_copy); |
| 166 | btrfs_super_csum_size(&root->fs_info->super_copy); | ||
| 167 | int ret; | 165 | int ret; |
| 168 | struct btrfs_path *path; | 166 | struct btrfs_path *path; |
| 169 | struct btrfs_csum_item *item = NULL; | 167 | struct btrfs_csum_item *item = NULL; |
| @@ -183,8 +181,10 @@ static int __btrfs_lookup_bio_sums(struct btrfs_root *root, | |||
| 183 | * read from the commit root and sidestep a nasty deadlock | 181 | * read from the commit root and sidestep a nasty deadlock |
| 184 | * between reading the free space cache and updating the csum tree. | 182 | * between reading the free space cache and updating the csum tree. |
| 185 | */ | 183 | */ |
| 186 | if (btrfs_is_free_space_inode(root, inode)) | 184 | if (btrfs_is_free_space_inode(root, inode)) { |
| 187 | path->search_commit_root = 1; | 185 | path->search_commit_root = 1; |
| 186 | path->skip_locking = 1; | ||
| 187 | } | ||
| 188 | 188 | ||
| 189 | disk_bytenr = (u64)bio->bi_sector << 9; | 189 | disk_bytenr = (u64)bio->bi_sector << 9; |
| 190 | if (dio) | 190 | if (dio) |
| @@ -288,7 +288,7 @@ int btrfs_lookup_csums_range(struct btrfs_root *root, u64 start, u64 end, | |||
| 288 | int ret; | 288 | int ret; |
| 289 | size_t size; | 289 | size_t size; |
| 290 | u64 csum_end; | 290 | u64 csum_end; |
| 291 | u16 csum_size = btrfs_super_csum_size(&root->fs_info->super_copy); | 291 | u16 csum_size = btrfs_super_csum_size(root->fs_info->super_copy); |
| 292 | 292 | ||
| 293 | path = btrfs_alloc_path(); | 293 | path = btrfs_alloc_path(); |
| 294 | if (!path) | 294 | if (!path) |
| @@ -490,8 +490,7 @@ static noinline int truncate_one_csum(struct btrfs_trans_handle *trans, | |||
| 490 | u64 bytenr, u64 len) | 490 | u64 bytenr, u64 len) |
| 491 | { | 491 | { |
| 492 | struct extent_buffer *leaf; | 492 | struct extent_buffer *leaf; |
| 493 | u16 csum_size = | 493 | u16 csum_size = btrfs_super_csum_size(root->fs_info->super_copy); |
| 494 | btrfs_super_csum_size(&root->fs_info->super_copy); | ||
| 495 | u64 csum_end; | 494 | u64 csum_end; |
| 496 | u64 end_byte = bytenr + len; | 495 | u64 end_byte = bytenr + len; |
| 497 | u32 blocksize_bits = root->fs_info->sb->s_blocksize_bits; | 496 | u32 blocksize_bits = root->fs_info->sb->s_blocksize_bits; |
| @@ -547,8 +546,7 @@ int btrfs_del_csums(struct btrfs_trans_handle *trans, | |||
| 547 | u64 csum_end; | 546 | u64 csum_end; |
| 548 | struct extent_buffer *leaf; | 547 | struct extent_buffer *leaf; |
| 549 | int ret; | 548 | int ret; |
| 550 | u16 csum_size = | 549 | u16 csum_size = btrfs_super_csum_size(root->fs_info->super_copy); |
| 551 | btrfs_super_csum_size(&root->fs_info->super_copy); | ||
| 552 | int blocksize_bits = root->fs_info->sb->s_blocksize_bits; | 550 | int blocksize_bits = root->fs_info->sb->s_blocksize_bits; |
| 553 | 551 | ||
| 554 | root = root->fs_info->csum_root; | 552 | root = root->fs_info->csum_root; |
| @@ -674,8 +672,7 @@ int btrfs_csum_file_blocks(struct btrfs_trans_handle *trans, | |||
| 674 | struct btrfs_sector_sum *sector_sum; | 672 | struct btrfs_sector_sum *sector_sum; |
| 675 | u32 nritems; | 673 | u32 nritems; |
| 676 | u32 ins_size; | 674 | u32 ins_size; |
| 677 | u16 csum_size = | 675 | u16 csum_size = btrfs_super_csum_size(root->fs_info->super_copy); |
| 678 | btrfs_super_csum_size(&root->fs_info->super_copy); | ||
| 679 | 676 | ||
| 680 | path = btrfs_alloc_path(); | 677 | path = btrfs_alloc_path(); |
| 681 | if (!path) | 678 | if (!path) |
