1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

cleanup: indent changes

This commit is contained in:
Zdenek Kabelac 2016-11-23 10:48:33 +01:00
parent ae95937af4
commit 4f39255dca
2 changed files with 13 additions and 19 deletions

View File

@ -3668,12 +3668,10 @@ int lv_add_mirror_lvs(struct logical_volume *lv,
uint32_t num_extra_areas, uint32_t num_extra_areas,
uint64_t status, uint32_t region_size) uint64_t status, uint32_t region_size)
{ {
struct lv_segment *seg;
uint32_t old_area_count, new_area_count;
uint32_t m; uint32_t m;
uint32_t old_area_count, new_area_count;
struct segment_type *mirror_segtype; struct segment_type *mirror_segtype;
struct lv_segment *seg = first_seg(lv);
seg = first_seg(lv);
if (dm_list_size(&lv->segments) != 1 || seg_type(seg, 0) != AREA_LV) { if (dm_list_size(&lv->segments) != 1 || seg_type(seg, 0) != AREA_LV) {
log_error(INTERNAL_ERROR "Mirror layer must be inserted before adding mirrors."); log_error(INTERNAL_ERROR "Mirror layer must be inserted before adding mirrors.");

View File

@ -866,7 +866,7 @@ static int _remove_mirror_images(struct logical_volume *lv,
struct logical_volume *sub_lv; struct logical_volume *sub_lv;
struct logical_volume *detached_log_lv = NULL; struct logical_volume *detached_log_lv = NULL;
struct logical_volume *temp_layer_lv = NULL; struct logical_volume *temp_layer_lv = NULL;
struct lv_segment *pvmove_seg, *mirrored_seg = first_seg(lv); struct lv_segment *seg, *pvmove_seg, *mirrored_seg = first_seg(lv);
uint32_t old_area_count = mirrored_seg->area_count; uint32_t old_area_count = mirrored_seg->area_count;
uint32_t new_area_count = mirrored_seg->area_count; uint32_t new_area_count = mirrored_seg->area_count;
struct lv_list *lvl; struct lv_list *lvl;
@ -1004,7 +1004,7 @@ static int _remove_mirror_images(struct logical_volume *lv,
*/ */
if (detached_log_lv && lv_is_mirrored(detached_log_lv) && if (detached_log_lv && lv_is_mirrored(detached_log_lv) &&
lv_is_partial(detached_log_lv)) { lv_is_partial(detached_log_lv)) {
struct lv_segment *seg = first_seg(detached_log_lv); seg = first_seg(detached_log_lv);
log_very_verbose("%s being removed due to failures.", log_very_verbose("%s being removed due to failures.",
display_lvname(detached_log_lv)); display_lvname(detached_log_lv));
@ -1959,16 +1959,15 @@ int add_mirror_log(struct cmd_context *cmd, struct logical_volume *lv,
if (activation() && segtype->ops->target_present && if (activation() && segtype->ops->target_present &&
!segtype->ops->target_present(cmd, NULL, NULL)) { !segtype->ops->target_present(cmd, NULL, NULL)) {
log_error("%s: Required device-mapper target(s) not " log_error("%s: Required device-mapper target(s) not "
"detected in your kernel", segtype->name); "detected in your kernel.", segtype->name);
return 0; return 0;
} }
/* allocate destination extents */ /* allocate destination extents */
ah = allocate_extents(lv->vg, NULL, segtype, if (!(ah = allocate_extents(lv->vg, NULL, segtype,
0, 0, log_count - old_log_count, region_size, 0, 0, log_count - old_log_count, region_size,
lv->le_count, allocatable_pvs, lv->le_count, allocatable_pvs,
alloc, 0, parallel_areas); alloc, 0, parallel_areas))) {
if (!ah) {
log_error("Unable to allocate extents for mirror log."); log_error("Unable to allocate extents for mirror log.");
return 0; return 0;
} }
@ -2029,10 +2028,9 @@ int add_mirror_images(struct cmd_context *cmd, struct logical_volume *lv,
if (!(segtype = get_segtype_from_string(cmd, SEG_TYPE_NAME_MIRROR))) if (!(segtype = get_segtype_from_string(cmd, SEG_TYPE_NAME_MIRROR)))
return_0; return_0;
ah = allocate_extents(lv->vg, NULL, segtype, if (!(ah = allocate_extents(lv->vg, NULL, segtype,
stripes, mirrors, log_count, region_size, lv->le_count, stripes, mirrors, log_count, region_size, lv->le_count,
allocatable_pvs, alloc, 0, parallel_areas); allocatable_pvs, alloc, 0, parallel_areas))) {
if (!ah) {
log_error("Unable to allocate extents for mirror(s)."); log_error("Unable to allocate extents for mirror(s).");
return 0; return 0;
} }
@ -2165,7 +2163,6 @@ int lv_add_mirrors(struct cmd_context *cmd, struct logical_volume *lv,
int lv_split_mirror_images(struct logical_volume *lv, const char *split_name, int lv_split_mirror_images(struct logical_volume *lv, const char *split_name,
uint32_t split_count, struct dm_list *removable_pvs) uint32_t split_count, struct dm_list *removable_pvs)
{ {
int r;
int historical; int historical;
if (lv_name_is_used_in_vg(lv->vg, split_name, &historical)) { if (lv_name_is_used_in_vg(lv->vg, split_name, &historical)) {
@ -2192,8 +2189,7 @@ int lv_split_mirror_images(struct logical_volume *lv, const char *split_name,
* is being implemented. For now, we force the user to * is being implemented. For now, we force the user to
* come up with a name for their LV. * come up with a name for their LV.
*/ */
r = _split_mirror_images(lv, split_name, split_count, removable_pvs); if (!_split_mirror_images(lv, split_name, split_count, removable_pvs))
if (!r)
return_0; return_0;
return 1; return 1;