summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2015-11-24 23:29:18 +0100
committerZdenek Kabelac <zkabelac@redhat.com>2015-11-25 11:11:21 +0100
commitd9faf859871e0e862ded3cc08638847c9aaa6f1a (patch)
treee3195c4540550db091d3978a71ae4c41d680cb96
parent0285066e10d0c4a37bc4938eeed2139299600b3e (diff)
downloadlvm2-d9faf859871e0e862ded3cc08638847c9aaa6f1a.tar.gz
cleanup: rename vg_ondisk to vg_committed
Unifying terminology. Since all the metadata in-use are ALWAYS on disk - switch to terminology committed and precommitted. Patch has no functional change inside.
-rw-r--r--lib/metadata/metadata.c16
-rw-r--r--lib/metadata/vg.c2
-rw-r--r--lib/metadata/vg.h10
3 files changed, 14 insertions, 14 deletions
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index b1ddb3440..52d76c372 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -936,18 +936,18 @@ static int _vg_update_vg_precommitted(struct volume_group *vg)
return 1;
}
-static int _vg_update_vg_ondisk(struct volume_group *vg)
+static int _vg_update_vg_committed(struct volume_group *vg)
{
if (dm_pool_locked(vg->vgmem))
return 1;
- if (vg->vg_ondisk || is_orphan_vg(vg->name)) /* we already have it */
+ if (vg->vg_committed || is_orphan_vg(vg->name)) /* we already have it */
return 1;
if (!_vg_update_vg_precommitted(vg))
return_0;
- vg->vg_ondisk = vg->vg_precommitted;
+ vg->vg_committed = vg->vg_precommitted;
vg->vg_precommitted = NULL;
if (vg->cft_precommitted) {
dm_config_destroy(vg->cft_precommitted);
@@ -978,7 +978,7 @@ static struct volume_group *_vg_make_handle(struct cmd_context *cmd,
if (vg->read_status != failure)
vg->read_status = failure;
- if (vg->fid && !_vg_update_vg_ondisk(vg))
+ if (vg->fid && !_vg_update_vg_committed(vg))
vg->read_status |= FAILED_ALLOCATION;
return vg;
@@ -3206,8 +3206,8 @@ int vg_commit(struct volume_group *vg)
vg->old_name = NULL;
/* This *is* the original now that it's commited. */
- release_vg(vg->vg_ondisk);
- vg->vg_ondisk = vg->vg_precommitted;
+ release_vg(vg->vg_committed);
+ vg->vg_committed = vg->vg_precommitted;
vg->vg_precommitted = NULL;
if (vg->cft_precommitted) {
dm_config_destroy(vg->cft_precommitted);
@@ -5539,10 +5539,10 @@ const struct logical_volume *lv_ondisk(const struct logical_volume *lv)
if (!lv)
return NULL;
- if (!lv->vg->vg_ondisk)
+ if (!lv->vg->vg_committed)
return lv;
- vg = lv->vg->vg_ondisk;
+ vg = lv->vg->vg_committed;
if (!(found_lv = find_lv_in_vg_by_lvid(vg, &lv->lvid))) {
log_error(INTERNAL_ERROR "LV %s (UUID %s) not found in ondisk metadata.",
diff --git a/lib/metadata/vg.c b/lib/metadata/vg.c
index ca2bf9616..992cf2a9b 100644
--- a/lib/metadata/vg.c
+++ b/lib/metadata/vg.c
@@ -98,7 +98,7 @@ void release_vg(struct volume_group *vg)
!lvmcache_vginfo_holders_dec_and_test_for_zero(vg->vginfo))
return;
- release_vg(vg->vg_ondisk);
+ release_vg(vg->vg_committed);
release_vg(vg->vg_precommitted);
if (vg->cft_precommitted)
dm_config_destroy(vg->cft_precommitted);
diff --git a/lib/metadata/vg.h b/lib/metadata/vg.h
index a21af8b06..df660a7f2 100644
--- a/lib/metadata/vg.h
+++ b/lib/metadata/vg.h
@@ -52,13 +52,13 @@ struct volume_group {
unsigned skip_validate_lock_args : 1;
/*
- * The parsed on-disk copy of this VG; is NULL if this is the on-disk
- * version (i.e. vg_ondisk == NULL *implies* this is the on-disk copy,
- * there is no guarantee that if this VG is the same as the on-disk one
+ * The parsed committed (on-disk) copy of this VG; is NULL if this VG is committed
+ * version (i.e. vg_committed == NULL *implies* this is the committed copy,
+ * there is no guarantee that if this VG is the same as the committed one
* this will be NULL). The pointer is maintained by calls to
- * _vg_update_vg_ondisk.
+ * _vg_update_vg_committed.
*/
- struct volume_group *vg_ondisk;
+ struct volume_group *vg_committed;
struct dm_config_tree *cft_precommitted; /* Precommitted metadata */
struct volume_group *vg_precommitted; /* Parsed from cft */