All of lore.kernel.org
 help / color / mirror / Atom feed
From: zkabelac@sourceware.org <zkabelac@sourceware.org>
To: lvm-devel@redhat.com
Subject: LVM2 lib/thin/thin.c test/t-lvcreate-thin.sh
Date: 10 Nov 2011 15:31:00 -0000	[thread overview]
Message-ID: <20111110153100.17579.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac at sourceware.org	2011-11-10 15:31:00

Modified files:
	lib/thin       : thin.c 
	test           : t-lvcreate-thin.sh 

Log message:
	Thin send create_snap message
	
	Start creating snapshots for real.
	Update test suite to check it happens.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/thin/thin.c.diff?cvsroot=lvm2&r1=1.31&r2=1.32
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-lvcreate-thin.sh.diff?cvsroot=lvm2&r1=1.2&r2=1.3

--- LVM2/lib/thin/thin.c	2011/11/07 11:03:48	1.31
+++ LVM2/lib/thin/thin.c	2011/11/10 15:30:59	1.32
@@ -222,6 +222,7 @@
 {
 	char *metadata_dlid, *pool_dlid;
 	const struct lv_thin_message *lmsg;
+	const struct logical_volume *origin;
 
 	if (!laopts->real_pool) {
 		if (!(pool_dlid = build_dm_uuid(mem, seg->lv->lvid.s, "tpool"))) {
@@ -258,22 +259,13 @@
 
 	dm_list_iterate_items(lmsg, &seg->thin_messages) {
 		switch (lmsg->type) {
-		case DM_THIN_MESSAGE_CREATE_SNAP:
-			/* FIXME: to be implemented */
-			log_debug("Thin pool create_snap %s.", lmsg->u.lv->name);
-			if (!dm_tree_node_add_thin_pool_message(node,
-								lmsg->type,
-								first_seg(lmsg->u.lv)->device_id,
-								0))//first_seg(first_seg(lmsg->u.lv)->origin)->device_id;
-				return_0;
-			log_error("Sorry SNAPSHOT is not yet supported.");
-			return 0;
 		case DM_THIN_MESSAGE_CREATE_THIN:
-			log_debug("Thin pool create_thin %s.", lmsg->u.lv->name);
+			origin = first_seg(lmsg->u.lv)->origin;
+			log_debug("Thin pool create_%s %s.", (!origin) ? "thin" : "snap", lmsg->u.lv->name);
 			if (!dm_tree_node_add_thin_pool_message(node,
-								lmsg->type,
+								(!origin) ? lmsg->type : DM_THIN_MESSAGE_CREATE_SNAP,
 								first_seg(lmsg->u.lv)->device_id,
-								0))
+								(!origin) ? 0 : first_seg(origin)->device_id))
 				return_0;
 			break;
 		case DM_THIN_MESSAGE_DELETE:
--- LVM2/test/t-lvcreate-thin.sh	2011/11/10 12:44:33	1.2
+++ LVM2/test/t-lvcreate-thin.sh	2011/11/10 15:31:00	1.3
@@ -145,10 +145,11 @@
 lvremove -ff $vg
 check vg_field $vg lv_count 0
 
-
 # Create thin snapshot of thinLV
-lvcreate -L4M -V2G -T $vg/pool --name lv1
+lvcreate -L10M -V10M -T $vg/pool --name lv1
+mkfs.ext4 $DM_DEV_DIR/$vg/lv1
 lvcreate -s $vg/lv1
+fsck -p $DM_DEV_DIR/$vg/lvol0
 lvcreate -s $vg/lv1 --name lv2
 lvcreate -s $vg/lv1 --name $vg/lv3
 lvcreate --type snapshot $vg/lv1



                 reply	other threads:[~2011-11-10 15:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20111110153100.17579.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.