Despite being redundant, the LK_CANRECURSE flag isn't checked anywhere.
Ok?
natano
Index: sys/kern/kern_lock.c
===================================================================
RCS file: /cvs/src/sys/kern/kern_lock.c,v
retrieving revision 1.46
diff -u -p -r1.46 kern_lock.c
--- sys/kern/kern_lock.c 14 Sep 2014 14:17:25 -0000 1.46
+++ sys/kern/kern_lock.c 12 May 2016 08:34:52 -0000
@@ -80,8 +80,6 @@ lockmgr(struct lock *lkp, u_int flags, v
KASSERT(!((flags & (LK_SHARED|LK_EXCLUSIVE)) ==
(LK_SHARED|LK_EXCLUSIVE)));
- KASSERT(!((flags & (LK_CANRECURSE|LK_RECURSEFAIL)) ==
- (LK_CANRECURSE|LK_RECURSEFAIL)));
KASSERT((flags & LK_RELEASE) ||
(flags & (LK_SHARED|LK_EXCLUSIVE|LK_DRAIN)));
Index: sys/kern/vfs_vnops.c
===================================================================
RCS file: /cvs/src/sys/kern/vfs_vnops.c,v
retrieving revision 1.84
diff -u -p -r1.84 vfs_vnops.c
--- sys/kern/vfs_vnops.c 19 Mar 2016 12:04:15 -0000 1.84
+++ sys/kern/vfs_vnops.c 12 May 2016 08:34:52 -0000
@@ -513,9 +513,6 @@ vn_lock(struct vnode *vp, int flags, str
{
int error;
- if ((flags & LK_RECURSEFAIL) == 0)
- flags |= LK_CANRECURSE;
-
do {
if (vp->v_flag & VXLOCK) {
vp->v_flag |= VXWANT;
Index: sys/sys/lock.h
===================================================================
RCS file: /cvs/src/sys/sys/lock.h,v
retrieving revision 1.26
diff -u -p -r1.26 lock.h
--- sys/sys/lock.h 23 Sep 2015 15:37:26 -0000 1.26
+++ sys/sys/lock.h 12 May 2016 08:34:52 -0000
@@ -50,7 +50,6 @@ struct lock {
#define LK_DRAIN 0x04 /* wait for all lock activity to end */
#define LK_RELEASE 0x08 /* release any type of lock */
#define LK_NOWAIT 0x10 /* do not sleep to await lock */
-#define LK_CANRECURSE 0x20 /* allow recursive exclusive lock */
#define LK_RECURSEFAIL 0x40 /* fail if recursive exclusive lock */
#define LK_RETRY 0x80 /* vn_lock: retry until locked */
Index: share/man/man9/lock.9
===================================================================
RCS file: /cvs/src/share/man/man9/lock.9,v
retrieving revision 1.23
diff -u -p -r1.23 lock.9
--- share/man/man9/lock.9 11 Jan 2015 19:34:52 -0000 1.23
+++ share/man/man9/lock.9 12 May 2016 08:34:52 -0000
@@ -83,11 +83,9 @@ Flags to specify the lock behaviour perm
the lock.
Valid lock flags are:
.Pp
-.Bl -tag -width "LK_CANRECURSEXX" -compact
+.Bl -tag -width "LK_NOWAITXX" -compact
.It LK_NOWAIT
Processes should not sleep when attempting to acquire the lock.
-.It LK_CANRECURSE
-Processes can acquire the lock recursively.
.El
.El
.It Fn lockmgr "lock" "flags" "slock"
@@ -110,9 +108,8 @@ Stop further shared-access locks, when t
pending upgrade if it exists, then grant an exclusive-access lock.
Only one exclusive-access lock may exist at a time, except that a
process holding an exclusive-access lock may get additional
-exclusive-access locks if it explicitly sets the LK_CANRECURSE flag in
-the lock request, or if the LK_CANRECURSE flag was set when the lock
-was initialised.
+exclusive-access locks unless the LK_RECURSEFAIL flag was set in the lock
+request.
.It LK_RELEASE
Release one instance of a lock.
.It LK_DRAIN