public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
From: zkabelac@sourceware.org
To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org
Subject: LVM2 ./WHATS_NEW lib/cache/lvmcache.c lib/cach ...
Date: Mon, 10 Jan 2011 13:15:00 -0000	[thread overview]
Message-ID: <20110110131558.21883.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-01-10 13:15:57

Modified files:
	.              : WHATS_NEW 
	lib/cache      : lvmcache.c lvmcache.h 

Log message:
	Cache config_tree
	
	Start to use config_tree for cache just like vgmetadata.
	When vgmetadata are erased destroy its cached config tree.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1867&r2=1.1868
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.101&r2=1.102
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.h.diff?cvsroot=lvm2&r1=1.36&r2=1.37

--- LVM2/WHATS_NEW	2011/01/10 13:13:42	1.1867
+++ LVM2/WHATS_NEW	2011/01/10 13:15:57	1.1868
@@ -1,5 +1,6 @@
 Version 2.02.80 - 
 ====================================
+  Speedup command processing by caching resolved config tree.
   Pass config_tree to renamed function import_vg_from_config_tree().
   Detect NULL handle in get_property().
   Fix superfluous /usr in ocf_scriptdir instalation path.
--- LVM2/lib/cache/lvmcache.c	2011/01/10 13:13:42	1.101
+++ LVM2/lib/cache/lvmcache.c	2011/01/10 13:15:57	1.102
@@ -83,6 +83,12 @@
 
 	vginfo->vgmetadata = NULL;
 
+	/* Release also cached config tree */
+	if (vginfo->cft) {
+		destroy_config_tree(vginfo->cft);
+		vginfo->cft = NULL;
+	}
+
 	log_debug("Metadata cache: VG %s wiped.", vginfo->vgname);
 }
 
@@ -651,7 +657,9 @@
 						      vgid, NULL)))
 		return_NULL;
 
-	if (!(vginfo->cft =
+	/* Build config tree from vgmetadata, if not yet cached */
+	if (!vginfo->cft &&
+	    !(vginfo->cft =
 	      create_config_tree_from_string(fid->fmt->cmd,
 					     vginfo->vgmetadata))) {
 		_free_cached_vgmetadata(vginfo);
@@ -660,10 +668,8 @@
 
 	if (!(vg = import_vg_from_config_tree(vginfo->cft, fid))) {
 		_free_cached_vgmetadata(vginfo);
-		destroy_config_tree(vginfo->cft);
 		return_NULL;
 	}
-	destroy_config_tree(vginfo->cft);
 
 	log_debug("Using cached %smetadata for VG %s.",
 		  vginfo->precommitted ? "pre-committed" : "", vginfo->vgname);
--- LVM2/lib/cache/lvmcache.h	2011/01/10 13:13:42	1.36
+++ LVM2/lib/cache/lvmcache.h	2011/01/10 13:15:57	1.37
@@ -48,6 +48,7 @@
 	char *creation_host;
 	char *vgmetadata;	/* Copy of VG metadata as format_text string */
 	struct config_tree *cft; /* Config tree created from vgmetadata */
+				/* Lifetime is directly tied to vgmetadata */
 	unsigned precommitted;	/* Is vgmetadata live or precommitted? */
 };
 


             reply	other threads:[~2011-01-10 13:15 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-10 13:15 zkabelac [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:13 zkabelac
2010-12-10 22:40 agk
2010-03-17  2:11 agk
2010-03-16 17:30 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=20110110131558.21883.qmail@sourceware.org \
    --to=zkabelac@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).