btrfs-progs: dump-tree: print version information earlier
authorDavid Sterba <dsterba@suse.com>
Thu, 10 Mar 2016 14:02:18 +0000 (15:02 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 14 Mar 2016 12:42:47 +0000 (13:42 +0100)
The version information could be useful addition to the dump, print it
before we attempt to open the filesystem.

Signed-off-by: David Sterba <dsterba@suse.com>
cmds-inspect-dump-tree.c

index d55bff5..159888c 100644 (file)
@@ -194,6 +194,8 @@ int cmd_inspect_dump_tree(int argc, char **argv)
                goto out;
        }
 
+       printf("%s\n", PACKAGE_STRING);
+
        info = open_ctree_fs_info(argv[optind], 0, 0, 0, OPEN_CTREE_PARTIAL);
        if (!info) {
                error("unable to open %s", argv[optind]);
@@ -455,7 +457,6 @@ no_node:
        uuidbuf[BTRFS_UUID_UNPARSED_SIZE - 1] = '\0';
        uuid_unparse(info->super_copy->fsid, uuidbuf);
        printf("uuid %s\n", uuidbuf);
-       printf("%s\n", PACKAGE_STRING);
 close_root:
        ret = close_ctree(root);
 out: