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;
}