From: Dave Wysochanski Date: Mon, 28 Jun 2010 20:36:56 +0000 (+0000) Subject: Add vg get/set methods for VG metadata copies. X-Git-Tag: v2_02_91~1785 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=821f0cc5ea6fe45832fd858025a37643ae8b01d4;p=lvm2.git Add vg get/set methods for VG metadata copies. This patch adds the get and partially implemented set function. The 'set' function should probably ignore or un-ignore metadata areas based on new values. Signed-off-by: Dave Wysochanski --- diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h index 5d87bb30b..83586063f 100644 --- a/lib/metadata/metadata-exported.h +++ b/lib/metadata/metadata-exported.h @@ -882,6 +882,8 @@ uint64_t vg_max_pv(const struct volume_group *vg); uint64_t vg_max_lv(const struct volume_group *vg); uint32_t vg_mda_count(const struct volume_group *vg); uint32_t vg_mda_used_count(const struct volume_group *vg); +uint32_t vg_mda_copies(const struct volume_group *vg); +int vg_set_mda_copies(struct volume_group *vg, uint32_t value); int vg_check_write_mode(struct volume_group *vg); #define vg_is_clustered(vg) (vg_status((vg)) & CLUSTERED) #define vg_is_exported(vg) (vg_status((vg)) & EXPORTED_VG) diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c index 14ae93e2d..cdf2beeb4 100644 --- a/lib/metadata/metadata.c +++ b/lib/metadata/metadata.c @@ -989,6 +989,22 @@ static int _recalc_extents(uint32_t *extents, const char *desc1, return 1; } +uint32_t vg_mda_copies(const struct volume_group *vg) +{ + return vg->mda_copies; +} + +int vg_set_mda_copies(struct volume_group *vg, uint32_t value) +{ + /* FIXME: add checks, etc, and set the value */ + /* + * FIXME: Before we set a larger value, we may need to + * enable some mdas on PVS + */ + vg->mda_copies = value; + return 1; +} + int vg_set_extent_size(struct volume_group *vg, uint32_t new_size) { uint32_t old_size = vg->extent_size;