mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-07-01 23:53:16 -04:00
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>
This commit is contained in:
parent
2849a85422
commit
12907fc798
4 changed files with 67 additions and 3 deletions
|
@ -217,7 +217,18 @@ struct btrfs_balance_args {
|
|||
|
||||
__u64 flags;
|
||||
|
||||
__u64 limit; /* limit number of processed chunks */
|
||||
/*
|
||||
* BTRFS_BALANCE_ARGS_LIMIT with value 'limit'
|
||||
* BTRFS_BALANCE_ARGS_LIMIT_RANGE - the extend version can use minimum
|
||||
* and maximum
|
||||
*/
|
||||
union {
|
||||
__u64 limit; /* limit number of processed chunks */
|
||||
struct {
|
||||
__u32 limit_min;
|
||||
__u32 limit_max;
|
||||
};
|
||||
};
|
||||
__u64 unused[7];
|
||||
} __attribute__ ((__packed__));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue