transferlockers() is a very dangerous and hack-ish function as waiters
should never be moved by one lock to another. As, luckily, nothing in our tree is using it, axe the function. This breaks lockmgr KPI, so interested, third-party modules should update their source code with appropriate replacement. Ok'ed by: ups, rwatson MFC after: 3 days
This commit is contained in:
parent
1a94fde847
commit
2c2bebfcb3
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=173876
@ -505,34 +505,6 @@ acquiredrain(struct lock *lkp, int extflags) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Transfer any waiting processes from one lock to another.
|
||||
*/
|
||||
void
|
||||
transferlockers(from, to)
|
||||
struct lock *from;
|
||||
struct lock *to;
|
||||
{
|
||||
|
||||
KASSERT(from != to, ("lock transfer to self"));
|
||||
KASSERT((from->lk_flags&LK_WAITDRAIN) == 0, ("transfer draining lock"));
|
||||
|
||||
mtx_lock(from->lk_interlock);
|
||||
if (from->lk_waitcount == 0) {
|
||||
mtx_unlock(from->lk_interlock);
|
||||
return;
|
||||
}
|
||||
from->lk_newlock = to;
|
||||
wakeup((void *)from);
|
||||
msleep(&from->lk_newlock, from->lk_interlock, from->lk_prio,
|
||||
"lkxfer", 0);
|
||||
from->lk_newlock = NULL;
|
||||
from->lk_flags &= ~(LK_WANT_EXCL | LK_WANT_UPGRADE);
|
||||
KASSERT(from->lk_waitcount == 0, ("active lock"));
|
||||
mtx_unlock(from->lk_interlock);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Initialize a lock; required before use.
|
||||
*/
|
||||
|
@ -204,7 +204,6 @@ void lockdestroy(struct lock *);
|
||||
|
||||
int _lockmgr(struct lock *, u_int flags,
|
||||
struct mtx *, struct thread *p, char *file, int line);
|
||||
void transferlockers(struct lock *, struct lock *);
|
||||
void lockmgr_printinfo(struct lock *);
|
||||
int lockstatus(struct lock *, struct thread *);
|
||||
int lockcount(struct lock *);
|
||||
|
Loading…
Reference in New Issue
Block a user