1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

macros: Add lv_is_not_synced.

This commit is contained in:
Alasdair G Kergon 2016-07-14 14:21:01 +01:00
parent 07be2b864f
commit 5af311ddd8
7 changed files with 8 additions and 7 deletions

View 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)) else if (lv_is_cache_type(lv))
repstr[0] = 'C'; repstr[0] = 'C';
else if (lv_is_raid(lv)) 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)) 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)) else if (lv_is_thin_volume(lv))
repstr[0] = lv_is_merging_origin(lv) ? repstr[0] = lv_is_merging_origin(lv) ?
'O' : (lv_is_merging_thin_snapshot(lv) ? 'S' : 'V'); 'O' : (lv_is_merging_thin_snapshot(lv) ? 'S' : 'V');

View File

@ -4027,7 +4027,7 @@ int lv_extend(struct logical_volume *lv,
*/ */
if (old_extents && if (old_extents &&
segtype_is_mirrored(segtype) && segtype_is_mirrored(segtype) &&
(lv->status & LV_NOTSYNCED)) { (lv_is_not_synced(lv))) {
dm_percent_t sync_percent = DM_PERCENT_INVALID; dm_percent_t sync_percent = DM_PERCENT_INVALID;
if (!lv_is_active_locally(lv)) { if (!lv_is_active_locally(lv)) {

View File

@ -218,6 +218,7 @@
#define lv_is_mirror_log(lv) (((lv)->status & MIRROR_LOG) ? 1 : 0) #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(lv) (((lv)->status & MIRROR) ? 1 : 0)
#define lv_is_mirror_type(lv) (((lv)->status & (MIRROR | MIRROR_LOG | MIRROR_IMAGE)) ? 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_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) #define lv_is_error_when_full(lv) (((lv)->status & LV_ERROR_WHEN_FULL) ? 1 : 0)

View File

@ -590,7 +590,7 @@ static int _raid_add_images(struct logical_volume *lv,
struct lv_list *lvl; struct lv_list *lvl;
struct lv_segment_area *new_areas; 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:" log_error("Can't add image to out-of-sync RAID LV:"
" use 'lvchange --resync' first."); " use 'lvchange --resync' first.");
return 0; return 0;

View File

@ -3161,7 +3161,7 @@ static int _lvinitialimagesync_disp(struct dm_report *rh, struct dm_pool *mem,
int initial_image_sync; int initial_image_sync;
if (lv_is_raid(lv) || lv_is_mirrored(lv)) 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 else
initial_image_sync = 0; initial_image_sync = 0;

View File

@ -404,7 +404,7 @@ static int _lvchange_resync(struct cmd_context *cmd, struct logical_volume *lv)
* worry about persistent logs. * worry about persistent logs.
*/ */
if (!seg_is_raid(seg) && !seg->log_lv) { if (!seg_is_raid(seg) && !seg->log_lv) {
if (lv->status & LV_NOTSYNCED) { if (lv_is_not_synced(lv)) {
lv->status &= ~LV_NOTSYNCED; lv->status &= ~LV_NOTSYNCED;
log_very_verbose("Updating logical volume %s on disk(s).", log_very_verbose("Updating logical volume %s on disk(s).",
display_lvname(lv)); display_lvname(lv));

View File

@ -1418,7 +1418,7 @@ static int _lvconvert_mirrors_aux(struct cmd_context *cmd,
* Up-convert m-way mirror to n-way mirror * Up-convert m-way mirror to n-way mirror
*/ */
if (new_mimage_count > old_mimage_count) { 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 " log_error("Can't add mirror to out-of-sync mirrored "
"LV: use lvchange --resync first."); "LV: use lvchange --resync first.");
return 0; return 0;