From: zkabelac@sourceware.org <zkabelac@sourceware.org>
To: lvm-devel@redhat.com
Subject: LVM2 ./WHATS_NEW lib/metadata/lv_manip.c lib/m ...
Date: 22 Oct 2011 16:42:12 -0000 [thread overview]
Message-ID: <20111022164212.7590.qmail@sourceware.org> (raw)
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: zkabelac at sourceware.org 2011-10-22 16:42:11
Modified files:
. : WHATS_NEW
lib/metadata : lv_manip.c metadata.h
Log message:
Make move_lv_segment non-static
This function could be useful for other _manip source files.
Use dm_list manipulation function for provided functionality,
which make the code more readable and avoid touching list
internal details here.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2166&r2=1.2167
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.300&r2=1.301
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.h.diff?cvsroot=lvm2&r1=1.259&r2=1.260
--- LVM2/WHATS_NEW 2011/10/21 15:49:45 1.2166
+++ LVM2/WHATS_NEW 2011/10/22 16:42:10 1.2167
@@ -1,5 +1,6 @@
Version 2.02.89 -
==================================
+ Make move_lv_segment non-static function and use dm_list function.
Pass exclusive LV locks to all nodes in the cluster.
Improve lvcreate man documentation of the chunksize option.
Improve man page style for lvcreate.
--- LVM2/lib/metadata/lv_manip.c 2011/10/21 11:38:35 1.300
+++ LVM2/lib/metadata/lv_manip.c 2011/10/22 16:42:11 1.301
@@ -3446,23 +3446,20 @@
return 1;
}
-static int _move_lv_segments(struct logical_volume *lv_to,
- struct logical_volume *lv_from,
- uint64_t set_status, uint64_t reset_status)
+int move_lv_segments(struct logical_volume *lv_to,
+ struct logical_volume *lv_from,
+ uint64_t set_status, uint64_t reset_status)
{
struct lv_segment *seg;
- dm_list_iterate_items(seg, &lv_to->segments) {
+ dm_list_iterate_items(seg, &lv_to->segments)
if (seg->origin) {
- log_error("Can't move snapshot segment");
+ log_error("Can't move snapshot segment.");
return 0;
}
- }
- if (!dm_list_empty(&lv_from->segments))
- lv_to->segments = lv_from->segments;
- lv_to->segments.n->p = &lv_to->segments;
- lv_to->segments.p->n = &lv_to->segments;
+ dm_list_init(&lv_to->segments);
+ dm_list_splice(&lv_to->segments, &lv_from->segments);
dm_list_iterate_items(seg, &lv_to->segments) {
seg->lv = lv_to;
@@ -3470,8 +3467,6 @@
seg->status |= set_status;
}
- dm_list_init(&lv_from->segments);
-
lv_to->le_count = lv_from->le_count;
lv_to->size = lv_from->size;
@@ -3512,7 +3507,7 @@
if (!lv_empty(parent))
return_0;
- if (!_move_lv_segments(parent, layer_lv, 0, 0))
+ if (!move_lv_segments(parent, layer_lv, 0, 0))
return_0;
/* Replace the empty layer with error segment */
@@ -3602,7 +3597,7 @@
log_very_verbose("Inserting layer %s for %s",
layer_lv->name, lv_where->name);
- if (!_move_lv_segments(layer_lv, lv_where, 0, 0))
+ if (!move_lv_segments(layer_lv, lv_where, 0, 0))
return_NULL;
if (!(segtype = get_segtype_from_string(cmd, "striped")))
--- LVM2/lib/metadata/metadata.h 2011/10/19 16:39:09 1.259
+++ LVM2/lib/metadata/metadata.h 2011/10/22 16:42:11 1.260
@@ -420,6 +420,9 @@
int (*fn)(struct cmd_context *cmd,
struct logical_volume *lv, void *data),
void *data);
+int move_lv_segments(struct logical_volume *lv_to,
+ struct logical_volume *lv_from,
+ uint64_t set_status, uint64_t reset_status);
/*
* Calculate readahead from underlying PV devices
next reply other threads:[~2011-10-22 16:42 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-22 16:42 zkabelac [this message]
-- strict thread matches above, loose matches on Subject: below --
2012-02-23 17:36 LVM2 ./WHATS_NEW lib/metadata/lv_manip.c lib/m jbrassow
2012-02-23 3:57 jbrassow
2012-02-15 15:18 zkabelac
2012-02-08 13:05 zkabelac
2012-02-01 2:10 agk
2011-09-06 18:49 agk
2011-08-18 19:41 jbrassow
2011-08-11 3:29 jbrassow
2011-06-23 14:01 jbrassow
2011-04-09 19:05 zkabelac
2011-01-24 14:19 agk
2011-01-11 17:05 jbrassow
2010-10-14 20:03 jbrassow
2010-04-23 19:27 snitzer
2010-04-09 1:00 agk
2010-03-25 21:19 agk
2010-03-25 2:31 agk
2010-01-08 22:32 jbrassow
2010-01-11 13:34 ` Zdenek Kabelac
2009-05-13 21:29 mbroz
2009-05-13 21:28 mbroz
2009-04-21 14:32 mbroz
2009-04-07 10:20 mbroz
2008-03-28 19:08 wysochanski
2008-01-26 0:25 agk
2008-01-18 22:00 agk
2007-12-20 18:55 agk
2007-08-28 16:14 wysochanski
2007-08-03 21:22 wysochanski
2006-12-13 3:39 agk
2006-10-23 15:54 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=20111022164212.7590.qmail@sourceware.org \
--to=zkabelac@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.