summaryrefslogtreecommitdiff
path: root/btrfs-image.c
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@fusionio.com>2013-10-28 14:28:43 -0400
committerChris Mason <chris.mason@fusionio.com>2013-11-07 16:10:40 -0500
commit4735d0bb8248a3900f420cb9144e4f7969f0b44d (patch)
treefebecdd28a64d93816e63a1bf36d6864a732dcd8 /btrfs-image.c
parent337f86fea1d06e189f3cf234adba2567a07678bd (diff)
downloadbtrfs-progs-4735d0bb8248a3900f420cb9144e4f7969f0b44d.tar.gz
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 <jbacik@fusionio.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'btrfs-image.c')
-rw-r--r--btrfs-image.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/btrfs-image.c b/btrfs-image.c
index 40ed483..7bcfc06 100644
--- a/btrfs-image.c
+++ b/btrfs-image.c
@@ -2267,7 +2267,10 @@ static int __restore_metadump(const char *input, FILE *out, int old_restore,
/* NOTE: open with write mode */
if (fixup_offset) {
BUG_ON(!target);
- info = open_ctree_fs_info_restore(target, 0, 0, 1, 1);
+ info = open_ctree_fs_info(target, 0, 0,
+ OPEN_CTREE_WRITES |
+ OPEN_CTREE_RESTORE |
+ OPEN_CTREE_PARTIAL);
if (!info) {
fprintf(stderr, "%s: open ctree failed\n", __func__);
ret = -EIO;
@@ -2555,7 +2558,9 @@ int main(int argc, char *argv[])
u64 total_devs;
int i;
- info = open_ctree_fs_info_restore(target, 0, 0, 0, 1);
+ info = open_ctree_fs_info(target, 0, 0,
+ OPEN_CTREE_PARTIAL |
+ OPEN_CTREE_RESTORE);
if (!info) {
int e = errno;
fprintf(stderr, "unable to open %s error = %s\n",