Skip to content

Commit

Permalink
btrfs-progs: mkfs: print in summary if compression is used
Browse files Browse the repository at this point in the history
  $ mkfs.btrfs --compress zlib:9 --rootdir Documentation img
  ...
  Rootdir from:       /path/Documentation
    Compress:         zlib:9
    Shrink:           no
  ...

Signed-off-by: David Sterba <[email protected]>
  • Loading branch information
kdave committed Jan 23, 2025
1 parent 4a5e3fa commit dfee618
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions mkfs/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2051,6 +2051,15 @@ int BOX_MAIN(mkfs)(int argc, char **argv)
goto out;
}

pr_verbose(LOG_DEFAULT, " Compress: %s%s%s\n",
compression == BTRFS_COMPRESS_ZSTD ? "zstd" :
compression == BTRFS_COMPRESS_LZO ? "lzo" :
compression == BTRFS_COMPRESS_ZLIB ? "zlib" : "no",
compression_level > 0 ? ":" : "",
compression_level > 0 ?
pretty_size_mode(compression_level, UNITS_RAW) :
"");

ret = btrfs_mkfs_fill_dir(trans, source_dir, root,
&subvols, compression,
compression_level);
Expand Down

0 comments on commit dfee618

Please sign in to comment.