As much as I hate adding more code to lockmgr, the recent rototill
made one incompatible change. We need to preserve the difference
between shared and exclusive locks (only tmpfs seems to care).
Index: kern_rwlock.c
===================================================================
RCS file: /cvs/src/sys/kern/kern_rwlock.c,v
retrieving revision 1.19
diff -u -p -r1.19 kern_rwlock.c
--- kern_rwlock.c 1 May 2013 17:18:55 -0000 1.19
+++ kern_rwlock.c 3 May 2013 13:48:00 -0000
@@ -256,7 +256,11 @@ rw_exit(struct rwlock *rwl)
int
rw_status(struct rwlock *rwl)
{
- return (rwl->rwl_owner != 0L);
+ if (rwl->rwl_owner & RWLOCK_WRLOCK)
+ return RW_WRITE;
+ if (rwl->rwl_owner)
+ return RW_READ;
+ return (0);
}
#ifdef DIAGNOSTIC
Index: kern_lock.c
===================================================================
RCS file: /cvs/src/sys/kern/kern_lock.c,v
retrieving revision 1.41
diff -u -p -r1.41 kern_lock.c
--- kern_lock.c 1 May 2013 17:18:55 -0000 1.41
+++ kern_lock.c 3 May 2013 13:44:54 -0000
@@ -61,7 +61,15 @@ lockinit(struct lock *lkp, int prio, cha
int
lockstatus(struct lock *lkp)
{
- return (rrw_status(&lkp->lk_lck));
+ switch (rrw_status(&lkp->lk_lck)) {
+ case RW_WRITE:
+ return (LK_EXCLUSIVE);
+ case RW_READ:
+ return (LK_SHARED);
+ case 0:
+ default:
+ return (0);
+ }
}
int