@@ -254,6 +254,7 @@ static int device_list_add(const char *path,
fs_devices->latest_devid = devid;
fs_devices->latest_trans = found_transid;
fs_devices->lowest_devid = (u64)-1;
+ fs_devices->chunk_alloc_policy = BTRFS_CHUNK_ALLOC_REGULAR;
device = NULL;
} else {
device = find_device(fs_devices, devid,
@@ -69,6 +69,10 @@ struct btrfs_device {
u8 uuid[BTRFS_UUID_SIZE];
};
+enum btrfs_chunk_allocation_policy {
+ BTRFS_CHUNK_ALLOC_REGULAR,
+};
+
struct btrfs_fs_devices {
u8 fsid[BTRFS_FSID_SIZE]; /* FS specific uuid */
u8 metadata_uuid[BTRFS_FSID_SIZE]; /* FS specific uuid */
@@ -87,6 +91,8 @@ struct btrfs_fs_devices {
int seeding;
struct btrfs_fs_devices *seed;
+
+ enum btrfs_chunk_allocation_policy chunk_alloc_policy;
};
struct btrfs_bio_stripe {
Introduce chunk allocation policy for btrfs. This policy controls how chunks and device extents are allocated from devices. Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com> --- kernel-shared/volumes.c | 1 + kernel-shared/volumes.h | 6 ++++++ 2 files changed, 7 insertions(+)