All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leo Yan <leo.yan@linaro.org>
To: lvm-devel@redhat.com
Subject: [LVM2 RFCv1 5/5] tools: Add support for "idm" lock type
Date: Sun, 25 Apr 2021 10:22:41 +0800	[thread overview]
Message-ID: <20210425022241.5055-6-leo.yan@linaro.org> (raw)
In-Reply-To: <20210425022241.5055-1-leo.yan@linaro.org>

This patch is to update the comment and code to support "idm" lock type
which is used for LVM toolkit.

Signed-off-by: Leo Yan <leo.yan@linaro.org>
---
 tools/lvconvert.c |  2 ++
 tools/toollib.c   | 11 ++++++-----
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 4c159b01e..1f2178ce5 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -3415,6 +3415,8 @@ static int _lvconvert_to_pool(struct cmd_context *cmd,
 				pool_lv->lock_args = "pending";
 			else if (!strcmp(vg->lock_type, "dlm"))
 				pool_lv->lock_args = "dlm";
+			else if (!strcmp(vg->lock_type, "idm"))
+				pool_lv->lock_args = "idm";
 			/* The lock_args will be set in vg_write(). */
 		}
 	}
diff --git a/tools/toollib.c b/tools/toollib.c
index 67fbbdaa0..cda6d74f3 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -591,15 +591,15 @@ int vgcreate_params_set_from_args(struct cmd_context *cmd,
 	 * new VG, and is it compatible with current lvm.conf settings.
 	 *
 	 * The end result is to set vp_new->lock_type to:
-	 * none | clvm | dlm | sanlock.
+	 * none | clvm | dlm | sanlock | idm.
 	 *
 	 * If 'vgcreate --lock-type <arg>' is set, the answer is given
-	 * directly by <arg> which is one of none|clvm|dlm|sanlock.
+	 * directly by <arg> which is one of none|clvm|dlm|sanlock|idm.
 	 *
 	 * 'vgcreate --clustered y' is the way to create clvm VGs.
 	 *
 	 * 'vgcreate --shared' is the way to create lockd VGs.
-	 * lock_type of sanlock or dlm is selected based on
+	 * lock_type of sanlock, dlm or idm is selected based on
 	 * which lock manager is running.
 	 *
 	 *
@@ -646,7 +646,7 @@ int vgcreate_params_set_from_args(struct cmd_context *cmd,
 	 * - lvmlockd is used
 	 * - VGs with CLUSTERED set are ignored (requires clvmd)
 	 * - VGs with lockd type can be used
-	 * - vgcreate can create new VGs with lock_type sanlock or dlm
+	 * - vgcreate can create new VGs with lock_type sanlock, dlm or idm
 	 * - 'vgcreate --clustered y' fails
 	 * - 'vgcreate --shared' works
 	 * - 'vgcreate' (neither option) creates a local VG
@@ -658,7 +658,7 @@ int vgcreate_params_set_from_args(struct cmd_context *cmd,
 		lock_type = arg_str_value(cmd, locktype_ARG, "");
 
 		if (arg_is_set(cmd, shared_ARG) && !is_lockd_type(lock_type)) {
-			log_error("The --shared option requires lock type sanlock or dlm.");
+			log_error("The --shared option requires lock type sanlock, dlm or idm.");
 			return 0;
 		}
 
@@ -697,6 +697,7 @@ int vgcreate_params_set_from_args(struct cmd_context *cmd,
 
 	case LOCK_TYPE_SANLOCK:
 	case LOCK_TYPE_DLM:
+	case LOCK_TYPE_IDM:
 		if (!use_lvmlockd) {
 			log_error("Using a shared lock type requires lvmlockd.");
 			return 0;
-- 
2.25.1



  parent reply	other threads:[~2021-04-25  2:22 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-25  2:22 [LVM2 RFCv1 0/5] Enable In-Drive-Mutex Locking scheme Leo Yan
2021-04-25  2:22 ` [LVM2 RFCv1 1/5] lvmlockd: idm: Introduce new locking scheme Leo Yan
2021-04-28 19:54   ` David Teigland
2021-04-29  3:26     ` Leo Yan
2021-04-29 15:31       ` David Teigland
2021-04-25  2:22 ` [LVM2 RFCv1 2/5] lvmlockd: idm: Hook Seagate IDM wrapper APIs Leo Yan
2021-04-25  2:22 ` [LVM2 RFCv1 3/5] lib: locking: Add new type "idm" Leo Yan
2021-04-25  2:22 ` [LVM2 RFCv1 4/5] lib: locking: Parse PV list for IDM locking Leo Yan
2021-04-28 19:39   ` David Teigland
2021-04-29  3:12     ` Leo Yan
2021-04-29  3:36       ` Leo Yan
2021-04-25  2:22 ` Leo Yan [this message]
2021-04-27 22:23 ` [LVM2 RFCv1 0/5] Enable In-Drive-Mutex Locking scheme David Teigland
2021-04-28  1:50   ` Leo Yan

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=20210425022241.5055-6-leo.yan@linaro.org \
    --to=leo.yan@linaro.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.