mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
cleanup: add lv_is_error_when_full() macro
Like with other status bits use macro for testing. (in-release update)
This commit is contained in:
parent
8f90f632f5
commit
07eb1c7dc8
@ -147,7 +147,7 @@ int check_lv_segments(struct logical_volume *lv, int complete_vg)
|
|||||||
inc_error_count;
|
inc_error_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((lv->status & LV_ERROR_WHEN_FULL) &&
|
if (lv_is_error_when_full(lv) &&
|
||||||
!seg_can_error_when_full(seg)) {
|
!seg_can_error_when_full(seg)) {
|
||||||
log_error("LV %s: segment %u (%s) does not support flag "
|
log_error("LV %s: segment %u (%s) does not support flag "
|
||||||
"ERROR_WHEN_FULL.", lv->name, seg_count, seg->segtype->name);
|
"ERROR_WHEN_FULL.", lv->name, seg_count, seg->segtype->name);
|
||||||
|
@ -195,6 +195,7 @@
|
|||||||
#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_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_pvmove(lv) (((lv)->status & PVMOVE) ? 1 : 0)
|
#define lv_is_pvmove(lv) (((lv)->status & PVMOVE) ? 1 : 0)
|
||||||
|
|
||||||
#define lv_is_raid(lv) (((lv)->status & RAID) ? 1 : 0)
|
#define lv_is_raid(lv) (((lv)->status & RAID) ? 1 : 0)
|
||||||
|
@ -316,8 +316,8 @@ static int _thin_pool_add_target_line(struct dev_manager *dm,
|
|||||||
"not support discards (needs kernel >= 3.4).");
|
"not support discards (needs kernel >= 3.4).");
|
||||||
|
|
||||||
if (attr & THIN_FEATURE_ERROR_IF_NO_SPACE)
|
if (attr & THIN_FEATURE_ERROR_IF_NO_SPACE)
|
||||||
dm_tree_node_set_thin_pool_error_if_no_space(node, (seg->lv->status & LV_ERROR_WHEN_FULL) ? 1 : 0);
|
dm_tree_node_set_thin_pool_error_if_no_space(node, lv_is_error_when_full(seg->lv));
|
||||||
else if (seg->lv->status & LV_ERROR_WHEN_FULL)
|
else if (lv_is_error_when_full(seg->lv))
|
||||||
log_warn_suppress(_no_error_if_no_space++, "WARNING: Thin pool target does "
|
log_warn_suppress(_no_error_if_no_space++, "WARNING: Thin pool target does "
|
||||||
"not support error if no space (needs version >= 1.10).");
|
"not support error if no space (needs version >= 1.10).");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user