All of lore.kernel.org
 help / color / mirror / Atom feed
From: wysochanski@sourceware.org <wysochanski@sourceware.org>
To: lvm-devel@redhat.com
Subject: LVM2 ./WHATS_NEW lib/metadata/metadata.c lib/m ...
Date: 11 Jul 2007 23:33:13 -0000	[thread overview]
Message-ID: <20070711233313.28767.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	wysochanski at sourceware.org	2007-07-11 23:33:12

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

Log message:
	Add pv_read_path, a proposed external LVM library function to take a device path and return a PV handle

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.652&r2=1.653
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.123&r2=1.124
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.h.diff?cvsroot=lvm2&r1=1.166&r2=1.167

--- LVM2/WHATS_NEW	2007/07/11 12:07:39	1.652
+++ LVM2/WHATS_NEW	2007/07/11 23:33:12	1.653
@@ -1,5 +1,6 @@
 Version 2.02.27 - 
 ================================
+  Add pv_read_path external library function.
   Tidy clvmd-openais of redundant bits, and improve an error report.
   Cope with find_seg_by_le() failure in check_lv_segments().
   Call dev_iter_destroy() if _process_all_devs() is interrupted by sigint.
--- LVM2/lib/metadata/metadata.c	2007/07/02 21:48:30	1.123
+++ LVM2/lib/metadata/metadata.c	2007/07/11 23:33:12	1.124
@@ -72,7 +72,6 @@
 	struct physical_volume *pv;
 	struct format_instance *fid = vg->fid;
 	struct dm_pool *mem = fid->fmt->cmd->mem;
-	struct list mdas;
 
 	log_verbose("Adding physical volume '%s' to volume group '%s'",
 		    pv_name, vg->name);
@@ -82,8 +81,7 @@
 		return 0;
 	}
 
-	list_init(&mdas);
-	if (!(pv = _pv_read(fid->fmt->cmd, pv_name, &mdas, NULL, 1))) {
+	if (!(pv = pv_read_path(fid->fmt->cmd, pv_name))) {
 		log_error("%s not identified as an existing physical volume",
 			  pv_name);
 		return 0;
@@ -1842,3 +1840,22 @@
 {
 	return vg->status;
 }
+
+
+/**
+ * pv_read_path - Given a device path return a PV handle if it is a PV
+ * @cmd - handle to the LVM command instance
+ * @pv_name - device path to read for the PV
+ *
+ * Returns:
+ *  NULL - device path does not contain a valid PV
+ *  non-NULL - PV handle corresponding to device path
+ *
+ */
+pv_t *pv_read_path(const struct cmd_context *cmd, const char *pv_name)
+{
+	struct list mdas;
+	
+	list_init(&mdas);
+	return _pv_read(cmd, pv_name, &mdas, NULL, 1);
+}
--- LVM2/lib/metadata/metadata.h	2007/06/19 04:36:12	1.166
+++ LVM2/lib/metadata/metadata.h	2007/07/11 23:33:12	1.167
@@ -638,7 +638,7 @@
 		       char *buffer, size_t len);
 
 /*
- * Gets/Sets for external LVM library
+ * Begin skeleton for external LVM library
  */
 struct id pv_id(pv_t *pv);
 const struct format_type *pv_format_type(pv_t *pv);
@@ -654,4 +654,6 @@
 
 uint32_t vg_status(vg_t *vg);
 
+pv_t *pv_read_path(const struct cmd_context *cmd, const char *pv_name);
+
 #endif



             reply	other threads:[~2007-07-11 23:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-11 23:33 wysochanski [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-11-04 22:49 LVM2 ./WHATS_NEW lib/metadata/metadata.c lib/m zkabelac
2011-08-10 20:17 zkabelac
2010-09-23 12:02 prajnoha
2010-07-07  2:53 agk
2010-03-31 17:21 mbroz
2009-03-16 14:34 mbroz
2008-06-23 19:04 wysochanski
2008-04-22 12:54 agk
2007-07-12 15:38 wysochanski
2007-07-12  5:04 wysochanski
2007-06-06 19:40 wysochanski
2007-04-25 20:03 wysochanski
2007-02-07 13:29 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=20070711233313.28767.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.