master - cleanup: more lv_is_ usage
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a8f5e1f2744a568779445aa5def423f7e1210ee7 Commit: a8f5e1f2744a568779445aa5def423f7e1210ee7 Parent: 47b96c3537968caf0cfb8ffa3874d64944715bec Author: Zdenek Kabelac <[email protected]> AuthorDate: Tue Dec 13 00:09:15 2016 +0100 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Tue Dec 13 22:07:52 2016 +0100
cleanup: more lv_is_ usage
--- lib/format1/import-export.c | 2 +- lib/format1/import-extents.c | 2 +- lib/format_pool/import_export.c | 2 +- lib/format_text/import_vsn1.c | 2 +- lib/locking/lvmlockd.c | 2 +- lib/metadata/lv.c | 2 +- lib/metadata/lv_manip.c | 7 +++---- lib/metadata/raid_manip.c | 2 +- lib/metadata/snapshot_manip.c | 2 +- tools/toollib.c | 2 +- tools/vgchange.c | 4 ++-- tools/vgconvert.c | 2 +- tools/vgsplit.c | 4 ++-- 13 files changed, 17 insertions(+), 18 deletions(-)
lib/format1/import-export.c +1 -1
@@ -510,7 +510,7 @@ int export_lvs(struct disk_list *dl, struct volume_group *vg,goto_out ; dm_list_iterate_items(ll, &vg->lvs) { -if (ll->lv->status &SNAPSHOT ) +if (lv_is_snapshot (ll->lv))continue ;if (!(lvdl =dm_pool_alloc (dl->mem,sizeof (*lvdl))))
lib/format1/import-extents.c +1 -1
@@ -56,7 +56,7 @@ static struct dm_hash_table *_create_lv_maps(struct dm_pool *mem, } dm_list_iterate_items(ll, &vg->lvs) { -if (ll->lv->status &SNAPSHOT ) +if (lv_is_snapshot (ll->lv))continue ;if (!(lvm =dm_pool_alloc (mem,sizeof (*lvm))))
lib/format_pool/import_export.c +1 -1
@@ -267,7 +267,7 @@ int import_pool_segments(struct dm_list *lvs, struct dm_pool *mem, dm_list_iterate_items(lvl, lvs) { lv = lvl->lv; -if (lv->status &SNAPSHOT ) +if (lv_is_snapshot (lv))continue ;for (i =0 ; i < subpools; i++) {
lib/format_text/import_vsn1.c +1 -1
@@ -512,7 +512,7 @@ static int _read_segments(struct logical_volume *lv, const struct dm_config_node count++; }/* FIXME Remove this restriction */ -if ((lv->status &SNAPSHOT ) && count >1 ) { +if (lv_is_snapshot (lv) && count >1 ) {log_error ("Only one segment permitted for snapshot" );return 0 ; }
lib/locking/lvmlockd.c +1 -1
@@ -2651,7 +2651,7 @@ int lockd_lv_uses_lock(struct logical_volume *lv)if (lv_is_cow (lv))return 0 ; -if (lv->status &SNAPSHOT ) +if (lv_is_snapshot (lv))return 0 ;/* FIXME: lv_is_virtual_origin ? */
lib/metadata/lv.c +1 -1
@@ -971,7 +971,7 @@ int lv_mirror_image_in_sync(const struct logical_volume *lv)struct lv_segment *seg =first_seg (lv);struct lv_segment *mirror_seg; -if (!(lv->status &MIRROR_IMAGE ) || !seg || +if (!lv_is_mirror_image (lv) || !seg || !(mirror_seg =find_mirror_seg (seg))) {log_error (INTERNAL_ERROR "Cannot find mirror segment." );return 0 ;
lib/metadata/lv_manip.c +3 -4
@@ -1139,7 +1139,8 @@ int set_lv_segment_area_lv(struct lv_segment *seg, uint32_t area_num,display_lvname (seg->lv), seg->le, area_num, display_lvname(lv), le); -if (status &RAID_META ) { + lv->status |= status; +if (lv_is_raid_metadata (lv)) { seg->meta_areas[area_num].type =AREA_LV ;seg_metalv (seg, area_num) = lv;if (le) {
@@ -1152,7 +1153,6 @@ int set_lv_segment_area_lv(struct lv_segment *seg, uint32_t area_num,seg_lv (seg, area_num) = lv;seg_le (seg, area_num) = le; } - lv->status |= status;if (!add_seg_to_segs_using_this_lv (lv, seg)) return_0;
@@ -4678,8 +4678,7 @@ static int _lvresize_check(struct logical_volume *lv,if (lv_is_raid_image (lv) ||lv_is_raid_metadata (lv)) {log_error ("Cannot resize a RAID %s directly" , - (lv->status &RAID_IMAGE ) ?"image" : -"metadata area" ); +lv_is_raid_image (lv) ?"image" :"metadata area" );return 0 ; }
lib/metadata/raid_manip.c +1 -1
@@ -135,7 +135,7 @@ static int _lv_is_raid_with_tracking(const struct logical_volume *lv, *tracking =NULL ; -if (!(lv->status &RAID )) +if (!lv_is_raid (lv))return 0 ;for (s =0 ; s < seg->area_count; s++)
lib/metadata/snapshot_manip.c +1 -1
@@ -121,7 +121,7 @@ int lv_is_visible(const struct logical_volume *lv)if (lv_is_historical (lv))return 1 ; -if (lv->status &SNAPSHOT ) +if (lv_is_snapshot (lv))return 0 ;if (lv_is_cow (lv)) {
tools/toollib.c +1 -1
@@ -2402,7 +2402,7 @@ int process_each_lv_in_vg(struct cmd_context *cmd, struct volume_group *vg, goto_out; } -if (lvl->lv->status &SNAPSHOT ) +if (lv_is_snapshot (lvl->lv))continue ;/* Skip availability change for non-virt snaps when processing all LVs */
tools/vgchange.c +2 -2
@@ -107,11 +107,11 @@ static int _activate_lvs_in_vg(struct cmd_context *cmd, struct volume_group *vg, lv =origin_from_cow (lv);/* Only request activation of snapshot origin devices */ -if ((lv->status &SNAPSHOT ) ||lv_is_cow (lv)) +if (lv_is_snapshot (lv) ||lv_is_cow (lv))continue ;/* Only request activation of mirror LV */ -if ((lv->status &MIRROR_IMAGE ) || (lv->status &MIRROR_LOG )) +if (lv_is_mirror_image (lv) ||lv_is_mirror_log (lv))continue ;/* Only request activation of the first replicator-dev LV */
tools/vgconvert.c +1 -1
@@ -97,7 +97,7 @@ static int vgconvert_single(struct cmd_context *cmd, const char *vg_name,if (cmd->fmt->features &FMT_RESTRICTED_LVIDS ) { dm_list_iterate_items(lvl, &vg->lvs) { lv = lvl->lv; -if (lv->status &SNAPSHOT ) +if (lv_is_snapshot (lv))continue ;if (lvnum_from_lvid (&lv->lvid) <MAX_RESTRICTED_LVS )continue ;
tools/vgsplit.c +2 -2
@@ -112,7 +112,7 @@ static int _move_lvs(struct volume_group *vg_from, struct volume_group *vg_to) dm_list_iterate_safe(lvh, lvht, &vg_from->lvs) { lv = dm_list_item(lvh, struct lv_list)->lv; -if ((lv->status &SNAPSHOT )) +if (lv_is_snapshot (lv))continue ;if (lv_is_raid (lv))
@@ -193,7 +193,7 @@ static int _move_snapshots(struct volume_group *vg_from, dm_list_iterate_safe(lvh, lvht, &vg_from->lvs) { lv = dm_list_item(lvh, struct lv_list)->lv; -if (!(lv->status &SNAPSHOT )) +if (!lv_is_snapshot (lv))continue ; dm_list_iterate_items(seg, &lv->segments) {