mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04: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
1 changed files with 5 additions and 1 deletions
|
|
@ -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