From 4735d0bb8248a3900f420cb9144e4f7969f0b44d Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Mon, 28 Oct 2013 14:28:43 -0400 Subject: Btrfs-progs: rework open_ctree to take flags, add a new one V2 So I needed to add a flag to not try to read block groups when doing --init-extent-tree since we could hang there, but that meant adding a whole other 0/1 type flag to open_ctree_fs_info. So instead I've converted it all over to using a flags setting and added the flag that I needed. This has been tested with xfstests and make test. Thanks, Signed-off-by: Josef Bacik Signed-off-by: Chris Mason --- btrfs-convert.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'btrfs-convert.c') diff --git a/btrfs-convert.c b/btrfs-convert.c index 26c7b5fd..ae10eed0 100644 --- a/btrfs-convert.c +++ b/btrfs-convert.c @@ -2256,7 +2256,7 @@ static int do_convert(const char *devname, int datacsum, int packing, fprintf(stderr, "unable to update system chunk\n"); goto fail; } - root = open_ctree_fd(fd, devname, super_bytenr, O_RDWR); + root = open_ctree_fd(fd, devname, super_bytenr, OPEN_CTREE_WRITES); if (!root) { fprintf(stderr, "unable to open ctree\n"); goto fail; @@ -2317,7 +2317,7 @@ static int do_convert(const char *devname, int datacsum, int packing, goto fail; } - root = open_ctree_fd(fd, devname, 0, O_RDWR); + root = open_ctree_fd(fd, devname, 0, OPEN_CTREE_WRITES); if (!root) { fprintf(stderr, "unable to open ctree\n"); goto fail; @@ -2418,7 +2418,7 @@ static int do_rollback(const char *devname, int force) fprintf(stderr, "unable to open %s\n", devname); goto fail; } - root = open_ctree_fd(fd, devname, 0, O_RDWR); + root = open_ctree_fd(fd, devname, 0, OPEN_CTREE_WRITES); if (!root) { fprintf(stderr, "unable to open ctree\n"); goto fail; -- cgit v1.2.3