diff mbox

[v2,05/10] btrfs-progs: Switch btrfs-find-root to use the new open_ctree flags.

Message ID 1421649912-14539-6-git-send-email-quwenruo@cn.fujitsu.com (mailing list archive)
State Accepted
Headers show

Commit Message

Qu Wenruo Jan. 19, 2015, 6:45 a.m. UTC
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(-)
diff mbox

Patch

diff --git a/btrfs-find-root.c b/btrfs-find-root.c
index 6fa61cc..bc2b344 100644
--- a/btrfs-find-root.c
+++ b/btrfs-find-root.c
@@ -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");