mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
libdm: const raid params and error for unsupported type
Accept const struct with raid params (No API change). Also add extra error message when raid type is unsupported.
This commit is contained in:
parent
1ea8afd3ca
commit
d582be43d4
@ -1,5 +1,6 @@
|
||||
Version 1.02.112 -
|
||||
=====================================
|
||||
Show error message when trying to create unsupported raid type.
|
||||
Improve preloading sequence of an active thin-pool target.
|
||||
Drop extra space from cache target line to fix unneded table reloads.
|
||||
|
||||
|
@ -1441,7 +1441,7 @@ struct dm_tree_node_raid_params {
|
||||
|
||||
int dm_tree_node_add_raid_target_with_params(struct dm_tree_node *node,
|
||||
uint64_t size,
|
||||
struct dm_tree_node_raid_params *p);
|
||||
const struct dm_tree_node_raid_params *p);
|
||||
|
||||
/* Cache feature_flags */
|
||||
#define DM_CACHE_FEATURE_WRITEBACK 0x00000001
|
||||
|
@ -3207,7 +3207,7 @@ int dm_tree_node_add_mirror_target(struct dm_tree_node *node,
|
||||
|
||||
int dm_tree_node_add_raid_target_with_params(struct dm_tree_node *node,
|
||||
uint64_t size,
|
||||
struct dm_tree_node_raid_params *p)
|
||||
const struct dm_tree_node_raid_params *p)
|
||||
{
|
||||
unsigned i;
|
||||
struct load_segment *seg = NULL;
|
||||
@ -3217,8 +3217,10 @@ int dm_tree_node_add_raid_target_with_params(struct dm_tree_node *node,
|
||||
if (!(seg = _add_segment(node,
|
||||
_dm_segtypes[i].type, size)))
|
||||
return_0;
|
||||
if (!seg)
|
||||
return_0;
|
||||
if (!seg) {
|
||||
log_error("Unsupported raid type %s.", p->raid_type);
|
||||
return 0;
|
||||
}
|
||||
|
||||
seg->region_size = p->region_size;
|
||||
seg->stripe_size = p->stripe_size;
|
||||
|
Loading…
Reference in New Issue
Block a user