aboutsummaryrefslogtreecommitdiffstats
path: root/btrfs-find-root.c
diff options
context:
space:
mode:
authorQu Wenruo <quwenruo@cn.fujitsu.com>2015-01-16 14:30:02 +0800
committerDavid Sterba <dsterba@suse.cz>2015-02-11 18:34:05 +0100
commit70701d131a2ec8572b801ede897138f3002fd11c (patch)
tree8888b948ae4195afc3132d9d76f204f5fca6fffe /btrfs-find-root.c
parent68351e41628bdf21dfb81873fba6e8690533313a (diff)
downloadbtrfs-progs-70701d131a2ec8572b801ede897138f3002fd11c.tar.gz
btrfs-progs-70701d131a2ec8572b801ede897138f3002fd11c.tar.xz
btrfs-progs-70701d131a2ec8572b801ede897138f3002fd11c.zip
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>
Diffstat (limited to 'btrfs-find-root.c')
-rw-r--r--btrfs-find-root.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/btrfs-find-root.c b/btrfs-find-root.c
index c6e6b82..cdbcca6 100644
--- a/btrfs-find-root.c
+++ b/btrfs-find-root.c
@@ -278,7 +278,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;
@@ -306,15 +305,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_ROOT_ONLY);
if (!root) {
fprintf(stderr, "Open ctree failed\n");
exit(1);