Skip to contentSkip to conversation

LVM2/lib/locking cluster_locking.c

PATCH [email protected] 1 participant 1 message Dec 9, 2009

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: mbroz at sourceware.org 2009-12-09 18:28:27

Modified files:
lib/locking : cluster_locking.c

Log message:
Get rid of magic masks in cluster locking code.

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.)

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/cluster_locking.c.diff?cvsroot=lvm2&r1=1.37&r2=1.38

lib/locking/cluster_locking.c +3 -2
@@ -317,8 +317,9 @@
 	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_NONBLOCK | LCK_HOLD); 
+	args[1] = flags & (LCK_LOCAL | LCK_CLUSTER_VG);
 
 	if (mirror_in_sync())
 		args[1] |= LCK_MIRROR_NOSYNC_MODE;