btrfs-progs: Introduce get_unit_mode_from_arg for common use
authorZhao Lei <zhaolei@cn.fujitsu.com>
Mon, 31 Aug 2015 11:03:41 +0000 (19:03 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 31 Aug 2015 17:25:14 +0000 (19:25 +0200)
commit656731013a626c859da0e1b80c31514ed4255f9c
treee419c36fb611bed8f62bb77802f36ecfb5904e4d
parentf7ad593ca0561c799c2c3cb25f4ecc1c99913440
btrfs-progs: Introduce get_unit_mode_from_arg for common use

We are using separate code for parsing unit mode in current code,
better to use common function.

This patch introduces a common function to specify units as arguments
and a common help message, to make every tool in btrfs having same unit
argument.

The benefits are:
1: Unify current tool's arguments for unit
2: Make tools in future easy to implement such argument
3: Changes (enhancement) in common function have effect on all
   relative tools

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
utils.c
utils.h