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/activate/activate.c lib/a ...
Date: Wed, 25 Jan 2012 13:10:00 -0000	[thread overview]
Message-ID: <20120125131027.9786.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2012-01-25 13:10:26

Modified files:
	.              : WHATS_NEW 
	lib/activate   : activate.c activate.h 

Log message:
	Rename  origin_only to more generic use_layer flag
	
	Since now we have more layered devices i.e. thin volumes - support
	selection of layer via flag.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2239&r2=1.2240
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.238&r2=1.239
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.h.diff?cvsroot=lvm2&r1=1.96&r2=1.97

--- LVM2/WHATS_NEW	2012/01/25 11:32:41	1.2239
+++ LVM2/WHATS_NEW	2012/01/25 13:10:26	1.2240
@@ -1,5 +1,6 @@
 Version 2.02.89 - 
 ==================================
+  Rename origin_only parameter to more generic flag use_layer for lv_info().
   Thin pools have segment fields thin_count, zero, transaction_id.
   Each new created LV volume has creation lv_time and lv_host.
   Print data_percent and metadata_percent for verbose lvs.
--- LVM2/lib/activate/activate.c	2012/01/25 09:13:10	1.238
+++ LVM2/lib/activate/activate.c	2012/01/25 13:10:26	1.239
@@ -151,13 +151,12 @@
 {
 	return 0;
 }
-int lv_info(struct cmd_context *cmd, const struct logical_volume *lv, unsigned origin_only,
+int lv_info(struct cmd_context *cmd, const struct logical_volume *lv, int use_layer,
 	    struct lvinfo *info, int with_open_count, int with_read_ahead)
 {
 	return 0;
 }
-int lv_info_by_lvid(struct cmd_context *cmd, const char *lvid_s,
-		    unsigned origin_only,
+int lv_info_by_lvid(struct cmd_context *cmd, const char *lvid_s, int use_layer,
 		    struct lvinfo *info, int with_open_count, int with_read_ahead)
 {
 	return 0;
@@ -532,10 +531,11 @@
 /*
  * Returns 1 if info structure populated, else 0 on failure.
  */
-int lv_info(struct cmd_context *cmd, const struct logical_volume *lv, unsigned origin_only,
+int lv_info(struct cmd_context *cmd, const struct logical_volume *lv, int use_layer,
 	    struct lvinfo *info, int with_open_count, int with_read_ahead)
 {
 	struct dm_info dminfo;
+	const char *layer;
 
 	if (!activation())
 		return 0;
@@ -552,7 +552,14 @@
 			fs_unlock(); /* For non clustered - wait if there are non-delete ops */
 	}
 
-	if (!dev_manager_info(lv->vg->cmd->mem, lv, (lv_is_origin(lv) && origin_only) ? "real" : NULL, with_open_count,
+	if (use_layer && lv_is_thin_pool(lv))
+		layer = "tpool";
+	else if (use_layer && lv_is_origin(lv))
+		layer = "real";
+	else
+		layer = NULL;
+
+	if (!dev_manager_info(lv->vg->cmd->mem, lv, layer, with_open_count,
 			      with_read_ahead, &dminfo, &info->read_ahead))
 		return_0;
 
@@ -568,8 +575,7 @@
 	return 1;
 }
 
-int lv_info_by_lvid(struct cmd_context *cmd, const char *lvid_s,
-		    unsigned origin_only,
+int lv_info_by_lvid(struct cmd_context *cmd, const char *lvid_s, int use_layer,
 		    struct lvinfo *info, int with_open_count, int with_read_ahead)
 {
 	int r;
@@ -578,10 +584,7 @@
 	if (!(lv = lv_from_lvid(cmd, lvid_s, 0)))
 		return 0;
 
-	if (!lv_is_origin(lv))
-		origin_only = 0;
-
-	r = lv_info(cmd, lv, origin_only, info, with_open_count, with_read_ahead);
+	r = lv_info(cmd, lv, use_layer, info, with_open_count, with_read_ahead);
 	release_vg(lv->vg);
 
 	return r;
--- LVM2/lib/activate/activate.h	2012/01/25 09:06:43	1.96
+++ LVM2/lib/activate/activate.h	2012/01/25 13:10:26	1.97
@@ -79,10 +79,9 @@
 /*
  * Returns 1 if info structure has been populated, else 0.
  */
-int lv_info(struct cmd_context *cmd, const struct logical_volume *lv,
-	    unsigned origin_only, struct lvinfo *info,
-	    int with_open_count, int with_read_ahead);
-int lv_info_by_lvid(struct cmd_context *cmd, const char *lvid_s, unsigned origin_only,
+int lv_info(struct cmd_context *cmd, const struct logical_volume *lv, int use_layer,
+	    struct lvinfo *info, int with_open_count, int with_read_ahead);
+int lv_info_by_lvid(struct cmd_context *cmd, const char *lvid_s, int use_layer,
 		    struct lvinfo *info, int with_open_count, int with_read_ahead);
 
 int lv_check_not_in_use(struct cmd_context *cmd, struct logical_volume *lv,


             reply	other threads:[~2012-01-25 13:10 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-25 13:10 zkabelac [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-03-23  9:58 zkabelac
2012-02-23 22:42 zkabelac
2012-01-25  8:48 zkabelac
2011-11-18 19:31 zkabelac
2011-10-06 14:55 jbrassow
2011-10-03 18:37 zkabelac
2011-09-22 17:33 prajnoha
2011-06-30 18:25 agk
2011-06-22 21:31 jbrassow
2011-06-17 14:22 zkabelac
2011-06-17 14:14 zkabelac
2011-02-04 19:14 zkabelac
2011-02-03  1:24 zkabelac
2010-08-17  1:16 agk
2010-02-24 20:01 mbroz
2010-02-24 20:00 mbroz
2009-10-01  0:35 agk
2009-06-01 12:43 mbroz
2009-05-20 11:09 mbroz
2009-05-20  9:52 mbroz
2009-02-28  0:54 agk
2008-12-19 14:22 prajnoha
2008-04-07 10:23 mbroz
2008-01-30 14:00 agk
2007-11-12 20:51 agk
2007-07-02 11:17 wysochanski
2007-03-08 21:08 agk
2006-10-03 17:55 agk
2006-08-21 12:55 agk
2006-08-08 21:20 agk
2005-12-19 21:01 agk
2005-10-25 19:08 agk
2005-10-19 13:59 agk
2005-06-01 16:51 agk
2005-01-12 22:58 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=20120125131027.9786.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).