All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Teigland <teigland@sourceware.org>
To: lvm-devel@redhat.com
Subject: master - remove vg_read_error
Date: Fri, 24 Apr 2020 16:16:55 +0000 (GMT)	[thread overview]
Message-ID: <20200424161655.82395386EC42@sourceware.org> (raw)

Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=d945b53ff7076bf7713f5e3b9ad7b79ed1db14c0
Commit:        d945b53ff7076bf7713f5e3b9ad7b79ed1db14c0
Parent:        4047a321285fc0d1a70fd519fb53fc778fe6093b
Author:        David Teigland <teigland@redhat.com>
AuthorDate:    Fri Apr 24 11:14:29 2020 -0500
Committer:     David Teigland <teigland@redhat.com>
CommitterDate: Fri Apr 24 11:14:29 2020 -0500

remove vg_read_error

Once converted results to error numbers but is now just a null check.
---
 lib/metadata/metadata-exported.h |  3 ---
 lib/metadata/metadata.c          | 11 -----------
 tools/vgmerge.c                  |  4 +---
 tools/vgsplit.c                  |  2 +-
 4 files changed, 2 insertions(+), 18 deletions(-)

diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h
index 52bc77673..083f74a28 100644
--- a/lib/metadata/metadata-exported.h
+++ b/lib/metadata/metadata-exported.h
@@ -744,9 +744,6 @@ struct volume_group *vg_read_for_update(struct cmd_context *cmd, const char *vg_
 			 const char *vgid, uint32_t read_flags, uint32_t lockd_state);
 struct volume_group *vg_read_orphans(struct cmd_context *cmd, const char *orphan_vgname);
 
-/* this is historical and being removed, don't use */
-uint32_t vg_read_error(struct volume_group *vg_handle);
-
 /* pe_start and pe_end relate to any existing data so that new metadata
 * areas can avoid overlap */
 struct physical_volume *pv_create(const struct cmd_context *cmd,
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index b42d7a9b9..4b8dce902 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -4010,17 +4010,6 @@ static int _access_vg_exported(struct cmd_context *cmd, struct volume_group *vg)
 	return 0;
 }
 
-/*
- * Test the validity of a VG handle returned by vg_read() or vg_read_for_update().
- */
-uint32_t vg_read_error(struct volume_group *vg_handle)
-{
-	if (!vg_handle)
-		return FAILED_ALLOCATION;
-
-	return SUCCESS;
-}
-
 struct format_instance *alloc_fid(const struct format_type *fmt,
 				  const struct format_instance_ctx *fic)
 {
diff --git a/tools/vgmerge.c b/tools/vgmerge.c
index 903504c57..895018a6f 100644
--- a/tools/vgmerge.c
+++ b/tools/vgmerge.c
@@ -21,10 +21,8 @@ static struct volume_group *_vgmerge_vg_read(struct cmd_context *cmd,
 	struct volume_group *vg;
 	log_verbose("Checking for volume group \"%s\"", vg_name);
 	vg = vg_read_for_update(cmd, vg_name, NULL, 0, 0);
-	if (vg_read_error(vg)) {
-		release_vg(vg);
+	if (!vg)
 		return NULL;
-	}
 
 	if (vg_is_shared(vg)) {
 		log_error("vgmerge not allowed for lock_type %s", vg->lock_type);
diff --git a/tools/vgsplit.c b/tools/vgsplit.c
index 3dc19ecea..1a422e683 100644
--- a/tools/vgsplit.c
+++ b/tools/vgsplit.c
@@ -691,7 +691,7 @@ int vgsplit(struct cmd_context *cmd, int argc, char **argv)
 
 		vg_to = vg_read_for_update(cmd, vg_name_to, NULL, 0, 0);
 
-		if (vg_read_error(vg_to)) {
+		if (!vg_to) {
 			log_error("Volume group \"%s\" became inconsistent: "
 				  "please fix manually", vg_name_to);
 			goto bad;




                 reply	other threads:[~2020-04-24 16:16 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=20200424161655.82395386EC42@sourceware.org \
    --to=teigland@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.