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:13:00 -0000 [thread overview]
Message-ID: <20110110131346.20792.qmail@sourceware.org> (raw)
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: zkabelac@sourceware.org 2011-01-10 13:13:43
Modified files:
. : WHATS_NEW
lib/cache : lvmcache.c lvmcache.h
lib/format_text: import.c
lib/metadata : metadata.h
Log message:
Change import_vg_from_buffer to use config_tree
Change function import_vg_from_buffer() to import_vg_from_config_tree().
Instead of creating config tree inside the function allow config tree to
be passed as parameter - usable later for caching.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1866&r2=1.1867
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.100&r2=1.101
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.h.diff?cvsroot=lvm2&r1=1.35&r2=1.36
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/import.c.diff?cvsroot=lvm2&r1=1.52&r2=1.53
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.h.diff?cvsroot=lvm2&r1=1.227&r2=1.228
--- LVM2/WHATS_NEW 2011/01/10 13:07:58 1.1866
+++ LVM2/WHATS_NEW 2011/01/10 13:13:42 1.1867
@@ -1,5 +1,6 @@
Version 2.02.80 -
====================================
+ 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.
Add --with-ocfdir configurable option.
--- LVM2/lib/cache/lvmcache.c 2010/12/10 22:39:54 1.100
+++ LVM2/lib/cache/lvmcache.c 2011/01/10 13:13:42 1.101
@@ -26,6 +26,7 @@
#include "format-text.h"
#include "format_pool.h"
#include "format1.h"
+#include "config.h"
static struct dm_hash_table *_pvid_hash = NULL;
static struct dm_hash_table *_vgid_hash = NULL;
@@ -650,12 +651,20 @@
vgid, NULL)))
return_NULL;
- if (!(vg = import_vg_from_buffer(vginfo->vgmetadata, fid))) {
+ if (!(vginfo->cft =
+ create_config_tree_from_string(fid->fmt->cmd,
+ vginfo->vgmetadata))) {
_free_cached_vgmetadata(vginfo);
- free_vg(vg);
return_NULL;
}
+ 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 2010/12/10 22:39:54 1.35
+++ LVM2/lib/cache/lvmcache.h 2011/01/10 13:13:42 1.36
@@ -33,6 +33,7 @@
struct cmd_context;
struct format_type;
struct volume_group;
+struct config_tree;
/* One per VG */
struct lvmcache_vginfo {
@@ -46,6 +47,7 @@
struct lvmcache_vginfo *next; /* Another VG with same name? */
char *creation_host;
char *vgmetadata; /* Copy of VG metadata as format_text string */
+ struct config_tree *cft; /* Config tree created from vgmetadata */
unsigned precommitted; /* Is vgmetadata live or precommitted? */
};
--- LVM2/lib/format_text/import.c 2010/12/20 13:19:14 1.52
+++ LVM2/lib/format_text/import.c 2011/01/10 13:13:42 1.53
@@ -131,18 +131,14 @@
when, desc);
}
-struct volume_group *import_vg_from_buffer(const char *buf,
- struct format_instance *fid)
+struct volume_group *import_vg_from_config_tree(const struct config_tree *cft,
+ struct format_instance *fid)
{
struct volume_group *vg = NULL;
- struct config_tree *cft;
struct text_vg_version_ops **vsn;
_init_text_import();
- if (!(cft = create_config_tree_from_string(fid->fmt->cmd, buf)))
- return_NULL;
-
for (vsn = &_text_vsn_list[0]; *vsn; vsn++) {
if (!(*vsn)->check_version(cft))
continue;
@@ -155,6 +151,5 @@
break;
}
- destroy_config_tree(cft);
return vg;
}
--- LVM2/lib/metadata/metadata.h 2010/12/20 13:32:49 1.227
+++ LVM2/lib/metadata/metadata.h 2011/01/10 13:13:43 1.228
@@ -100,6 +100,7 @@
//#define FMT_RESIZE_PV 0x00000080U /* Supports pvresize? */
//#define FMT_UNLIMITED_STRIPESIZE 0x00000100U /* Unlimited stripe size? */
+struct config_tree;
struct metadata_area;
/* Per-format per-metadata area operations */
@@ -388,6 +389,8 @@
int export_vg_to_buffer(struct volume_group *vg, char **buf);
struct volume_group *import_vg_from_buffer(const char *buf,
struct format_instance *fid);
+struct volume_group *import_vg_from_config_tree(const struct config_tree *cft,
+ struct format_instance *fid);
/*
* Mirroring functions
next reply other threads:[~2011-01-10 13:13 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-10 13:13 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:15 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=20110110131346.20792.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).