mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-02 01:18:26 +03:00
cleanup: use dm_list_empty
Instant check for 'dm_list_size() == 0' without any size calc.
This commit is contained in:
parent
197f6aaad7
commit
3cf97a737b
@ -2739,7 +2739,7 @@ int vg_validate(struct volume_group *vg)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!hlv->indirect_origin && !dm_list_size(&hlv->indirect_glvs)) {
|
||||
if (!hlv->indirect_origin && dm_list_empty(&hlv->indirect_glvs)) {
|
||||
log_error(INTERNAL_ERROR "Historical LV %s is not part of any LV chain in VG %s", hlv->name, vg->name);
|
||||
r = 0;
|
||||
continue;
|
||||
|
@ -6963,7 +6963,7 @@ try_again:
|
||||
*/
|
||||
if (!_raid_extract_images(lv, force,
|
||||
raid_seg->area_count - match_count,
|
||||
(partial_segment_removed || !dm_list_size(remove_pvs)) ?
|
||||
(partial_segment_removed || dm_list_empty(remove_pvs)) ?
|
||||
&lv->vg->pvs : remove_pvs, 0,
|
||||
&old_lvs, &old_lvs)) {
|
||||
log_error("Failed to remove the specified images from %s.",
|
||||
|
@ -1203,7 +1203,7 @@ static int _full_report_single(struct cmd_context *cmd,
|
||||
int orphan = is_orphan_vg(vg->name);
|
||||
int r = ECMD_FAILED;
|
||||
|
||||
if (orphan && !dm_list_size(&vg->pvs))
|
||||
if (orphan && dm_list_empty(&vg->pvs))
|
||||
return ECMD_PROCESSED;
|
||||
|
||||
args->full_report_vg = vg;
|
||||
|
@ -3172,7 +3172,7 @@ int process_each_lv_in_vg(struct cmd_context *cmd, struct volume_group *vg,
|
||||
log_set_report_object_name_and_id(NULL, NULL);
|
||||
|
||||
if (handle->include_historical_lvs && !tags_supplied) {
|
||||
if (!dm_list_size(&_historical_lv.segments))
|
||||
if (dm_list_empty(&_historical_lv.segments))
|
||||
dm_list_add(&_historical_lv.segments, &_historical_lv_segment.list);
|
||||
_historical_lv.vg = vg;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user