KASSERT that mbuf external reference counts are > 0 before we remove

a reference. (Agreed to by Bosko some time ago).
This commit is contained in:
David Malone 2000-10-08 09:52:50 +00:00
parent 97f1ce758f
commit 854a6f3d1c

View File

@ -283,7 +283,10 @@ struct mcntfree_lst {
*/
#define MEXT_IS_REF(m) ((m)->m_ext.ref_cnt->refcnt > 1)
#define MEXT_REM_REF(m) atomic_subtract_long(&((m)->m_ext.ref_cnt->refcnt), 1)
#define MEXT_REM_REF(m) do { \
KASSERT((m)->m_ext.ref_cnt->refcnt > 0, ("m_ext refcnt < 0")); \
atomic_subtract_long(&((m)->m_ext.ref_cnt->refcnt), 1); \
} while(0)
#define MEXT_ADD_REF(m) atomic_add_long(&((m)->m_ext.ref_cnt->refcnt), 1)