All of lore.kernel.org
 help / color / mirror / Atom feed
From: wysochanski@sourceware.org <wysochanski@sourceware.org>
To: lvm-devel@redhat.com
Subject: LVM2/liblvm .exported_symbols lvm.h lvm_lv.c
Date: 26 Jul 2009 20:58:12 -0000	[thread overview]
Message-ID: <20090726205812.390.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	wysochanski at sourceware.org	2009-07-26 20:58:11

Modified files:
	liblvm         : .exported_symbols lvm.h lvm_lv.c 

Log message:
	Add lvm_lv_is_active and lvm_lv_is_suspended.
	
	Return whether an LV is active in the kernel (live table) or suspended
	(table suspend).
	
	Author: Dave Wysochanski <dwysocha@redhat.com>

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/liblvm/.exported_symbols.diff?cvsroot=lvm2&r1=1.16&r2=1.17
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/liblvm/lvm.h.diff?cvsroot=lvm2&r1=1.25&r2=1.26
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/liblvm/lvm_lv.c.diff?cvsroot=lvm2&r1=1.6&r2=1.7

--- LVM2/liblvm/.exported_symbols	2009/07/26 20:57:37	1.16
+++ LVM2/liblvm/.exported_symbols	2009/07/26 20:58:11	1.17
@@ -17,6 +17,8 @@
 lvm_lv_get_uuid
 lvm_lv_get_name
 lvm_lv_get_size
+lvm_lv_is_active
+lvm_lv_is_suspended
 lvm_vg_create
 lvm_vg_extend
 lvm_vg_set_extent_size
--- LVM2/liblvm/lvm.h	2009/07/26 20:57:37	1.25
+++ LVM2/liblvm/lvm.h	2009/07/26 20:58:11	1.26
@@ -516,6 +516,24 @@
  */
 uint64_t lvm_lv_get_size(const lv_t *lv);
 
+/**
+ * Get the current activation state of a logical volume.
+ *
+ * \param   lv
+ *          Logical volume handle.
+ * \return  1 if the LV is active in the kernel, 0 if not
+ */
+uint64_t lvm_lv_is_active(const lv_t *lv);
+
+/**
+ * Get the current suspended state of a logical volume.
+ *
+ * \param   lv
+ *          Logical volume handle.
+ * \return  1 if the LV is suspended in the kernel, 0 if not
+ */
+uint64_t lvm_lv_is_suspended(const lv_t *lv);
+
 /************************** physical volume handling ************************/
 
 /**
--- LVM2/liblvm/lvm_lv.c	2009/07/26 20:57:37	1.6
+++ LVM2/liblvm/lvm_lv.c	2009/07/26 20:58:11	1.7
@@ -19,6 +19,7 @@
 #include "defaults.h"
 #include "segtype.h"
 #include "locking.h"
+#include "activate.h"
 
 #include <string.h>
 
@@ -49,6 +50,24 @@
 	return name;
 }
 
+uint64_t lvm_lv_is_active(const lv_t *lv)
+{
+	struct lvinfo info;
+	if (lv_info(lv->vg->cmd, lv, &info, 1, 0) &&
+	    info.exists && info.live_table)
+		return 1;
+	return 0;
+}
+
+uint64_t lvm_lv_is_suspended(const lv_t *lv)
+{
+	struct lvinfo info;
+	if (lv_info(lv->vg->cmd, lv, &info, 1, 0) &&
+	    info.exists && info.suspended)
+		return 1;
+	return 0;
+}
+
 /* Set defaults for non-segment specific LV parameters */
 static void _lv_set_default_params(struct lvcreate_params *lp,
 				   vg_t *vg, const char *lvname,



             reply	other threads:[~2009-07-26 20:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-26 20:58 wysochanski [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-07-26 20:57 LVM2/liblvm .exported_symbols lvm.h lvm_lv.c wysochanski
2009-07-26 14:36 wysochanski
2009-07-26  2:34 wysochanski

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=20090726205812.390.qmail@sourceware.org \
    --to=wysochanski@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.