From: Heinz Mauelshagen <heinzm@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH 03/10] Get rid of magic masks in cluster locking code.
Date: Tue, 08 Dec 2009 17:38:16 +0100 [thread overview]
Message-ID: <1260290296.9639.84.camel@o> (raw)
In-Reply-To: <3fb7d099249e6e8e0b7fc963405e95adbb1402c4.1260284754.git.mbroz@redhat.com>
On Tue, 2009-12-08 at 16:39 +0100, Milan Broz wrote:
> Patch should not cause any problems, only real change is
> removing LCK_LOCAL bit from lock type flag, it is never used there.
> (LCK_LOCAL is part arg[1] bits anyway.)
>
> Signed-off-by: Milan Broz <mbroz@redhat.com>
> ---
> lib/locking/cluster_locking.c | 5 +++--
> lib/locking/locking.h | 3 +++
> 2 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/lib/locking/cluster_locking.c b/lib/locking/cluster_locking.c
> index b031f12..b079195 100644
> --- a/lib/locking/cluster_locking.c
> +++ b/lib/locking/cluster_locking.c
> @@ -317,8 +317,9 @@ static int _lock_for_cluster(struct cmd_context *cmd, unsigned char clvmd_cmd,
> args = alloca(len);
> strcpy(args + 2, name);
>
> - args[0] = flags & 0x7F; /* Maskoff lock flags */
> - args[1] = flags & 0xC0; /* Bitmap flags */
> + /* Maskoff lock flags */
> + args[0] = flags & (LCK_SCOPE_MASK | LCK_TYPE_MASK | LCK_HOLD_MASK);
> + args[1] = flags & LCK_AREA_MASK;
>
> if (mirror_in_sync())
> args[1] |= LCK_MIRROR_NOSYNC_MODE;
> diff --git a/lib/locking/locking.h b/lib/locking/locking.h
> index 50101d1..0dce827 100644
> --- a/lib/locking/locking.h
> +++ b/lib/locking/locking.h
> @@ -78,6 +78,9 @@ int check_lvm1_vg_inactive(struct cmd_context *cmd, const char *vgname);
> /*
> * Lock bits
> */
> +#define LCK_HOLD_MASK 0x00000030U /* NONBLOCK + HOLD bits */
> +#define LCK_AREA_MASK 0x000000C0U /* LOCAL + CLUSTER_VG bits */
Or
#define LCK_HOLD_MASK (LCK_NONBLOCK | LCK_HOLD)
#define LCK_AREA_MASK (LCK_LOCAL | LCK_CLUSTER_VG)
rather.
We should use given definitions.
Heinz
> +
> #define LCK_NONBLOCK 0x00000010U /* Don't block waiting for lock? */
> #define LCK_HOLD 0x00000020U /* Hold lock when lock_vol returns? */
> #define LCK_LOCAL 0x00000040U /* Don't propagate to other nodes */
next prev parent reply other threads:[~2009-12-08 16:38 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-08 15:38 [PATCH 00/10] Fixes related to mirror repair in clustered environment Milan Broz
2009-12-08 15:38 ` [PATCH 01/10] Remove newly created log volume if initial deactivation fails Milan Broz
2009-12-08 15:39 ` [PATCH 02/10] Get rid of hardcoded 0xffdf cluster lock flag Milan Broz
2009-12-08 15:39 ` [PATCH 03/10] Get rid of magic masks in cluster locking code Milan Broz
2009-12-08 16:38 ` Heinz Mauelshagen [this message]
2009-12-08 15:39 ` [PATCH 04/10] Get rid of magic masks in cluster locking code - clvmd part Milan Broz
2009-12-08 15:39 ` [PATCH 05/10] Allow implicit "convert" to the same lock mode Milan Broz
2009-12-08 15:39 ` [PATCH 06/10] Allow manipulation with precommited metadata even when a PV is missing Milan Broz
2009-12-08 15:39 ` [PATCH 07/10] Call explicitly suspend for temporary mirror layer Milan Broz
2009-12-08 15:39 ` [PATCH 08/10] Allow implicit lock conversion for pre/post callbacks Milan Broz
2009-12-08 15:40 ` [PATCH 09/10] Never ever use distributed lock for LV in non-clustered VG Milan Broz
2009-12-08 15:40 ` [PATCH 10/10] Add memlock information to do_lock_lv debug output Milan Broz
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=1260290296.9639.84.camel@o \
--to=heinzm@redhat.com \
--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.