btrfs-progs: image: remove the dead stat() call in metadump
In restore_metadump(), we call stat() but never use the result. This call site is left by some code refactoring, as the stat() call is now moved into fixup_device_size(). We can safely remove the call. Reviewed-by: Su Yue <l@damenly.su> Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
64c024bf1a
commit
67c9f3cce7
|
@ -2692,7 +2692,6 @@ static int restore_metadump(const char *input, FILE *out, int old_restore,
|
||||||
if (!ret && !multi_devices && !old_restore &&
|
if (!ret && !multi_devices && !old_restore &&
|
||||||
btrfs_super_num_devices(mdrestore.original_super) != 1) {
|
btrfs_super_num_devices(mdrestore.original_super) != 1) {
|
||||||
struct btrfs_root *root;
|
struct btrfs_root *root;
|
||||||
struct stat st;
|
|
||||||
|
|
||||||
root = open_ctree_fd(fileno(out), target, 0,
|
root = open_ctree_fd(fileno(out), target, 0,
|
||||||
OPEN_CTREE_PARTIAL |
|
OPEN_CTREE_PARTIAL |
|
||||||
|
@ -2705,13 +2704,6 @@ static int restore_metadump(const char *input, FILE *out, int old_restore,
|
||||||
}
|
}
|
||||||
info = root->fs_info;
|
info = root->fs_info;
|
||||||
|
|
||||||
if (stat(target, &st)) {
|
|
||||||
error("stat %s failed: %m", target);
|
|
||||||
close_ctree(info->chunk_root);
|
|
||||||
free(cluster);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = fixup_chunks_and_devices(info, &mdrestore, fileno(out));
|
ret = fixup_chunks_and_devices(info, &mdrestore, fileno(out));
|
||||||
close_ctree(info->chunk_root);
|
close_ctree(info->chunk_root);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
|
Loading…
Reference in New Issue