chunks will ever be allocated from this device
- type = 3 - allocate only data chunks from this ID, no meta data
chunks will ever be allocated from this device
+ - 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
If unsure, say N.
case BTRFS_DEV_ALLOCATION_PREFERRED_METADATA:
case BTRFS_DEV_ALLOCATION_METADATA_ONLY:
case BTRFS_DEV_ALLOCATION_DATA_ONLY:
+ case BTRFS_DEV_ALLOCATION_PREFERRED_NONE:
return true;
default:
return false;
[BTRFS_DEV_ALLOCATION_PREFERRED_DATA] = 0,
[BTRFS_DEV_ALLOCATION_PREFERRED_METADATA] = 1,
[BTRFS_DEV_ALLOCATION_METADATA_ONLY] = 2,
+ [BTRFS_DEV_ALLOCATION_PREFERRED_NONE] = 99,
/* the other values are set to 0 */
};
#endif /* CONFIG_BTRFS_ALLOCATOR_HINTS */
* sort also by hint (metadata hint
* higher priority)
*/
- devices_info[ndevs].alloc_hint = alloc_hint_map[hint];
+ if (BTRFS_DEV_ALLOCATION_PREFERRED_NONE == hint)
+ devices_info[ndevs].alloc_hint = -alloc_hint_map[hint];
+ else
+ devices_info[ndevs].alloc_hint = alloc_hint_map[hint];
}
#endif /* CONFIG_BTRFS_ALLOCATOR_HINTS */
#define BTRFS_DEV_ALLOCATION_METADATA_ONLY (2ULL)
/* only data chunk allowed */
#define BTRFS_DEV_ALLOCATION_DATA_ONLY (3ULL)
+/* avoid chunk allocation if possible */
+#define BTRFS_DEV_ALLOCATION_PREFERRED_NONE (4ULL)
/* 5..7 are unused values */
#endif /* CONFIG_BTRFS_ALLOCATOR_HINTS */