Commit afcb8062 authored by Filipe Manana's avatar Filipe Manana Committed by David Sterba

btrfs: remove search_commit parameter from btrfs_lookup_csums_list()

All the callers of btrfs_lookup_csums_list() pass a value of 0 as the
"search_commit" parameter. So remove it and make the function behave as
to always search from the regular root.
Reviewed-by: default avatarQu Wenruo <wqu@suse.com>
Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent d800a906
...@@ -457,15 +457,12 @@ blk_status_t btrfs_lookup_bio_sums(struct btrfs_bio *bbio) ...@@ -457,15 +457,12 @@ blk_status_t btrfs_lookup_bio_sums(struct btrfs_bio *bbio)
* @start: Logical address of target checksum range. * @start: Logical address of target checksum range.
* @end: End offset (inclusive) of the target checksum range. * @end: End offset (inclusive) of the target checksum range.
* @list: List for adding each checksum that was found. * @list: List for adding each checksum that was found.
* @search_commit: Indicate if the commit root of the @root should be used
* for the search.
* @nowait: Indicate if the search must be non-blocking or not. * @nowait: Indicate if the search must be non-blocking or not.
* *
* Return < 0 on error and 0 on success. * Return < 0 on error and 0 on success.
*/ */
int btrfs_lookup_csums_list(struct btrfs_root *root, u64 start, u64 end, int btrfs_lookup_csums_list(struct btrfs_root *root, u64 start, u64 end,
struct list_head *list, int search_commit, struct list_head *list, bool nowait)
bool nowait)
{ {
struct btrfs_fs_info *fs_info = root->fs_info; struct btrfs_fs_info *fs_info = root->fs_info;
struct btrfs_key key; struct btrfs_key key;
...@@ -484,11 +481,6 @@ int btrfs_lookup_csums_list(struct btrfs_root *root, u64 start, u64 end, ...@@ -484,11 +481,6 @@ int btrfs_lookup_csums_list(struct btrfs_root *root, u64 start, u64 end,
return -ENOMEM; return -ENOMEM;
path->nowait = nowait; path->nowait = nowait;
if (search_commit) {
path->skip_locking = 1;
path->reada = READA_FORWARD;
path->search_commit_root = 1;
}
key.objectid = BTRFS_EXTENT_CSUM_OBJECTID; key.objectid = BTRFS_EXTENT_CSUM_OBJECTID;
key.offset = start; key.offset = start;
......
...@@ -68,8 +68,7 @@ int btrfs_lookup_csums_range(struct btrfs_root *root, u64 start, u64 end, ...@@ -68,8 +68,7 @@ int btrfs_lookup_csums_range(struct btrfs_root *root, u64 start, u64 end,
struct list_head *list, int search_commit, struct list_head *list, int search_commit,
bool nowait); bool nowait);
int btrfs_lookup_csums_list(struct btrfs_root *root, u64 start, u64 end, int btrfs_lookup_csums_list(struct btrfs_root *root, u64 start, u64 end,
struct list_head *list, int search_commit, struct list_head *list, bool nowait);
bool nowait);
int btrfs_lookup_csums_bitmap(struct btrfs_root *root, struct btrfs_path *path, int btrfs_lookup_csums_bitmap(struct btrfs_root *root, struct btrfs_path *path,
u64 start, u64 end, u8 *csum_buf, u64 start, u64 end, u8 *csum_buf,
unsigned long *csum_bitmap); unsigned long *csum_bitmap);
......
...@@ -1745,7 +1745,7 @@ static noinline int csum_exist_in_range(struct btrfs_fs_info *fs_info, ...@@ -1745,7 +1745,7 @@ static noinline int csum_exist_in_range(struct btrfs_fs_info *fs_info,
LIST_HEAD(list); LIST_HEAD(list);
ret = btrfs_lookup_csums_list(csum_root, bytenr, bytenr + num_bytes - 1, ret = btrfs_lookup_csums_list(csum_root, bytenr, bytenr + num_bytes - 1,
&list, 0, nowait); &list, nowait);
if (ret == 0 && list_empty(&list)) if (ret == 0 && list_empty(&list))
return 0; return 0;
......
...@@ -4446,7 +4446,7 @@ int btrfs_reloc_clone_csums(struct btrfs_ordered_extent *ordered) ...@@ -4446,7 +4446,7 @@ int btrfs_reloc_clone_csums(struct btrfs_ordered_extent *ordered)
ret = btrfs_lookup_csums_list(csum_root, disk_bytenr, ret = btrfs_lookup_csums_list(csum_root, disk_bytenr,
disk_bytenr + ordered->num_bytes - 1, disk_bytenr + ordered->num_bytes - 1,
&list, 0, false); &list, false);
if (ret) if (ret)
return ret; return ret;
......
...@@ -797,7 +797,7 @@ static noinline int replay_one_extent(struct btrfs_trans_handle *trans, ...@@ -797,7 +797,7 @@ static noinline int replay_one_extent(struct btrfs_trans_handle *trans,
ret = btrfs_lookup_csums_list(root->log_root, ret = btrfs_lookup_csums_list(root->log_root,
csum_start, csum_end - 1, csum_start, csum_end - 1,
&ordered_sums, 0, false); &ordered_sums, false);
if (ret) if (ret)
goto out; goto out;
/* /*
...@@ -4460,7 +4460,7 @@ static noinline int copy_items(struct btrfs_trans_handle *trans, ...@@ -4460,7 +4460,7 @@ static noinline int copy_items(struct btrfs_trans_handle *trans,
disk_bytenr += extent_offset; disk_bytenr += extent_offset;
ret = btrfs_lookup_csums_list(csum_root, disk_bytenr, ret = btrfs_lookup_csums_list(csum_root, disk_bytenr,
disk_bytenr + extent_num_bytes - 1, disk_bytenr + extent_num_bytes - 1,
&ordered_sums, 0, false); &ordered_sums, false);
if (ret) if (ret)
goto out; goto out;
...@@ -4655,7 +4655,7 @@ static int log_extent_csums(struct btrfs_trans_handle *trans, ...@@ -4655,7 +4655,7 @@ static int log_extent_csums(struct btrfs_trans_handle *trans,
csum_root = btrfs_csum_root(trans->fs_info, em->block_start); csum_root = btrfs_csum_root(trans->fs_info, em->block_start);
ret = btrfs_lookup_csums_list(csum_root, em->block_start + csum_offset, ret = btrfs_lookup_csums_list(csum_root, em->block_start + csum_offset,
em->block_start + csum_offset + em->block_start + csum_offset +
csum_len - 1, &ordered_sums, 0, false); csum_len - 1, &ordered_sums, false);
if (ret) if (ret)
return ret; return 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