Add function and wrapper to switch lockmgr and vnode lock back to
auto-promotion of shared to exclusive. Approved by: re (gjb)
This commit is contained in:
parent
ddbdadae3d
commit
78a27e5e59
@ -418,6 +418,14 @@ lockallowshare(struct lock *lk)
|
|||||||
lk->lock_object.lo_flags &= ~LK_NOSHARE;
|
lk->lock_object.lo_flags &= ~LK_NOSHARE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
lockdisableshare(struct lock *lk)
|
||||||
|
{
|
||||||
|
|
||||||
|
lockmgr_assert(lk, KA_XLOCKED);
|
||||||
|
lk->lock_object.lo_flags |= LK_NOSHARE;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
lockallowrecurse(struct lock *lk)
|
lockallowrecurse(struct lock *lk)
|
||||||
{
|
{
|
||||||
|
@ -77,6 +77,7 @@ void lockallowrecurse(struct lock *lk);
|
|||||||
void lockallowshare(struct lock *lk);
|
void lockallowshare(struct lock *lk);
|
||||||
void lockdestroy(struct lock *lk);
|
void lockdestroy(struct lock *lk);
|
||||||
void lockdisablerecurse(struct lock *lk);
|
void lockdisablerecurse(struct lock *lk);
|
||||||
|
void lockdisableshare(struct lock *lk);
|
||||||
void lockinit(struct lock *lk, int prio, const char *wmesg, int timo,
|
void lockinit(struct lock *lk, int prio, const char *wmesg, int timo,
|
||||||
int flags);
|
int flags);
|
||||||
#ifdef DDB
|
#ifdef DDB
|
||||||
|
@ -428,6 +428,7 @@ extern struct vattr va_null; /* predefined null vattr structure */
|
|||||||
|
|
||||||
#define VN_LOCK_AREC(vp) lockallowrecurse((vp)->v_vnlock)
|
#define VN_LOCK_AREC(vp) lockallowrecurse((vp)->v_vnlock)
|
||||||
#define VN_LOCK_ASHARE(vp) lockallowshare((vp)->v_vnlock)
|
#define VN_LOCK_ASHARE(vp) lockallowshare((vp)->v_vnlock)
|
||||||
|
#define VN_LOCK_DSHARE(vp) lockdisableshare((vp)->v_vnlock)
|
||||||
|
|
||||||
#endif /* _KERNEL */
|
#endif /* _KERNEL */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user