diff options
author | Chris Mason <chris.mason@oracle.com> | 2008-04-22 14:06:31 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@hera.kernel.org> | 2008-04-22 14:06:31 -0400 |
commit | 358564890ac230ccc8af2661268a6bcb0d6ea18f (patch) | |
tree | aea7067c1cc525b4c443fcb52920f1a34b08a935 /mkfs.c | |
parent | b569dafbf2acfb99f8c0546ad28cb61f860f30db (diff) |
Add a command to show all of the btrfs filesystems on the box (btrfs-show)
Diffstat (limited to 'mkfs.c')
-rw-r--r-- | mkfs.c | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -296,6 +296,7 @@ int main(int ac, char **av) struct btrfs_root *root; struct btrfs_trans_handle *trans; char *label = NULL; + char *first_file; u64 block_count = 0; u64 dev_block_count = 0; u64 blocks[6]; @@ -375,6 +376,7 @@ int main(int ac, char **av) exit(1); } first_fd = fd; + first_file = file; ret = btrfs_prepare_device(fd, file, zero_end, &dev_block_count); if (block_count == 0) block_count = dev_block_count; @@ -394,12 +396,6 @@ int main(int ac, char **av) fprintf(stderr, "failed to setup the root directory\n"); exit(1); } - printf("fs created label %s on %s\n\tnodesize %u leafsize %u " - "sectorsize %u bytes %llu\n", - label, file, nodesize, leafsize, sectorsize, - (unsigned long long)block_count); - - free(label); root = open_ctree(file, 0); trans = btrfs_start_transaction(root, 1); @@ -452,9 +448,17 @@ int main(int ac, char **av) raid_groups: ret = create_raid_groups(trans, root, data_profile, metadata_profile); + + printf("fs created label %s on %s\n\tnodesize %u leafsize %u " + "sectorsize %u size %s\n", + label, first_file, nodesize, leafsize, sectorsize, + pretty_sizes(btrfs_super_total_bytes(&root->fs_info->super_copy))); + btrfs_commit_transaction(trans, root); ret = close_ctree(root); BUG_ON(ret); + + free(label); return 0; } |