]> sourceware.org Git - lvm2.git/commitdiff
cleanup: more lv_is_ usage
authorZdenek Kabelac <zkabelac@redhat.com>
Mon, 12 Dec 2016 23:09:15 +0000 (00:09 +0100)
committerZdenek Kabelac <zkabelac@redhat.com>
Tue, 13 Dec 2016 21:07:52 +0000 (22:07 +0100)
13 files changed:
lib/format1/import-export.c
lib/format1/import-extents.c
lib/format_pool/import_export.c
lib/format_text/import_vsn1.c
lib/locking/lvmlockd.c
lib/metadata/lv.c
lib/metadata/lv_manip.c
lib/metadata/raid_manip.c
lib/metadata/snapshot_manip.c
tools/toollib.c
tools/vgchange.c
tools/vgconvert.c
tools/vgsplit.c

index 9b7f5ef99fb8158ae4490576836e50713c75c4af..146623e80481e512b4916d16a936622dd0da0624 100644 (file)
@@ -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))))
index 5cad4f2caf893604e13f9bd32691423a4ff3da6c..3ab3ac443af85d91ac931c571d99f21e11616763 100644 (file)
@@ -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))))
index 1529df59e3ae4168427530130c267856dea33eb7..2f0f2ebda97e8876e68154fb775fbeb0d0987401 100644 (file)
@@ -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++) {
index e11b16bbb0df914e7ebb7702343a862f87d5ba05..00caf210fac269d9948804ca7473bdb91e2501b1 100644 (file)
@@ -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;
                }
index 8acf69c4ca02eba2523c67bca9c7a63c7919097f..92a970aec4f1f0bd101d5f75b13b05a5ea5f355d 100644 (file)
@@ -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 ? */
index 8f13f6b11ffe9e33bd90ecc47b0735bb5b3f5b27..10841497096fc515f0df181d860babbf2a5b28ab 100644 (file)
@@ -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;
index fdfee366f7330b683a77ee1d95ed24cb15f05388..211b1909e41d65f53ddb60f526c72cd3bf9ea456 100644 (file)
@@ -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;
        }
 
index b8a47c08a11b6803ae31d5c628784c976596bcdc..81e2ac28899181e34d23bd3faccaa68ae28c900f 100644 (file)
@@ -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++)
index 2f13ac9faf1ac9152b2a42569e858baa4c0b426e..b5fb60c4ad89860b1c6a7062c3015e4378fd8846 100644 (file)
@@ -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)) {
index 9f399b8f397856709e312032930da7f83b2b8a9c..235e535edb2fd1291eabe28f6631d6152d16d13a 100644 (file)
@@ -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 */
index 455f688b6bf4302995604b21718ed320a73d30fe..ca0f450f2e426becfb25dc198bb9bc77416d4dc7 100644 (file)
@@ -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 */
index 4f28ba3da62f5b48fe357b888cbf5213b3815aa6..2c0ac081d6a53651fc545b9a1027e034507126c2 100644 (file)
@@ -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;
index 52f603f9a5af013aced917eb7529d2ea4e19cf9c..e2ba6f7998b636b117a03052ec513e22730ed94d 100644 (file)
@@ -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) {
This page took 0.064561 seconds and 5 git commands to generate.