]> sourceware.org Git - lvm2.git/commitdiff
cleanup: easier code
authorZdenek Kabelac <zkabelac@redhat.com>
Wed, 8 Mar 2017 13:28:28 +0000 (14:28 +0100)
committerZdenek Kabelac <zkabelac@redhat.com>
Fri, 10 Mar 2017 18:33:01 +0000 (19:33 +0100)
lib/metadata/thin_manip.c

index ce5b95cf340b8fdb014d651f45f19ecac5b9ae5c..d1259b43069af1dd3f1fc009d562821d716ebe8a 100644 (file)
@@ -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;
 }
This page took 0.039492 seconds and 5 git commands to generate.