]> sourceware.org Git - lvm2.git/commitdiff
Refactor vg_commit() to add _vg_commit_mdas().
authorDave Wysochanski <dwysocha@redhat.com>
Mon, 28 Jun 2010 20:35:33 +0000 (20:35 +0000)
committerDave Wysochanski <dwysocha@redhat.com>
Mon, 28 Jun 2010 20:35:33 +0000 (20:35 +0000)
Factor out calling mda->ops->vg_commit() for each mda.
No functional change.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
lib/metadata/metadata.c

index 8877d65d8b4e5fb46c7ff91a541062eebcf6404e..22c3b877156a3e7526b51e0e70927b85cd54667b 100644 (file)
@@ -2424,18 +2424,11 @@ int vg_write(struct volume_group *vg)
        return 1;
 }
 
-/* Commit pending changes */
-int vg_commit(struct volume_group *vg)
+static int _vg_commit_mdas(struct volume_group *vg)
 {
        struct metadata_area *mda;
-       int cache_updated = 0;
        int failed = 0;
-
-       if (!vgname_is_locked(vg->name)) {
-               log_error(INTERNAL_ERROR "Attempt to write new VG metadata "
-                         "without locking %s", vg->name);
-               return cache_updated;
-       }
+       int cache_updated = 0;
 
        /* Commit to each copy of the metadata area */
        dm_list_iterate_items(mda, &vg->fid->metadata_areas_in_use) {
@@ -2451,6 +2444,21 @@ int vg_commit(struct volume_group *vg)
                        cache_updated = 1;
                }
        }
+       return cache_updated;
+}
+
+/* Commit pending changes */
+int vg_commit(struct volume_group *vg)
+{
+       int cache_updated = 0;
+
+       if (!vgname_is_locked(vg->name)) {
+               log_error(INTERNAL_ERROR "Attempt to write new VG metadata "
+                         "without locking %s", vg->name);
+               return cache_updated;
+       }
+
+       cache_updated = _vg_commit_mdas(vg);
 
        if (cache_updated) {
                /* Instruct remote nodes to upgrade cached metadata. */
This page took 0.041057 seconds and 5 git commands to generate.