summaryrefslogtreecommitdiff
path: root/lib/raid
diff options
context:
space:
mode:
authorHeinz Mauelshagen <heinzm@redhat.com>2017-02-28 22:34:00 +0100
committerHeinz Mauelshagen <heinzm@redhat.com>2017-02-28 22:34:00 +0100
commit80a6de616a19e1be2e4125878ee904e5a1eeedf9 (patch)
tree0276eec057577ce487cc609d19ec5554cceafd75 /lib/raid
parent21456dcf7fc062518202f133ad27594eda4278fb (diff)
downloadlvm2-80a6de616a19e1be2e4125878ee904e5a1eeedf9.tar.gz
lvconvert: libdm RAID API compatibility versioning
Commit 27384c52cf6a lowered the maximum number of devices back to 64 for compatibility. Because more members have been added to the API in 'struct dm_tree_node_raid_params *', we have to version the public libdm RAID API to not break any existing users. Changes: - keep the previous 'struct dm_tree_node_raid_params' and dm_tree_node_add_raid_target_with_params()/dm_tree_node_add_raid_target() in order to expose the already released public RAID API - introduce 'struct dm_tree_node_raid_params_v2' and additional functions dm_tree_node_add_raid_target_with_params_v2()/dm_tree_node_add_raid_target_v2() to be used by the new lvm2 lib reshape extentions With this new API, the bitfields for rebuild/writemostly legs in 'struct dm_tree_node_raid_params_v2' can be raised to 256 bits again (253 legs maximum supported in MD kernel). Mind that we can limit the maximum usable number via the DEFAULT_RAID{1}_MAX_IMAGES definition in defaults.h. Related: rhbz834579 Related: rhbz1191935 Related: rhbz1191978
Diffstat (limited to 'lib/raid')
-rw-r--r--lib/raid/raid.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/raid/raid.c b/lib/raid/raid.c
index 59db43793..9ab2e6c6f 100644
--- a/lib/raid/raid.c
+++ b/lib/raid/raid.c
@@ -242,7 +242,7 @@ static int _raid_add_target_line(struct dev_manager *dm __attribute__((unused)),
uint64_t flags = 0;
uint64_t rebuilds[RAID_BITMAP_SIZE];
uint64_t writemostly[RAID_BITMAP_SIZE];
- struct dm_tree_node_raid_params params;
+ struct dm_tree_node_raid_params_v2 params;
memset(&params, 0, sizeof(params));
memset(&rebuilds, 0, sizeof(rebuilds));
@@ -333,7 +333,7 @@ static int _raid_add_target_line(struct dev_manager *dm __attribute__((unused)),
params.stripe_size = seg->stripe_size;
params.flags = flags;
- if (!dm_tree_node_add_raid_target_with_params(node, len, &params))
+ if (!dm_tree_node_add_raid_target_with_params_v2(node, len, &params))
return_0;
return add_areas_line(dm, seg, node, 0u, seg->area_count);