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/format-text.c metadata/me ...
Date: 29 Jun 2010 22:37:33 -0000	[thread overview]
Message-ID: <20100629223733.9488.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	wysochanski at sourceware.org	2010-06-29 22:37:32

Modified files:
	lib/format_text: format-text.c 
	lib/metadata   : metadata.c metadata.h 

Log message:
	Improve logging for metadata ignore by printing device name.
	
	Print device name when setting or clearing metadata ignore bit.
	Example:
	label/label.c:160       /dev/loop2: lvm2 label detected
	cache/lvmcache.c:1136         lvmcache: /dev/loop2: now in VG #orphans_lvm2 (#orphans_lvm2)
	metadata/metadata.c:4142     Setting mda ignored flag for metadata_locn /dev/loop2.
	format_text/text_label.c:318     Skipping mda with ignored flag on device /dev/loop2 at offset 4096

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/format-text.c.diff?cvsroot=lvm2&r1=1.135&r2=1.136
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.365&r2=1.366
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.h.diff?cvsroot=lvm2&r1=1.212&r2=1.213

--- LVM2/lib/format_text/format-text.c	2010/06/29 14:52:57	1.135
+++ LVM2/lib/format_text/format-text.c	2010/06/29 22:37:32	1.136
@@ -1639,6 +1639,17 @@
 	return mdac_new;
 }
 
+/*
+ * Return a string description of the metadata location.
+ */
+static const char * _metadata_locn_desc_raw(void *metadata_locn)
+{
+	struct mda_context *mdac;
+
+	mdac = (struct mda_context *) metadata_locn;
+	return dev_name(mdac->area.dev);
+}
+
 
 static int _text_pv_read(const struct format_type *fmt, const char *pv_name,
 		    struct physical_volume *pv, struct dm_list *mdas,
@@ -1732,6 +1743,7 @@
 	.vg_commit = _vg_commit_raw,
 	.vg_revert = _vg_revert_raw,
 	.mda_metadata_locn_copy = _metadata_locn_copy_raw,
+	.mda_metadata_locn_desc = _metadata_locn_desc_raw,
 	.mda_free_sectors = _mda_free_sectors_raw,
 	.mda_total_sectors = _mda_total_sectors_raw,
 	.mda_in_vg = _mda_in_vg_raw,
--- LVM2/lib/metadata/metadata.c	2010/06/29 22:25:58	1.365
+++ LVM2/lib/metadata/metadata.c	2010/06/29 22:37:32	1.366
@@ -4119,15 +4119,23 @@
 
 void mda_set_ignored(struct metadata_area *mda, unsigned ignored)
 {
+	void *locn = mda->metadata_locn;
+
 	if (ignored) {
 		mda->flags |= MDA_IGNORED;
-		log_verbose("Setting mda ignored flag for metadata_locn %p.",
-			mda->metadata_locn);
 	} else {
 		mda->flags &= ~MDA_IGNORED;
-		log_verbose("Clearing mda ignored flag for metadata_locn %p.",
-			mda->metadata_locn);
 	}
+	if (mda->ops->mda_metadata_locn_desc)
+		log_verbose("%s mda ignored flag for "
+			    "metadata_locn %s.",
+			    ignored ? "Setting" : "Clearing",
+			    mda->ops->mda_metadata_locn_desc(locn));
+	else
+		log_verbose("%s mda ignored flag for "
+			    "metadata_locn %p.",
+			    ignored ? "Setting" : "Clearing",
+			    locn);
 }
 
 uint32_t pv_mda_count(const struct physical_volume *pv)
--- LVM2/lib/metadata/metadata.h	2010/06/29 22:25:58	1.212
+++ LVM2/lib/metadata/metadata.h	2010/06/29 22:37:32	1.213
@@ -139,6 +139,10 @@
 	 * Per location copy constructor.
 	 */
 	void *(*mda_metadata_locn_copy) (struct dm_pool *mem, void *metadata_locn);
+	/*
+	 * Per location description - useful for logging.
+	 */
+	const char *(*mda_metadata_locn_desc) (void *metadata_locn);
 
 	/*
 	 * Returns number of free sectors in given metadata area.



             reply	other threads:[~2010-06-29 22:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-29 22:37 wysochanski [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-06-28 20:35 LVM2/lib format_text/format-text.c metadata/me wysochanski
2010-06-28 20:32 wysochanski
2010-06-28 20:31 wysochanski

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=20100629223733.9488.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.