btrfs-progs: Switch btrfs-find-root to use the new open_ctree flags

Since in previous patches, we introduced the new open_ctree flag
OPEN_CTREE_CHUNK_ROOT_ONLY, switch btrfs-find-root to use it instead of
the open_ctree_broken().

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
This commit is contained in:
Qu Wenruo 2015-01-16 14:30:02 +08:00 committed by David Sterba
parent 68351e4162
commit 70701d131a
1 changed files with 1 additions and 10 deletions

View File

@ -278,7 +278,6 @@ static int find_root(struct btrfs_root *root)
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
struct btrfs_root *root; struct btrfs_root *root;
int dev_fd;
int opt; int opt;
int ret; int ret;
@ -306,15 +305,7 @@ int main(int argc, char **argv)
exit(1); exit(1);
} }
dev_fd = open(argv[optind], O_RDONLY); root = open_ctree(argv[optind], 0, OPEN_CTREE_CHUNK_ROOT_ONLY);
if (dev_fd < 0) {
fprintf(stderr, "Failed to open device %s\n", argv[optind]);
exit(1);
}
root = open_ctree_broken(dev_fd, argv[optind]);
close(dev_fd);
if (!root) { if (!root) {
fprintf(stderr, "Open ctree failed\n"); fprintf(stderr, "Open ctree failed\n");
exit(1); exit(1);