diff options
author | David Sterba <dsterba@suse.com> | 2015-10-10 11:16:50 -0400 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2015-10-26 22:38:28 -0400 |
commit | 12907fc79818a62a2478f84f7795afa774bf7f9c (patch) | |
tree | c7df6fd783c99feef090a00c38e7268515488430 /fs/btrfs/ctree.h | |
parent | 2849a854224487bc578b73b64422c3cb3ef93ff5 (diff) |
btrfs: extend balance filter limit to take minimum and maximum
The 'limit' filter is underdesigned, it should have been a range for
[min,max], with some relaxed semantics when one of the bounds is
missing. Besides that, using a full u64 for a single value is a waste of
bytes.
Let's fix both by extending the use of the u64 bytes for the [min,max]
range. This can be done in a backward compatible way, the range will be
interpreted only if the appropriate flag is set
(BTRFS_BALANCE_ARGS_LIMIT_RANGE).
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r-- | fs/btrfs/ctree.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 3fa3c3b7bb66..460cd69b405e 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -846,8 +846,18 @@ struct btrfs_disk_balance_args { | |||
846 | /* BTRFS_BALANCE_ARGS_* */ | 846 | /* BTRFS_BALANCE_ARGS_* */ |
847 | __le64 flags; | 847 | __le64 flags; |
848 | 848 | ||
849 | /* BTRFS_BALANCE_ARGS_LIMIT value */ | 849 | /* |
850 | __le64 limit; | 850 | * BTRFS_BALANCE_ARGS_LIMIT with value 'limit' |
851 | * BTRFS_BALANCE_ARGS_LIMIT_RANGE - the extend version can use minimum | ||
852 | * and maximum | ||
853 | */ | ||
854 | union { | ||
855 | __le64 limit; | ||
856 | struct { | ||
857 | __le32 limit_min; | ||
858 | __le32 limit_max; | ||
859 | }; | ||
860 | }; | ||
851 | 861 | ||
852 | __le64 unused[7]; | 862 | __le64 unused[7]; |
853 | } __attribute__ ((__packed__)); | 863 | } __attribute__ ((__packed__)); |