All of lore.kernel.org
 help / color / mirror / Atom feed
From: wysochanski@sourceware.org <wysochanski@sourceware.org>
To: lvm-devel@redhat.com
Subject: LVM2/lib/format_text export.c import_vsn1.c
Date: 28 Jun 2010 20:37:10 -0000	[thread overview]
Message-ID: <20100628203710.18258.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	wysochanski at sourceware.org	2010-06-28 20:37:10

Modified files:
	lib/format_text: export.c import_vsn1.c 

Log message:
	Make vg->mda_copies persistent in on disk vg metadata.
	
	This patch adds the ability to read/write the vg->mda_copies values
	from/to the vg metadata.
	
	If we read the VG metadata and this field does not exist, we set
	mda_copies to the default value of 0.  Later in the code, we use
	this special '0' value to indicate a disable of metadata balancing.
	This should preserve existing LVM behavior and ensure metadata balancing
	can be turned off should the need arise.
	
	Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/export.c.diff?cvsroot=lvm2&r1=1.75&r2=1.76
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/import_vsn1.c.diff?cvsroot=lvm2&r1=1.75&r2=1.76

--- LVM2/lib/format_text/export.c	2010/01/07 14:45:28	1.75
+++ LVM2/lib/format_text/export.c	2010/06/28 20:37:10	1.76
@@ -397,6 +397,7 @@
 		outf(f, "allocation_policy = \"%s\"",
 		     get_alloc_string(vg->alloc));
 	}
+	outf(f, "metadata_copies = %u", vg->mda_copies);
 
 	return 1;
 }
--- LVM2/lib/format_text/import_vsn1.c	2010/05/05 22:37:53	1.75
+++ LVM2/lib/format_text/import_vsn1.c	2010/06/28 20:37:10	1.76
@@ -23,6 +23,7 @@
 #include "pv_alloc.h"
 #include "segtype.h"
 #include "text_import.h"
+#include "defaults.h"
 
 typedef int (*section_fn) (struct format_instance * fid, struct dm_pool * mem,
 			   struct volume_group * vg, struct config_node * pvn,
@@ -745,6 +746,10 @@
 			return_0;
 	}
 
+	if (!_read_uint32(vgn, "metadata_copies", &vg->mda_copies)) {
+		vg->mda_copies = DEFAULT_VGMETADATACOPIES;
+	}
+
 	/*
 	 * The pv hash memorises the pv section names -> pv
 	 * structures.



                 reply	other threads:[~2010-06-28 20:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100628203710.18258.qmail@sourceware.org \
    --to=wysochanski@sourceware.org \
    --cc=lvm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.