diff options
author | Nikolay Borisov <nborisov@suse.com> | 2020-06-03 08:55:20 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2020-07-27 12:55:32 +0200 |
commit | 8ba96f3dd6a0b2dac1a3c48ece76885aa5e40e66 (patch) | |
tree | f3f501a4c5e7a693aa06fc2a08653a7e4de2fc60 /fs | |
parent | c553f94df4d1c5f37ec253b0ff40a2362af03fc1 (diff) | |
download | linux-8ba96f3dd6a0b2dac1a3c48ece76885aa5e40e66.tar.bz2 |
btrfs: make fallback_to_cow take btrfs_inode
It really wants btrfs_inode and is prepration to converting
run_delalloc_nocow to taking btrfs_inode.
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/inode.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index f3b711e39dbe..329b5ad7fe59 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -1370,15 +1370,15 @@ static noinline int csum_exist_in_range(struct btrfs_fs_info *fs_info, return 1; } -static int fallback_to_cow(struct inode *inode, struct page *locked_page, +static int fallback_to_cow(struct btrfs_inode *inode, struct page *locked_page, const u64 start, const u64 end, int *page_started, unsigned long *nr_written) { - const bool is_space_ino = btrfs_is_free_space_inode(BTRFS_I(inode)); - const bool is_reloc_ino = (BTRFS_I(inode)->root->root_key.objectid == + const bool is_space_ino = btrfs_is_free_space_inode(inode); + const bool is_reloc_ino = (inode->root->root_key.objectid == BTRFS_DATA_RELOC_TREE_OBJECTID); const u64 range_bytes = end + 1 - start; - struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; + struct extent_io_tree *io_tree = &inode->io_tree; u64 range_start = start; u64 count; @@ -1418,7 +1418,7 @@ static int fallback_to_cow(struct inode *inode, struct page *locked_page, EXTENT_NORESERVE, 0); if (count > 0 || is_space_ino || is_reloc_ino) { u64 bytes = count; - struct btrfs_fs_info *fs_info = BTRFS_I(inode)->root->fs_info; + struct btrfs_fs_info *fs_info = inode->root->fs_info; struct btrfs_space_info *sinfo = fs_info->data_sinfo; if (is_space_ino || is_reloc_ino) @@ -1433,8 +1433,8 @@ static int fallback_to_cow(struct inode *inode, struct page *locked_page, 0, 0, NULL); } - return cow_file_range(BTRFS_I(inode), locked_page, start, end, - page_started, nr_written, 1); + return cow_file_range(inode, locked_page, start, end, page_started, + nr_written, 1); } /* @@ -1685,8 +1685,8 @@ out_check: * NOCOW, following one which needs to be COW'ed */ if (cow_start != (u64)-1) { - ret = fallback_to_cow(inode, locked_page, cow_start, - found_key.offset - 1, + ret = fallback_to_cow(BTRFS_I(inode), locked_page, + cow_start, found_key.offset - 1, page_started, nr_written); if (ret) goto error; @@ -1769,8 +1769,8 @@ out_check: if (cow_start != (u64)-1) { cur_offset = end; - ret = fallback_to_cow(inode, locked_page, cow_start, end, - page_started, nr_written); + ret = fallback_to_cow(BTRFS_I(inode), locked_page, cow_start, + end, page_started, nr_written); if (ret) goto error; } |