Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/vnode.h
Show First 20 Lines • Show All 432 Lines • ▼ Show 20 Lines | |||||
extern struct mount *rootdevmp; /* "/dev" mount */ | extern struct mount *rootdevmp; /* "/dev" mount */ | ||||
extern int desiredvnodes; /* number of vnodes desired */ | extern int desiredvnodes; /* number of vnodes desired */ | ||||
extern struct uma_zone *namei_zone; | extern struct uma_zone *namei_zone; | ||||
extern struct vattr va_null; /* predefined null vattr structure */ | extern struct vattr va_null; /* predefined null vattr structure */ | ||||
#define VI_LOCK(vp) mtx_lock(&(vp)->v_interlock) | #define VI_LOCK(vp) mtx_lock(&(vp)->v_interlock) | ||||
#define VI_LOCK_FLAGS(vp, flags) mtx_lock_flags(&(vp)->v_interlock, (flags)) | #define VI_LOCK_FLAGS(vp, flags) mtx_lock_flags(&(vp)->v_interlock, (flags)) | ||||
#define VI_TRYLOCK(vp) mtx_trylock(&(vp)->v_interlock) | #define VI_TRYLOCK(vp) mtx_trylock(&(vp)->v_interlock) | ||||
/* | |||||
* To be used when the OP is useful to do, but likely enough to fail that it | |||||
* makes sense to pre-read the lock first (and consequently avoid dirtying | |||||
* the cache line). | |||||
*/ | |||||
#define VI_TRYLOCK_CONTENDED(vp) ({ \ | |||||
int _rv; \ | |||||
if (mtx_owner(VI_MTX(vp)) != NULL) \ | |||||
_rv = 0; \ | |||||
else \ | |||||
_rv = mtx_trylock(&(vp)->v_interlock); \ | |||||
_rv; \ | |||||
}) | |||||
#define VI_UNLOCK(vp) mtx_unlock(&(vp)->v_interlock) | #define VI_UNLOCK(vp) mtx_unlock(&(vp)->v_interlock) | ||||
#define VI_MTX(vp) (&(vp)->v_interlock) | #define VI_MTX(vp) (&(vp)->v_interlock) | ||||
#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) | #define VN_LOCK_DSHARE(vp) lockdisableshare((vp)->v_vnlock) | ||||
#endif /* _KERNEL */ | #endif /* _KERNEL */ | ||||
▲ Show 20 Lines • Show All 504 Lines • Show Last 20 Lines |