public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
From: agk@sourceware.org
To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org
Subject: LVM2 ./WHATS_NEW lib/cache/lvmcache.c lib/cach ...
Date: Tue, 16 Mar 2010 17:30:00 -0000	[thread overview]
Message-ID: <20100316173004.11566.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2010-03-16 17:30:02

Modified files:
	.              : WHATS_NEW 
	lib/cache      : lvmcache.c lvmcache.h 
	lib/format_text: format-text.c import_vsn1.c 
	lib/metadata   : metadata.c 

Log message:
	Only do one full device scan during each read of text format metadata.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1463&r2=1.1464
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.79&r2=1.80
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.h.diff?cvsroot=lvm2&r1=1.28&r2=1.29
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/format-text.c.diff?cvsroot=lvm2&r1=1.119&r2=1.120
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/import_vsn1.c.diff?cvsroot=lvm2&r1=1.67&r2=1.68
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.321&r2=1.322

--- LVM2/WHATS_NEW	2010/03/16 16:57:03	1.1463
+++ LVM2/WHATS_NEW	2010/03/16 17:30:00	1.1464
@@ -1,5 +1,6 @@
 Version 2.02.63 - 
 ================================
+  Only do one full device scan during each read of text format metadata.
   Remove unnecessary full_scan parameter from get_vgids and get_vgnames calls.
   Look up missing PVs by uuid not dev_name in _pvs_single to avoid invalid stat.
   Make find_pv_in_vg_by_uuid() return same type as related functions.
--- LVM2/lib/cache/lvmcache.c	2010/03/16 16:57:04	1.79
+++ LVM2/lib/cache/lvmcache.c	2010/03/16 17:30:01	1.80
@@ -703,7 +703,8 @@
 	return pvids;
 }
 
-struct device *device_from_pvid(struct cmd_context *cmd, struct id *pvid)
+struct device *device_from_pvid(struct cmd_context *cmd, struct id *pvid,
+				int *scan_done_once)
 {
 	struct label *label;
 	struct lvmcache_info *info;
@@ -728,10 +729,11 @@
 		}
 	}
 
-	if (memlock())
+	if (memlock() || (scan_done_once && *scan_done_once))
 		return NULL;
 
 	lvmcache_label_scan(cmd, 2);
+	*scan_done_once = 1;
 
 	/* Try again */
 	if ((info = info_from_pvid((char *) pvid, 0))) {
--- LVM2/lib/cache/lvmcache.h	2010/03/16 16:57:04	1.28
+++ LVM2/lib/cache/lvmcache.h	2010/03/16 17:30:01	1.29
@@ -93,7 +93,8 @@
 struct lvmcache_vginfo *vginfo_from_vgid(const char *vgid);
 struct lvmcache_info *info_from_pvid(const char *pvid, int valid_only);
 const char *vgname_from_vgid(struct dm_pool *mem, const char *vgid);
-struct device *device_from_pvid(struct cmd_context *cmd, struct id *pvid);
+struct device *device_from_pvid(struct cmd_context *cmd, struct id *pvid,
+				int *scan_done_once);
 int vgs_locked(void);
 int vgname_is_locked(const char *vgname);
 
--- LVM2/lib/format_text/format-text.c	2010/02/15 23:53:15	1.119
+++ LVM2/lib/format_text/format-text.c	2010/03/16 17:30:01	1.120
@@ -2025,7 +2025,7 @@
 		return 0;
 	}
 
