]> sourceware.org Git - lvm2.git/commitdiff
Add del_pvl_from_vgs() and move prototypes into metadata-exported.h
authorDave Wysochanski <dwysocha@redhat.com>
Tue, 13 Apr 2010 17:25:44 +0000 (17:25 +0000)
committerDave Wysochanski <dwysocha@redhat.com>
Tue, 13 Apr 2010 17:25:44 +0000 (17:25 +0000)
Add a delete function to manage the vg->pvs list.

NOTE: It may be possible to do further cleanup to these add/del functions
by passing a 'pv' as input instead of 'pv_list'.  The pv_list is used for
functions which do allocations (lvcreate) while other places in the code
just manage a list of 'pv' (e.g. import functions, vgextend, etc).

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

index b4967e62937c8de8ca078c67387fb77f8d9b8064..6fcfb221ca65d8b5f04a3e50abac85871270d742 100644 (file)
@@ -470,6 +470,9 @@ int vg_set_alloc_policy(struct volume_group *vg, alloc_policy_t alloc);
 int vg_set_clustered(struct volume_group *vg, int clustered);
 int vg_split_mdas(struct cmd_context *cmd, struct volume_group *vg_from,
                  struct volume_group *vg_to);
+/* FIXME: Investigate refactoring these functions to take a pv ISO pv_list */
+void add_pvl_to_vgs(struct volume_group *vg, struct pv_list *pvl);
+void del_pvl_from_vgs(struct volume_group *vg, struct pv_list *pvl);
 
 /* FIXME: refactor / unexport when lvremove liblvm refactoring dones */
 int remove_lvs_in_vg(struct cmd_context *cmd,
index a4f1948da59c1f158242cc56c546bdae1a1d0bf4..8cc36e1e9d501329eb7d0de0da3754b5c442ce99 100644 (file)
@@ -145,6 +145,12 @@ void add_pvl_to_vgs(struct volume_group *vg, struct pv_list *pvl)
        vg->pv_count++;
 }
 
+void del_pvl_from_vgs(struct volume_group *vg, struct pv_list *pvl)
+{
+       vg->pv_count--;
+       dm_list_del(&pvl->list);
+}
+
 
 /**
  * add_pv_to_vg - Add a physical volume to a volume group
index 1496252d5ff4c5add612836da210dce3f6daeca3..782d30017d1dc9c53ac8df158c859c118dde168e 100644 (file)
@@ -377,6 +377,5 @@ struct id pv_vgid(const struct physical_volume *pv);
 struct physical_volume *pv_by_path(struct cmd_context *cmd, const char *pv_name);
 int add_pv_to_vg(struct volume_group *vg, const char *pv_name,
                 struct physical_volume *pv);
-void add_pvl_to_vgs(struct volume_group *vg, struct pv_list *pvl);
 
 #endif
This page took 0.045401 seconds and 5 git commands to generate.