mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-10 07:50:04 +00:00
btrfs: scrub: remove unused btrfs_path in scrub_simple_mirror()
The @path in scrub_simple_mirror() is no longer utilized after commit e02ee89baa66 ("btrfs: scrub: switch scrub_simple_mirror() to scrub_stripe infrastructure"). Before that commit, we call find_first_extent_item() directly, which needs a path and that path can be reused. But after that switch commit, the extent search is done inside queue_scrub_stripe(), which will no longer accept a path from outside. So the @path variable can be safely removed. Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> [ remove the stale comment ] Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
7b365a2a3d
commit
17353a3447
@ -1957,16 +1957,12 @@ static int scrub_simple_mirror(struct scrub_ctx *sctx,
|
|||||||
{
|
{
|
||||||
struct btrfs_fs_info *fs_info = sctx->fs_info;
|
struct btrfs_fs_info *fs_info = sctx->fs_info;
|
||||||
const u64 logical_end = logical_start + logical_length;
|
const u64 logical_end = logical_start + logical_length;
|
||||||
/* An artificial limit, inherit from old scrub behavior */
|
|
||||||
struct btrfs_path path = { 0 };
|
|
||||||
u64 cur_logical = logical_start;
|
u64 cur_logical = logical_start;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/* The range must be inside the bg */
|
/* The range must be inside the bg */
|
||||||
ASSERT(logical_start >= bg->start && logical_end <= bg->start + bg->length);
|
ASSERT(logical_start >= bg->start && logical_end <= bg->start + bg->length);
|
||||||
|
|
||||||
path.search_commit_root = 1;
|
|
||||||
path.skip_locking = 1;
|
|
||||||
/* Go through each extent items inside the logical range */
|
/* Go through each extent items inside the logical range */
|
||||||
while (cur_logical < logical_end) {
|
while (cur_logical < logical_end) {
|
||||||
u64 cur_physical = physical + cur_logical - logical_start;
|
u64 cur_physical = physical + cur_logical - logical_start;
|
||||||
@ -2010,7 +2006,6 @@ static int scrub_simple_mirror(struct scrub_ctx *sctx,
|
|||||||
/* Don't hold CPU for too long time */
|
/* Don't hold CPU for too long time */
|
||||||
cond_resched();
|
cond_resched();
|
||||||
}
|
}
|
||||||
btrfs_release_path(&path);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user