]> sourceware.org Git - lvm2.git/commitdiff
macros: Add lv_is_not_synced.
authorAlasdair G Kergon <agk@redhat.com>
Thu, 14 Jul 2016 13:21:01 +0000 (14:21 +0100)
committerAlasdair G Kergon <agk@redhat.com>
Thu, 14 Jul 2016 13:21:01 +0000 (14:21 +0100)
lib/metadata/lv.c
lib/metadata/lv_manip.c
lib/metadata/metadata-exported.h
lib/metadata/raid_manip.c
lib/report/report.c
tools/lvchange.c
tools/lvconvert.c

index e7a56cf7193a3c77649d5da047b2b7c68cb71968..9ee67b4d2da4ade1778f6585dab67ffbe1b30d76 100644 (file)
@@ -1140,9 +1140,9 @@ char *lv_attr_dup_with_info_and_seg_status(struct dm_pool *mem, const struct lv_
        else if (lv_is_cache_type(lv))
                repstr[0] = 'C';
        else if (lv_is_raid(lv))
-               repstr[0] = (lv->status & LV_NOTSYNCED) ? 'R' : 'r';
+               repstr[0] = (lv_is_not_synced(lv)) ? 'R' : 'r';
        else if (lv_is_mirror(lv))
-               repstr[0] = (lv->status & LV_NOTSYNCED) ? 'M' : 'm';
+               repstr[0] = (lv_is_not_synced(lv)) ? 'M' : 'm';
        else if (lv_is_thin_volume(lv))
                repstr[0] = lv_is_merging_origin(lv) ?
                        'O' : (lv_is_merging_thin_snapshot(lv) ? 'S' : 'V');
index a47bd163686dc894e48f46c9bdd2627d4e4c53a2..c6b8eb536edcad1ac1de18f63ede839becdf84f6 100644 (file)
@@ -4027,7 +4027,7 @@ int lv_extend(struct logical_volume *lv,
                 */
                if (old_extents &&
                    segtype_is_mirrored(segtype) &&
-                   (lv->status & LV_NOTSYNCED)) {
+                   (lv_is_not_synced(lv))) {
                        dm_percent_t sync_percent = DM_PERCENT_INVALID;
 
                        if (!lv_is_active_locally(lv)) {
index 84b510b59a206ac23cd54b6bcb2b5a4f8d852b74..37d4bf837ce40fde658acbb6abead6445538b373 100644 (file)
 #define lv_is_mirror_log(lv)   (((lv)->status & MIRROR_LOG) ? 1 : 0)
 #define lv_is_mirror(lv)       (((lv)->status & MIRROR) ? 1 : 0)
 #define lv_is_mirror_type(lv)  (((lv)->status & (MIRROR | MIRROR_LOG | MIRROR_IMAGE)) ? 1 : 0)
+#define lv_is_not_synced(lv)   (((lv)->status & LV_NOTSYNCED) ? 1 : 0)
 
 #define lv_is_pending_delete(lv) (((lv)->status & LV_PENDING_DELETE) ? 1 : 0)
 #define lv_is_error_when_full(lv) (((lv)->status & LV_ERROR_WHEN_FULL) ? 1 : 0)
index 2ef47b2c6e467806bd699ab7186d5174f983a779..feb8d6e59c7e1c904fef56c1632857ff99d4a1f6 100644 (file)
@@ -590,7 +590,7 @@ static int _raid_add_images(struct logical_volume *lv,
        struct lv_list *lvl;
        struct lv_segment_area *new_areas;
 
-       if (lv->status & LV_NOTSYNCED) {
+       if (lv_is_not_synced(lv)) {
                log_error("Can't add image to out-of-sync RAID LV:"
                          " use 'lvchange --resync' first.");
                return 0;
index 512986e2e231e08391745b823192a7f7215ba223..fab6379cd0a4ba09a19f987d9a1abdb3f4d87a98 100644 (file)
@@ -3161,7 +3161,7 @@ static int _lvinitialimagesync_disp(struct dm_report *rh, struct dm_pool *mem,
        int initial_image_sync;
 
        if (lv_is_raid(lv) || lv_is_mirrored(lv))
-               initial_image_sync = (lv->status & LV_NOTSYNCED) == 0;
+               initial_image_sync = !lv_is_not_synced(lv);
        else
                initial_image_sync = 0;
 
index 4b02ba951995caad26f2b4c77c956f96b364145e..9194cd600168c69e83333bdf174edc3c4482aa68 100644 (file)
@@ -404,7 +404,7 @@ static int _lvchange_resync(struct cmd_context *cmd, struct logical_volume *lv)
         * worry about persistent logs.
         */
        if (!seg_is_raid(seg) && !seg->log_lv) {
-               if (lv->status & LV_NOTSYNCED) {
+               if (lv_is_not_synced(lv)) {
                        lv->status &= ~LV_NOTSYNCED;
                        log_very_verbose("Updating logical volume %s on disk(s).",
                                         display_lvname(lv));
index b8c1959da5e7317d9100c9637e5f91c259e94d4f..0368e8412c2672a6d8dd0f58eb2520ef1e1fdd87 100644 (file)
@@ -1418,7 +1418,7 @@ static int _lvconvert_mirrors_aux(struct cmd_context *cmd,
         * Up-convert m-way mirror to n-way mirror
         */
        if (new_mimage_count > old_mimage_count) {
-               if (lv->status & LV_NOTSYNCED) {
+               if (lv_is_not_synced(lv)) {
                        log_error("Can't add mirror to out-of-sync mirrored "
                                  "LV: use lvchange --resync first.");
                        return 0;
This page took 0.060916 seconds and 5 git commands to generate.