All of lore.kernel.org
 help / color / mirror / Atom feed
From: wysochanski@sourceware.org <wysochanski@sourceware.org>
To: lvm-devel@redhat.com
Subject: LVM2/lib/metadata metadata-exported.h metadata.c
Date: 26 Jul 2009 01:53:57 -0000	[thread overview]
Message-ID: <20090726015357.5891.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	wysochanski at sourceware.org	2009-07-26 01:53:57

Modified files:
	lib/metadata   : metadata-exported.h metadata.c 

Log message:
	Change pvcreate_single to return pv_t and update function description.
	
	Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
	
	Author: Dave Wysochanski <dwysocha@redhat.com>

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata-exported.h.diff?cvsroot=lvm2&r1=1.97&r2=1.98
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.263&r2=1.264

--- LVM2/lib/metadata/metadata-exported.h	2009/07/26 01:53:09	1.97
+++ LVM2/lib/metadata/metadata-exported.h	2009/07/26 01:53:57	1.98
@@ -354,7 +354,8 @@
 	unsigned yes;
 };
 
-int pvcreate_single(struct cmd_context *cmd, const char *pv_name, void *handle);
+pv_t * pvcreate_single(struct cmd_context *cmd, const char *pv_name,
+		       void *handle);
 
 /*
 * Utility functions
--- LVM2/lib/metadata/metadata.c	2009/07/26 01:53:30	1.263
+++ LVM2/lib/metadata/metadata.c	2009/07/26 01:53:57	1.264
@@ -1107,7 +1107,19 @@
 	pp->yes = 0;
 }
 
-int pvcreate_single(struct cmd_context *cmd, const char *pv_name, void *handle)
+/*
+ * pvcreate_single() - initialize a device with PV label and metadata
+ *
+ * Parameters:
+ * - pv_name: device path to initialize
+ * - handle: options to pass to pv_create; NULL indicates use defaults
+ *
+ * Returns:
+ * NULL: error
+ * pv_t * (non-NULL): handle to physical volume created
+ */
+pv_t * pvcreate_single(struct cmd_context *cmd, const char *pv_name,
+		       void *handle)
 {
 	struct pvcreate_params *pp;
 	void *pv;
@@ -1126,13 +1138,13 @@
 		    (dev != dev_cache_get(pv_name, cmd->filter))) {
 			log_error("uuid %s already in use on \"%s\"",
 				  pp->idp->uuid, dev_name(dev));
-			return 0;
+			return NULL;
 		}
 	}
 
 	if (!lock_vol(cmd, VG_ORPHANS, LCK_VG_WRITE)) {
 		log_error("Can't get lock for orphan PVs");
-		return 0;
+		return NULL;
 	}
 
 	if (!pvcreate_check(cmd, pv_name, pp))
@@ -1192,11 +1204,11 @@
 	log_print("Physical volume \"%s\" successfully created", pv_name);
 
 	unlock_vg(cmd, VG_ORPHANS);
-	return 1;
+	return pv;
 
       error:
 	unlock_vg(cmd, VG_ORPHANS);
-	return 0;
+	return NULL;
 }
 
 static void _free_pv(struct dm_pool *mem, struct physical_volume *pv)



             reply	other threads:[~2009-07-26  1:53 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-26  1:53 wysochanski [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-06-29 22:41 LVM2/lib/metadata metadata-exported.h metadata.c wysochanski
2010-06-28 20:36 wysochanski
2010-05-19 11:52 wysochanski
2010-04-13 17:26 wysochanski
2009-07-26  2:02 wysochanski
2009-07-15 17:26 agk
2009-07-15  6:10 mornfall
2009-07-10 21:19 wysochanski
2009-07-08 14:31 wysochanski
2009-07-08 14:28 wysochanski
2009-06-09 14:29 wysochanski
2009-06-09 14:59 ` Petr Rockai
2009-01-27  1:48 agk
2009-01-27  0:40 agk
2009-01-26 22:13 agk
2008-03-13 22:51 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=20090726015357.5891.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.