mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-07 00:50:50 +00:00
vfs: assert the lock held in MNT_REF/MNT_REL
Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
f93670b7b9
commit
25c8d940ab
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=351438
|
@ -265,8 +265,12 @@ void __mnt_vnode_markerfree_active(struct vnode **mvp, struct mount *);
|
|||
#define MNT_ITRYLOCK(mp) mtx_trylock(&(mp)->mnt_mtx)
|
||||
#define MNT_IUNLOCK(mp) mtx_unlock(&(mp)->mnt_mtx)
|
||||
#define MNT_MTX(mp) (&(mp)->mnt_mtx)
|
||||
#define MNT_REF(mp) (mp)->mnt_ref++
|
||||
#define MNT_REF(mp) do { \
|
||||
mtx_assert(MNT_MTX(mp), MA_OWNED); \
|
||||
(mp)->mnt_ref++; \
|
||||
} while (0)
|
||||
#define MNT_REL(mp) do { \
|
||||
mtx_assert(MNT_MTX(mp), MA_OWNED); \
|
||||
KASSERT((mp)->mnt_ref > 0, ("negative mnt_ref")); \
|
||||
(mp)->mnt_ref--; \
|
||||
if ((mp)->mnt_ref == 0) \
|
||||
|
|
Loading…
Reference in a new issue