Commit 1c8c9c52 authored by Nikolay Borisov's avatar Nikolay Borisov Committed by David Sterba

btrfs: Make check_extent_to_block take btrfs_inode

Signed-off-by: default avatarNikolay Borisov <nborisov@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent a2f392e4
...@@ -4236,7 +4236,7 @@ static void copy_nocow_pages_worker(struct btrfs_work *work) ...@@ -4236,7 +4236,7 @@ static void copy_nocow_pages_worker(struct btrfs_work *work)
scrub_pending_trans_workers_dec(sctx); scrub_pending_trans_workers_dec(sctx);
} }
static int check_extent_to_block(struct inode *inode, u64 start, u64 len, static int check_extent_to_block(struct btrfs_inode *inode, u64 start, u64 len,
u64 logical) u64 logical)
{ {
struct extent_state *cached_state = NULL; struct extent_state *cached_state = NULL;
...@@ -4246,10 +4246,10 @@ static int check_extent_to_block(struct inode *inode, u64 start, u64 len, ...@@ -4246,10 +4246,10 @@ static int check_extent_to_block(struct inode *inode, u64 start, u64 len,
u64 lockstart = start, lockend = start + len - 1; u64 lockstart = start, lockend = start + len - 1;
int ret = 0; int ret = 0;
io_tree = &BTRFS_I(inode)->io_tree; io_tree = &inode->io_tree;
lock_extent_bits(io_tree, lockstart, lockend, &cached_state); lock_extent_bits(io_tree, lockstart, lockend, &cached_state);
ordered = btrfs_lookup_ordered_range(BTRFS_I(inode), lockstart, len); ordered = btrfs_lookup_ordered_range(inode, lockstart, len);
if (ordered) { if (ordered) {
btrfs_put_ordered_extent(ordered); btrfs_put_ordered_extent(ordered);
ret = 1; ret = 1;
...@@ -4325,7 +4325,8 @@ static int copy_nocow_pages_for_inode(u64 inum, u64 offset, u64 root, ...@@ -4325,7 +4325,8 @@ static int copy_nocow_pages_for_inode(u64 inum, u64 offset, u64 root,
io_tree = &BTRFS_I(inode)->io_tree; io_tree = &BTRFS_I(inode)->io_tree;
nocow_ctx_logical = nocow_ctx->logical; nocow_ctx_logical = nocow_ctx->logical;
ret = check_extent_to_block(inode, offset, len, nocow_ctx_logical); ret = check_extent_to_block(BTRFS_I(inode), offset, len,
nocow_ctx_logical);
if (ret) { if (ret) {
ret = ret > 0 ? 0 : ret; ret = ret > 0 ? 0 : ret;
goto out; goto out;
...@@ -4372,7 +4373,7 @@ static int copy_nocow_pages_for_inode(u64 inum, u64 offset, u64 root, ...@@ -4372,7 +4373,7 @@ static int copy_nocow_pages_for_inode(u64 inum, u64 offset, u64 root,
} }
} }
ret = check_extent_to_block(inode, offset, len, ret = check_extent_to_block(BTRFS_I(inode), offset, len,
nocow_ctx_logical); nocow_ctx_logical);
if (ret) { if (ret) {
ret = ret > 0 ? 0 : ret; ret = ret > 0 ? 0 : ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment