Add -v -q switches to mkfs.btrfs.

Add -v -q switches to mkfs.btrfs, to control the verbosity of mkfs.btrfs.

Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it>
Move group_profile_str() in utils.c

This is a preparation patch.
Move the group_profile_str() function from cmds-filesystem.c to utils.c
to be re-used from other modules (in this case from mkfs.c)

Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it>
Add verbose option to btrfs_add_to_fsid()


Add verbose option to btrfs_add_to_fsid() in order to avoid to print
the information to console when not needed.
The same information is print in the summary of the mkfs.btrfs command.

Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it>
Add strdup in btrfs_add_to_fsid() to track the device path.

When creating a new btrfs_device, copy the path to track it.
This path is then used by mkfs.btrfs to list all devices.

Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it>
Return the fsid from make_btrfs()

The function make_btrfs() has as argument the fsid of the filesystem.
If this fsid is empty or null make_btrfs() generates a new fsid. However
If the buffer is valid (but the string is empty) the generated fsid is
copied back to the caller.

Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it>
Track the size of the chunk created

Track the size of the chunk during the filesystem creation. These information
are printed in a next patch.

Signed-off-by: Goffredo Baroncelli
Print the summary

This patch print the summary of the filesystem after the creation.
The main fileds printed are:
- devices list with their uuid, devid, path and size
- raid profile (dup,single,raid0...)
- leafsize/nodesize/sectorsize
- filesystem features (raid56, extref, mixed-bg)

If the '-v' switched is passed, the output is more verbose; if the '-q'
switched is passed, only the errors are printed.


Below an example:

#mkfs.btrfs -L btrfs-test -f -M -m raid5 -d raid5 /dev/vd[b-k]"
BTRFS filesystem summary:
  Label:		btrfs-test
  UUID:			14ae8a88-98ac-4f22-8441-79f76ec622f7

  Node size:		4096
  Leaf size:		4096
  Sector size:		4096
  Initial chunks:
    Data+Metadata:	9.01GiB
    System:		18.06MiB
  Metadata profile:	RAID5
  Data profile:		RAID5
  Mixed mode:		YES
  SSD detected:		NO
  Incompat features:	mixed-bg, extref, raid56
  Number of devices:	10
    UUID                                  ID    SIZE    PATH
    ------------------------------------  --  --------- -----------
    df1c7f50-1980-4da2-8bc9-7ee6ffb0b554   1   50.00GiB /dev/vdb
    32c808a0-cd7b-4497-a2c0-1d77a9854af9   2   50.00GiB /dev/vdc
    3159782e-d108-40bc-9e15-090ecac160b4   3   50.00GiB /dev/vdd
    db7eaf0c-beb8-4093-a9d0-b9c25c146305   4   50.00GiB /dev/vde
    c367ca04-1f71-49c0-a331-11fc0b87e9fc   5   50.00GiB /dev/vdf
    e9b73c86-4058-4b3a-90ac-18741a276e70   6   50.00GiB /dev/vdg
    c4298b7a-ad41-4690-bf10-bf748b319413   7   50.00GiB /dev/vdh
    1cf048c8-af8a-4225-b09a-5d12e9b217fa   8    2.00GiB /dev/vdi
    7e157869-768a-4725-bad5-82e6bd05fd17   9    2.00GiB /dev/vdj
    2c9431ac-c7f0-45a5-8529-cef8cf6e4033  10    2.00GiB /dev/vdk

  Total devices size:                         356.01GiB


Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it>
Add -v and -q switches in the mkfs.btrfs man page

Add -v and -q switches to the mkfs.btrfs man page. These information
will be printed by a next patch in the summary.

Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it>