Skip to content

Commit 04cd01d

Browse files
jeffmahoneykdave
authored andcommitted
btrfs: uapi/linux/btrfs.h migration, move balance flags
The BTRFS_BALANCE_* flags are used by struct btrfs_ioctl_balance_args.flags and btrfs_ioctl_balance_args.{data,meta,sys}.flags in the BTRFS_IOC_BALANCE ioctl. Signed-off-by: Jeff Mahoney <[email protected]> Reviewed-by: Liu Bo <[email protected]> Reviewed-by: Josef Bacik <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 18db9ac commit 04cd01d

File tree

2 files changed

+64
-46
lines changed

2 files changed

+64
-46
lines changed

fs/btrfs/volumes.h

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -357,52 +357,6 @@ struct map_lookup {
357357
#define map_lookup_size(n) (sizeof(struct map_lookup) + \
358358
(sizeof(struct btrfs_bio_stripe) * (n)))
359359

360-
/*
361-
* Restriper's general type filter
362-
*/
363-
#define BTRFS_BALANCE_DATA (1ULL << 0)
364-
#define BTRFS_BALANCE_SYSTEM (1ULL << 1)
365-
#define BTRFS_BALANCE_METADATA (1ULL << 2)
366-
367-
#define BTRFS_BALANCE_TYPE_MASK (BTRFS_BALANCE_DATA | \
368-
BTRFS_BALANCE_SYSTEM | \
369-
BTRFS_BALANCE_METADATA)
370-
371-
#define BTRFS_BALANCE_FORCE (1ULL << 3)
372-
#define BTRFS_BALANCE_RESUME (1ULL << 4)
373-
374-
/*
375-
* Balance filters
376-
*/
377-
#define BTRFS_BALANCE_ARGS_PROFILES (1ULL << 0)
378-
#define BTRFS_BALANCE_ARGS_USAGE (1ULL << 1)
379-
#define BTRFS_BALANCE_ARGS_DEVID (1ULL << 2)
380-
#define BTRFS_BALANCE_ARGS_DRANGE (1ULL << 3)
381-
#define BTRFS_BALANCE_ARGS_VRANGE (1ULL << 4)
382-
#define BTRFS_BALANCE_ARGS_LIMIT (1ULL << 5)
383-
#define BTRFS_BALANCE_ARGS_LIMIT_RANGE (1ULL << 6)
384-
#define BTRFS_BALANCE_ARGS_STRIPES_RANGE (1ULL << 7)
385-
#define BTRFS_BALANCE_ARGS_USAGE_RANGE (1ULL << 10)
386-
387-
#define BTRFS_BALANCE_ARGS_MASK \
388-
(BTRFS_BALANCE_ARGS_PROFILES | \
389-
BTRFS_BALANCE_ARGS_USAGE | \
390-
BTRFS_BALANCE_ARGS_DEVID | \
391-
BTRFS_BALANCE_ARGS_DRANGE | \
392-
BTRFS_BALANCE_ARGS_VRANGE | \
393-
BTRFS_BALANCE_ARGS_LIMIT | \
394-
BTRFS_BALANCE_ARGS_LIMIT_RANGE | \
395-
BTRFS_BALANCE_ARGS_STRIPES_RANGE | \
396-
BTRFS_BALANCE_ARGS_USAGE_RANGE)
397-
398-
/*
399-
* Profile changing flags. When SOFT is set we won't relocate chunk if
400-
* it already has the target profile (even though it may be
401-
* half-filled).
402-
*/
403-
#define BTRFS_BALANCE_ARGS_CONVERT (1ULL << 8)
404-
#define BTRFS_BALANCE_ARGS_SOFT (1ULL << 9)
405-
406360
struct btrfs_balance_args;
407361
struct btrfs_balance_progress;
408362
struct btrfs_balance_control {

include/uapi/linux/btrfs.h

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,70 @@ struct btrfs_balance_progress {
317317
__u64 completed; /* # of chunks relocated so far */
318318
};
319319

320+
/*
321+
* flags definition for balance
322+
*
323+
* Restriper's general type filter
324+
*
325+
* Used by:
326+
* btrfs_ioctl_balance_args.flags
327+
* btrfs_balance_control.flags (internal)
328+
*/
329+
#define BTRFS_BALANCE_DATA (1ULL << 0)
330+
#define BTRFS_BALANCE_SYSTEM (1ULL << 1)
331+
#define BTRFS_BALANCE_METADATA (1ULL << 2)
332+
333+
#define BTRFS_BALANCE_TYPE_MASK (BTRFS_BALANCE_DATA | \
334+
BTRFS_BALANCE_SYSTEM | \
335+
BTRFS_BALANCE_METADATA)
336+
337+
#define BTRFS_BALANCE_FORCE (1ULL << 3)
338+
#define BTRFS_BALANCE_RESUME (1ULL << 4)
339+
340+
/*
341+
* flags definitions for per-type balance args
342+
*
343+
* Balance filters
344+
*
345+
* Used by:
346+
* struct btrfs_balance_args
347+
*/
348+
#define BTRFS_BALANCE_ARGS_PROFILES (1ULL << 0)
349+
#define BTRFS_BALANCE_ARGS_USAGE (1ULL << 1)
350+
#define BTRFS_BALANCE_ARGS_DEVID (1ULL << 2)
351+
#define BTRFS_BALANCE_ARGS_DRANGE (1ULL << 3)
352+
#define BTRFS_BALANCE_ARGS_VRANGE (1ULL << 4)
353+
#define BTRFS_BALANCE_ARGS_LIMIT (1ULL << 5)
354+
#define BTRFS_BALANCE_ARGS_LIMIT_RANGE (1ULL << 6)
355+
#define BTRFS_BALANCE_ARGS_STRIPES_RANGE (1ULL << 7)
356+
#define BTRFS_BALANCE_ARGS_USAGE_RANGE (1ULL << 10)
357+
358+
#define BTRFS_BALANCE_ARGS_MASK \
359+
(BTRFS_BALANCE_ARGS_PROFILES | \
360+
BTRFS_BALANCE_ARGS_USAGE | \
361+
BTRFS_BALANCE_ARGS_DEVID | \
362+
BTRFS_BALANCE_ARGS_DRANGE | \
363+
BTRFS_BALANCE_ARGS_VRANGE | \
364+
BTRFS_BALANCE_ARGS_LIMIT | \
365+
BTRFS_BALANCE_ARGS_LIMIT_RANGE | \
366+
BTRFS_BALANCE_ARGS_STRIPES_RANGE | \
367+
BTRFS_BALANCE_ARGS_USAGE_RANGE)
368+
369+
/*
370+
* Profile changing flags. When SOFT is set we won't relocate chunk if
371+
* it already has the target profile (even though it may be
372+
* half-filled).
373+
*/
374+
#define BTRFS_BALANCE_ARGS_CONVERT (1ULL << 8)
375+
#define BTRFS_BALANCE_ARGS_SOFT (1ULL << 9)
376+
377+
378+
/*
379+
* flags definition for balance state
380+
*
381+
* Used by:
382+
* struct btrfs_ioctl_balance_args.state
383+
*/
320384
#define BTRFS_BALANCE_STATE_RUNNING (1ULL << 0)
321385
#define BTRFS_BALANCE_STATE_PAUSE_REQ (1ULL << 1)
322386
#define BTRFS_BALANCE_STATE_CANCEL_REQ (1ULL << 2)

0 commit comments

Comments
 (0)