mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
vdo: flip return value to int
Change API to return just 0/1.
This commit is contained in:
parent
73967233e4
commit
2135bbe558
@ -1376,11 +1376,11 @@ uint32_t get_vdo_pool_max_extents(const struct dm_vdo_target_params *vtp,
|
|||||||
int parse_vdo_pool_status(struct dm_pool *mem, const struct logical_volume *vdo_pool_lv,
|
int parse_vdo_pool_status(struct dm_pool *mem, const struct logical_volume *vdo_pool_lv,
|
||||||
const char *params, const struct dm_info *dminfo,
|
const char *params, const struct dm_info *dminfo,
|
||||||
struct lv_status_vdo *status);
|
struct lv_status_vdo *status);
|
||||||
struct logical_volume *convert_vdo_pool_lv(struct logical_volume *data_lv,
|
int convert_vdo_pool_lv(struct logical_volume *data_lv,
|
||||||
const struct dm_vdo_target_params *vtp,
|
const struct dm_vdo_target_params *vtp,
|
||||||
uint32_t *virtual_extents,
|
uint32_t *virtual_extents,
|
||||||
int format,
|
int format,
|
||||||
uint64_t vdo_pool_header_size);
|
uint64_t vdo_pool_header_size);
|
||||||
int set_vdo_write_policy(enum dm_vdo_write_policy *vwp, const char *policy);
|
int set_vdo_write_policy(enum dm_vdo_write_policy *vwp, const char *policy);
|
||||||
int fill_vdo_target_params(struct cmd_context *cmd,
|
int fill_vdo_target_params(struct cmd_context *cmd,
|
||||||
struct dm_vdo_target_params *vtp,
|
struct dm_vdo_target_params *vtp,
|
||||||
|
@ -357,11 +357,11 @@ static int _format_vdo_pool_data_lv(struct logical_volume *data_lv,
|
|||||||
*
|
*
|
||||||
* Returns: old data LV on success (passed data LV becomes VDO LV), NULL on failure
|
* Returns: old data LV on success (passed data LV becomes VDO LV), NULL on failure
|
||||||
*/
|
*/
|
||||||
struct logical_volume *convert_vdo_pool_lv(struct logical_volume *data_lv,
|
int convert_vdo_pool_lv(struct logical_volume *data_lv,
|
||||||
const struct dm_vdo_target_params *vtp,
|
const struct dm_vdo_target_params *vtp,
|
||||||
uint32_t *virtual_extents,
|
uint32_t *virtual_extents,
|
||||||
int format,
|
int format,
|
||||||
uint64_t vdo_pool_header_size)
|
uint64_t vdo_pool_header_size)
|
||||||
{
|
{
|
||||||
const uint32_t extent_size = data_lv->vg->extent_size;
|
const uint32_t extent_size = data_lv->vg->extent_size;
|
||||||
struct cmd_context *cmd = data_lv->vg->cmd;
|
struct cmd_context *cmd = data_lv->vg->cmd;
|
||||||
@ -372,7 +372,7 @@ struct logical_volume *convert_vdo_pool_lv(struct logical_volume *data_lv,
|
|||||||
uint64_t adjust;
|
uint64_t adjust;
|
||||||
|
|
||||||
if (!(vdo_pool_segtype = get_segtype_from_string(cmd, SEG_TYPE_NAME_VDO_POOL)))
|
if (!(vdo_pool_segtype = get_segtype_from_string(cmd, SEG_TYPE_NAME_VDO_POOL)))
|
||||||
return_NULL;
|
return_0;
|
||||||
|
|
||||||
adjust = (*virtual_extents * (uint64_t) extent_size) % DM_VDO_BLOCK_SIZE;
|
adjust = (*virtual_extents * (uint64_t) extent_size) % DM_VDO_BLOCK_SIZE;
|
||||||
if (adjust) {
|
if (adjust) {
|
||||||
@ -394,7 +394,7 @@ struct logical_volume *convert_vdo_pool_lv(struct logical_volume *data_lv,
|
|||||||
log_verbose("Test mode: Skipping formatting of VDO pool volume.");
|
log_verbose("Test mode: Skipping formatting of VDO pool volume.");
|
||||||
} else if (!_format_vdo_pool_data_lv(data_lv, vtp, &vdo_logical_size)) {
|
} else if (!_format_vdo_pool_data_lv(data_lv, vtp, &vdo_logical_size)) {
|
||||||
log_error("Cannot format VDO pool volume %s.", display_lvname(data_lv));
|
log_error("Cannot format VDO pool volume %s.", display_lvname(data_lv));
|
||||||
return NULL;
|
return 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log_verbose("Skipping VDO formatting %s.", display_lvname(data_lv));
|
log_verbose("Skipping VDO formatting %s.", display_lvname(data_lv));
|
||||||
@ -406,7 +406,7 @@ struct logical_volume *convert_vdo_pool_lv(struct logical_volume *data_lv,
|
|||||||
if (!deactivate_lv(data_lv->vg->cmd, data_lv)) {
|
if (!deactivate_lv(data_lv->vg->cmd, data_lv)) {
|
||||||
log_error("Cannot deactivate formatted VDO pool volume %s.",
|
log_error("Cannot deactivate formatted VDO pool volume %s.",
|
||||||
display_lvname(data_lv));
|
display_lvname(data_lv));
|
||||||
return NULL;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
vdo_logical_size -= 2 * vdo_pool_header_size;
|
vdo_logical_size -= 2 * vdo_pool_header_size;
|
||||||
@ -420,14 +420,14 @@ struct logical_volume *convert_vdo_pool_lv(struct logical_volume *data_lv,
|
|||||||
log_error("Size %s for VDO volume cannot be smaller then extent size %s.",
|
log_error("Size %s for VDO volume cannot be smaller then extent size %s.",
|
||||||
display_size(data_lv->vg->cmd, vdo_logical_size),
|
display_size(data_lv->vg->cmd, vdo_logical_size),
|
||||||
display_size(data_lv->vg->cmd, extent_size));
|
display_size(data_lv->vg->cmd, extent_size));
|
||||||
return NULL;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
*virtual_extents = vdo_logical_size / extent_size;
|
*virtual_extents = vdo_logical_size / extent_size;
|
||||||
|
|
||||||
/* Move segments from existing data_lv into LV_vdata */
|
/* Move segments from existing data_lv into LV_vdata */
|
||||||
if (!(data_lv = insert_layer_for_lv(cmd, vdo_pool_lv, 0, "_vdata")))
|
if (!(data_lv = insert_layer_for_lv(cmd, vdo_pool_lv, 0, "_vdata")))
|
||||||
return_NULL;
|
return_0;
|
||||||
|
|
||||||
vdo_pool_seg = first_seg(vdo_pool_lv);
|
vdo_pool_seg = first_seg(vdo_pool_lv);
|
||||||
vdo_pool_seg->segtype = vdo_pool_segtype;
|
vdo_pool_seg->segtype = vdo_pool_segtype;
|
||||||
@ -438,7 +438,7 @@ struct logical_volume *convert_vdo_pool_lv(struct logical_volume *data_lv,
|
|||||||
vdo_pool_lv->status |= LV_VDO_POOL;
|
vdo_pool_lv->status |= LV_VDO_POOL;
|
||||||
data_lv->status |= LV_VDO_POOL_DATA;
|
data_lv->status |= LV_VDO_POOL_DATA;
|
||||||
|
|
||||||
return data_lv;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int set_vdo_write_policy(enum dm_vdo_write_policy *vwp, const char *policy)
|
int set_vdo_write_policy(enum dm_vdo_write_policy *vwp, const char *policy)
|
||||||
|
Loading…
Reference in New Issue
Block a user