mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
cleanup: easier code
This commit is contained in:
parent
52935b5834
commit
d11b8eef89
@ -781,20 +781,16 @@ int lv_is_thin_origin(const struct logical_volume *lv, unsigned int *snap_count)
|
||||
if (snap_count)
|
||||
*snap_count = 0;
|
||||
|
||||
if (!lv_is_thin_volume(lv) ||
|
||||
dm_list_empty(&lv->segs_using_this_lv))
|
||||
return 0;
|
||||
if (lv_is_thin_volume(lv))
|
||||
dm_list_iterate_items(segl, &lv->segs_using_this_lv)
|
||||
if (segl->seg->origin == lv) {
|
||||
r = 1;
|
||||
|
||||
if (!snap_count)
|
||||
break;/* not interested in number of snapshots */
|
||||
|
||||
dm_list_iterate_items(segl, &lv->segs_using_this_lv) {
|
||||
if (segl->seg->origin == lv) {
|
||||
r = 1;
|
||||
if (snap_count)
|
||||
(*snap_count)++;
|
||||
else
|
||||
/* not interested in number of snapshots */
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user