mirror of
https://github.com/kdave/btrfs-progs
synced 2025-02-18 18:56:54 +00:00
btrfs-progs: check: move chunk and extent check mode switch to a helper
Simplify main a bit. Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
b3e08c27e1
commit
3ca3f20071
21
cmds-check.c
21
cmds-check.c
@ -11566,6 +11566,20 @@ out:
|
||||
return err;
|
||||
}
|
||||
|
||||
static int do_check_chunks_and_extents(struct btrfs_fs_info *fs_info)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (!ctx.progress_enabled)
|
||||
fprintf(stderr, "checking extents\n");
|
||||
if (check_mode == CHECK_MODE_LOWMEM)
|
||||
ret = check_chunks_and_extents_v2(fs_info);
|
||||
else
|
||||
ret = check_chunks_and_extents(fs_info);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int btrfs_fsck_reinit_root(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_root *root, int overwrite)
|
||||
{
|
||||
@ -13026,12 +13040,7 @@ int cmd_check(int argc, char **argv)
|
||||
goto close_out;
|
||||
}
|
||||
|
||||
if (!ctx.progress_enabled)
|
||||
fprintf(stderr, "checking extents\n");
|
||||
if (check_mode == CHECK_MODE_LOWMEM)
|
||||
ret = check_chunks_and_extents_v2(info);
|
||||
else
|
||||
ret = check_chunks_and_extents(info);
|
||||
ret = do_check_chunks_and_extents(info);
|
||||
err |= !!ret;
|
||||
if (ret)
|
||||
error(
|
||||
|
Loading…
Reference in New Issue
Block a user