- type = 4 - allocate any chunks from this device last, will never
allocate any space from this device unless there isn't
enough space on other devices
+ - type = 5 - never allocate any new non-mixed chunks, useful when
+ putting a device out of use and to avoid redundant chunk
+ writes during balance/replace
If unsure, say N.
case BTRFS_DEV_ALLOCATION_METADATA_ONLY:
case BTRFS_DEV_ALLOCATION_DATA_ONLY:
case BTRFS_DEV_ALLOCATION_PREFERRED_NONE:
+ case BTRFS_DEV_ALLOCATION_NONE_ONLY:
return true;
default:
return false;
BTRFS_DEV_ALLOCATION_MASK_BIT_COUNT)
static const int alloc_hint_map[BTRFS_DEV_ALLOCATION_MASK_COUNT] = {
+ [BTRFS_DEV_ALLOCATION_NONE_ONLY] = -99,
[BTRFS_DEV_ALLOCATION_DATA_ONLY] = -1,
[BTRFS_DEV_ALLOCATION_PREFERRED_DATA] = 0,
[BTRFS_DEV_ALLOCATION_PREFERRED_METADATA] = 1,
*/
if (BTRFS_DEV_ALLOCATION_METADATA_ONLY == hint)
continue;
+ /*
+ * skip BTRFS_DEV_NONE_ONLY disks
+ */
+ if (BTRFS_DEV_ALLOCATION_NONE_ONLY == hint)
+ continue;
/*
* if a data chunk must be allocated,
* sort also by hint (data disk
*/
if (BTRFS_DEV_ALLOCATION_DATA_ONLY == hint)
continue;
+ /*
+ * skip BTRFS_DEV_NONE_ONLY disks
+ */
+ if (BTRFS_DEV_ALLOCATION_NONE_ONLY == hint)
+ continue;
/*
* if a metadata chunk must be allocated,
* sort also by hint (metadata hint
#define BTRFS_DEV_ALLOCATION_DATA_ONLY (3ULL)
/* avoid chunk allocation if possible */
#define BTRFS_DEV_ALLOCATION_PREFERRED_NONE (4ULL)
-/* 5..7 are unused values */
+/* deny chunk allocation */
+#define BTRFS_DEV_ALLOCATION_NONE_ONLY (5ULL)
+/* 6..7 are unused values */
#endif /* CONFIG_BTRFS_ALLOCATOR_HINTS */