public inbox for lvm2-cvs@sourceware.org help / color / mirror / Atom feed
From: snitzer@sourceware.org To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org Subject: LVM2 ./WHATS_NEW lib/activate/dev_manager.c li ... Date: Fri, 15 Jan 2010 16:35:00 -0000 [thread overview] Message-ID: <20100115163527.31179.qmail@sourceware.org> (raw) CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: snitzer@sourceware.org 2010-01-15 16:35:26 Modified files: . : WHATS_NEW lib/activate : dev_manager.c lib/metadata : segtype.h lib/snapshot : snapshot.c Log message: Improve target type compatibility checking in _percent_run(). Add 'target_status_compatible' method to 'struct segtype_handler'. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1389&r2=1.1390 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.173&r2=1.174 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/segtype.h.diff?cvsroot=lvm2&r1=1.26&r2=1.27 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/snapshot/snapshot.c.diff?cvsroot=lvm2&r1=1.43&r2=1.44 --- LVM2/WHATS_NEW 2010/01/15 16:18:14 1.1389 +++ LVM2/WHATS_NEW 2010/01/15 16:35:26 1.1390 @@ -1,5 +1,7 @@ Version 2.02.59 - =================================== + Improve target type compatibility checking in _percent_run(). + Add 'target_status_compatible' method to 'struct segtype_handler'. Fix difference between CTR table built and expected for cluster log. Version 2.02.58 - 14th January 2010 --- LVM2/lib/activate/dev_manager.c 2010/01/14 14:39:57 1.173 +++ LVM2/lib/activate/dev_manager.c 2010/01/15 16:35:26 1.174 @@ -443,19 +443,19 @@ seg = dm_list_item(segh, struct lv_segment); } - /* - * If target status doesn't have 'params' or 'type' is not in the same - * target base class as 'target_type' (e.g. snapshot*, mirror*) skip it - * - allows the situation when 'type' is "snapshot-merge" and - * 'target_type' is "snapshot" - */ - /* FIXME Do this properly - relying on target prefixes is incorrect. (E.g. snapshot-origin)*/ - if (!type || !params || strncmp(type, target_type, strlen(target_type))) + if (!type || !params) continue; if (!(segtype = get_segtype_from_string(dm->cmd, target_type))) continue; + if (strcmp(type, target_type)) { + /* If kernel's type isn't an exact match is it compatible? */ + if (!segtype->ops->target_status_compatible || + !segtype->ops->target_status_compatible(type)) + continue; + } + if (segtype->ops->target_percent && !segtype->ops->target_percent(&dm->target_state, &percent_range, dm->mem, --- LVM2/lib/metadata/segtype.h 2009/10/16 17:41:52 1.26 +++ LVM2/lib/metadata/segtype.h 2010/01/15 16:35:26 1.27 @@ -77,6 +77,7 @@ struct lv_segment *seg, struct dm_tree_node *node, uint64_t len, uint32_t *pvmove_mirror_count); + int (*target_status_compatible) (const char *type); int (*target_percent) (void **target_state, percent_range_t *percent_range, struct dm_pool * mem, --- LVM2/lib/snapshot/snapshot.c 2010/01/14 14:39:58 1.43 +++ LVM2/lib/snapshot/snapshot.c 2010/01/15 16:35:26 1.44 @@ -92,6 +92,11 @@ return 1; } +static int _snap_target_status_compatible(const char *type) +{ + return (strcmp(type, "snapshot-merge") == 0); +} + #ifdef DEVMAPPER_SUPPORT static int _snap_target_percent(void **target_state __attribute((unused)), percent_range_t *percent_range, @@ -303,6 +308,7 @@ .name = _snap_name, .text_import = _snap_text_import, .text_export = _snap_text_export, + .target_status_compatible = _snap_target_status_compatible, #ifdef DEVMAPPER_SUPPORT .target_percent = _snap_target_percent, .target_present = _snap_target_present,
next reply other threads:[~2010-01-15 16:35 UTC|newest] Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top 2010-01-15 16:35 snitzer [this message] -- strict thread matches above, loose matches on Subject: below -- 2012-03-05 15:05 zkabelac 2012-01-20 22:02 snitzer 2011-10-14 13:23 zkabelac 2011-10-06 14:45 jbrassow 2011-08-18 19:38 jbrassow 2010-10-13 21:26 snitzer 2010-04-23 14:16 prajnoha 2010-02-17 22:59 snitzer 2009-10-26 10:02 agk 2009-10-22 13:00 prajnoha 2008-07-15 0:25 agk 2008-04-10 17:09 wysochanski 2008-01-30 13:19 agk 2007-05-15 14:42 mbroz 2006-11-30 23:11 agk 2006-10-18 18:01 agk 2006-04-28 17:01 agk 2005-11-09 13:05 agk 2005-10-27 19:58 agk 2005-08-10 17:19 agk 2005-06-14 17:54 agk 2005-05-03 17:28 agk 2005-01-19 17:19 agk 2004-09-15 15:02 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=20100115163527.31179.qmail@sourceware.org \ --to=snitzer@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: linkBe 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).