-	if (!(dev_area.dev = device_from_pvid(cmd, &id))) {
+	if (!(dev_area.dev = device_from_pvid(cmd, &id, NULL))) {
 		char buffer[64] __attribute((aligned(8)));
 
 		if (!id_write_format(&id, buffer, sizeof(buffer)))
--- LVM2/lib/format_text/import_vsn1.c	2009/12/04 17:48:32	1.67
+++ LVM2/lib/format_text/import_vsn1.c	2010/03/16 17:30:01	1.68
@@ -27,7 +27,8 @@
 typedef int (*section_fn) (struct format_instance * fid, struct dm_pool * mem,
 			   struct volume_group * vg, struct config_node * pvn,
 			   struct config_node * vgn,
-			   struct dm_hash_table * pv_hash);
+			   struct dm_hash_table * pv_hash,
+			   int *scan_done_once);
 
 #define _read_int32(root, path, result) \
 	get_config_uint32(root, path, (uint32_t *) result)
@@ -153,7 +154,7 @@
 static int _read_pv(struct format_instance *fid, struct dm_pool *mem,
 		    struct volume_group *vg, struct config_node *pvn,
 		    struct config_node *vgn __attribute((unused)),
-		    struct dm_hash_table *pv_hash)
+		    struct dm_hash_table *pv_hash, int *scan_done_once)
 {
 	struct physical_volume *pv;
 	struct pv_list *pvl;
@@ -186,7 +187,7 @@
 	/*
 	 * Convert the uuid into a device.
 	 */
-	if (!(pv->dev = device_from_pvid(fid->fmt->cmd, &pv->id))) {
+	if (!(pv->dev = device_from_pvid(fid->fmt->cmd, &pv->id, scan_done_once))) {
 		char buffer[64] __attribute((aligned(8)));
 
 		if (!id_write_format(&pv->id, buffer, sizeof(buffer)))
@@ -490,7 +491,8 @@
 			 struct dm_pool *mem,
 			 struct volume_group *vg, struct config_node *lvn,
 			 struct config_node *vgn __attribute((unused)),
-			 struct dm_hash_table *pv_hash __attribute((unused)))
+			 struct dm_hash_table *pv_hash __attribute((unused)),
+			 int *scan_done_once __attribute((unused)))
 {
 	struct logical_volume *lv;
 	struct config_node *cn;
@@ -556,7 +558,8 @@
 			struct dm_pool *mem,
 			struct volume_group *vg, struct config_node *lvn,
 			struct config_node *vgn __attribute((unused)),
-			struct dm_hash_table *pv_hash)
+			struct dm_hash_table *pv_hash,
+			int *scan_done_once __attribute((unused)))
 {
 	struct logical_volume *lv;
 	struct lv_list *lvl;
@@ -612,6 +615,7 @@
 			  struct dm_hash_table *pv_hash, int optional)
 {
 	struct config_node *n;
+	int scan_done_once = 0;
 
 	if (!(n = find_config_node(vgn, section))) {
 		if (!optional) {
@@ -623,7 +627,7 @@
 	}
 
 	for (n = n->child; n; n = n->sib) {
-		if (!fn(fid, mem, vg, n, vgn, pv_hash))
+		if (!fn(fid, mem, vg, n, vgn, pv_hash, &scan_done_once))
 			return_0;
 	}
 
--- LVM2/lib/metadata/metadata.c	2010/03/16 16:57:04	1.321
+++ LVM2/lib/metadata/metadata.c	2010/03/16 17:30:02	1.322
@@ -1416,7 +1416,7 @@
 		pp = &default_pp;
 
 	if (pp->idp) {
-		if ((dev = device_from_pvid(cmd, pp->idp)) &&
+		if ((dev = device_from_pvid(cmd, pp->idp, NULL)) &&
 		    (dev != dev_cache_get(pv_name, cmd->filter))) {
 			if (!id_write_format((const struct id*)&pp->idp->uuid,
 			    buffer, sizeof(buffer)))


             reply	other threads:[~2010-03-16 17:30 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-16 17:30 agk [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-08-11 17:24 zkabelac
2011-06-01 19:29 agk
2011-03-30 13:14 zkabelac
2011-01-10 13:15 zkabelac
2011-01-10 13:13 zkabelac
2010-12-10 22:40 agk
2010-03-17  2:11 agk
2010-03-16 16:57 agk
2010-02-03 14:08 prajnoha
2009-09-02 21:34 wysochanski
2008-04-14 19:24 agk
2008-04-08 12:49 agk
2008-04-01 22:40 agk
2008-02-06 15:47 agk
2008-01-29 23:45 agk
2006-04-13 21:08 agk
2006-04-13 17:32 agk
2006-04-12 21:23 agk
2006-04-12 17:54 agk
2006-04-11 17:42 agk
2006-04-11 13:56 agk

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=20100316173004.11566.qmail@sourceware.org \
    --to=agk@sourceware.org \
    --cc=lvm-devel@redhat.com \
    --cc=lvm2-cvs@sourceware.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).