]> sourceware.org Git - lvm2.git/commitdiff
Add supporting functions vg_name_dup, vg_fmt_dup, vg_system_id_dup.
authorDave Wysochanski <dwysocha@redhat.com>
Thu, 30 Sep 2010 14:08:33 +0000 (14:08 +0000)
committerDave Wysochanski <dwysocha@redhat.com>
Thu, 30 Sep 2010 14:08:33 +0000 (14:08 +0000)
Add supporting functions for vg_name, vg_fmt, vg_system_id.
Append "_dup" to end of supporting functions to make clear the strings
are dup'd and to avoid namespace conflict with vg_name.

lib/metadata/vg.c
lib/metadata/vg.h

index c79f1365735d1d5365211455b4ef9e30d9790572..05477b23517e2b8f4de803a8973b40888f2f2279 100644 (file)
 #include "metadata.h"
 #include "activate.h"
 
+char *vg_fmt_dup(const struct volume_group *vg)
+{
+       if (!vg->fid || !vg->fid->fmt)
+               return NULL;
+       return dm_pool_strdup(vg->vgmem, vg->fid->fmt->name);
+}
+
+char *vg_name_dup(const struct volume_group *vg)
+{
+       return dm_pool_strdup(vg->vgmem, vg->name);
+}
+
+char *vg_system_id_dup(const struct volume_group *vg)
+{
+       return dm_pool_strdup(vg->vgmem, vg->system_id);
+}
+
 char *vg_uuid_dup(const struct volume_group *vg)
 {
        return id_format_and_copy(vg->vgmem, &vg->id);
index 6071ccbf0d595da4dc5f4b4b95037f3dcb505790..d4e65577854a0e0012b5b90500a59a97b1c6282e 100644 (file)
@@ -93,6 +93,9 @@ struct volume_group {
        uint32_t mda_copies; /* target number of mdas for this VG */
 };
 
+char *vg_fmt_dup(const struct volume_group *vg);
+char *vg_name_dup(const struct volume_group *vg);
+char *vg_system_id_dup(const struct volume_group *vg);
 uint32_t vg_seqno(const struct volume_group *vg);
 uint64_t vg_status(const struct volume_group *vg);
 int vg_set_alloc_policy(struct volume_group *vg, alloc_policy_t alloc);
This page took 0.040238 seconds and 5 git commands to generate.