btrfs: extend balance filter usage to take minimum and maximum

Similar to the 'limit' filter, we can enhance the 'usage' filter to
accept a range. The change is backward compatible, the range is applied
only in connection with the BTRFS_BALANCE_ARGS_USAGE_RANGE flag.

We don't have a usecase yet, the current syntax has been sufficient. The
enhancement should provide parity with other range-like filters.

Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Chris Mason <clm@fb.com>
This commit is contained in:
David Sterba 2015-10-20 18:22:13 +02:00 committed by Chris Mason
parent dee32d0ac3
commit bc3094673f
4 changed files with 60 additions and 4 deletions

View file

@ -206,7 +206,13 @@ struct btrfs_ioctl_feature_flags {
*/
struct btrfs_balance_args {
__u64 profiles;
__u64 usage;
union {
__le64 usage;
struct {
__le32 usage_min;
__le32 usage_max;
};
};
__u64 devid;
__u64 pstart;
__u64 pend;