@@ -281,7 +281,6 @@ static int find_root(struct btrfs_root *root)
int main(int argc, char **argv)
{
struct btrfs_root *root;
- int dev_fd;
int opt;
int ret;
@@ -309,14 +308,7 @@ int main(int argc, char **argv)
exit(1);
}
- dev_fd = open(argv[optind], O_RDONLY);
- 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);
+ root = open_ctree(argv[optind], 0, OPEN_CTREE_CHUNK_ONLY);
if (!root) {
fprintf(stderr, "Open ctree failed\n");
Since in previous patches, we introduced the new open_ctree flag OPEN_CTREE_CHUNK_ONLY, switch btrfs-find-root to use it instead of the open_ctree_broken(). Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> --- btrfs-find-root.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-)