summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2017-08-24 14:37:41 -0500
committerDavid Teigland <teigland@redhat.com>2017-10-23 15:17:33 -0500
commitfc305d480cecb035f5a3612013c92ace0217b231 (patch)
tree7825ce7411db178f556b3e8f6a243abb68fbfc36
parenta6372dd22bb4b7eee9aa7df45a862ae9c9863b1a (diff)
downloadlvm2-fc305d480cecb035f5a3612013c92ace0217b231.tar.gz
add comment describing the role of fid/fic
-rw-r--r--lib/metadata/metadata.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index b624fcb32..e489feed2 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -3900,6 +3900,25 @@ static struct volume_group *_vg_read(struct cmd_context *cmd,
if (use_precommitted && !(fmt->features & FMT_PRECOMMIT))
use_precommitted = 0;
+ /*
+ * A "format instance" is an abstraction for a VG location,
+ * i.e. where a VG's metadata exists on disk.
+ *
+ * An fic/fid pair (format_instance_ctx/format_instance) exists
+ * for each VG. The fic/fid is set up by create_instance() to
+ * describe the VG location. This happens before the VG metadata
+ * is assembled into the more familiar struct volume_group "vg".
+ *
+ * The fic/fid has one main purpose: to keep track of the metadata
+ * locations for a given VG. It does this by putting 'mda'
+ * structs on fid->metadata_areas_in_use, which specify where
+ * metadata is located on disk. It gets this information
+ * (metadata locations for a specific VG) from the command's
+ * initial label scan. The info is passed indirectly via
+ * lvmcache info/vginfo structs, which are created by the
+ * label scan and then copied into fic/fid by create_instance().
+ */
+
/* create format instance with appropriate metadata area */
fic.type = FMT_INSTANCE_MDAS | FMT_INSTANCE_AUX_MDAS;
fic.context.vg_ref.vg_name = vgname;