Skip to content

Commit b34ba84

Browse files
committed
btrfs-progs: mkfs: print type of subvolume in the listing
Print indicators in the summary if the subvolume is read-write, read-only or default: $ mkfs.btrfs --subvol ro:subvolro --subvol rw:subvolrw --subvol default-ro:defaultro --rootdir /rootdir/path img ... Rootdir from: /rootdir/path Compress: no Subvolume (rw): subvolrw Subvolume (ro): subvolro Subvolume (dro): defaultro ... The path is relative to the rootdir path and may not be a subvolume in the source directory so drop the rootdir as this may be confusing. Signed-off-by: David Sterba <[email protected]>
1 parent 83c3bc4 commit b34ba84

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

mkfs/main.c

+5-2
Original file line numberDiff line numberDiff line change
@@ -2078,8 +2078,11 @@ int BOX_MAIN(mkfs)(int argc, char **argv)
20782078

20792079
/* Print subvolumes now as btrfs_mkfs_fill_dir() deletes the list. */
20802080
list_for_each_entry(rds, &subvols, list) {
2081-
pr_verbose(LOG_DEFAULT, " Subvolume: %s\n",
2082-
rds->full_path);
2081+
pr_verbose(LOG_DEFAULT, " Subvolume (%s%s): %s%s\n",
2082+
rds->is_default ? "d" : "",
2083+
rds->readonly ? "ro" : "rw",
2084+
rds->is_default ? "" : " ",
2085+
rds->dir);
20832086
}
20842087

20852088
ret = btrfs_mkfs_fill_dir(trans, source_dir, root,

0 commit comments

Comments
 (0)