svn commit: r281142 - head/sys/sys
Gleb Smirnoff
glebius at FreeBSD.org
Mon Apr 6 09:15:19 UTC 2015
Author: glebius
Date: Mon Apr 6 09:15:18 2015
New Revision: 281142
URL: https://svnweb.freebsd.org/changeset/base/281142
Log:
Convert printfs in m_ext allocator to KASSERTs.
Discussed with: rwatson
Sponsored by: Nginx, Inc.
Modified:
head/sys/sys/mbuf.h
Modified: head/sys/sys/mbuf.h
==============================================================================
--- head/sys/sys/mbuf.h Mon Apr 6 08:37:40 2015 (r281141)
+++ head/sys/sys/mbuf.h Mon Apr 6 09:15:18 2015 (r281142)
@@ -686,8 +686,8 @@ static __inline int
m_clget(struct mbuf *m, int how)
{
- if (m->m_flags & M_EXT)
- printf("%s: %p mbuf already has external storage\n", __func__, m);
+ KASSERT((m->m_flags & M_EXT) == 0, ("%s: mbuf %p has M_EXT",
+ __func__, m));
m->m_ext.ext_buf = (char *)NULL;
uma_zalloc_arg(zone_clust, m, how);
/*
@@ -713,10 +713,11 @@ m_cljget(struct mbuf *m, int how, int si
{
uma_zone_t zone;
- if (m && m->m_flags & M_EXT)
- printf("%s: %p mbuf already has external storage\n", __func__, m);
- if (m != NULL)
+ if (m != NULL) {
+ KASSERT((m->m_flags & M_EXT) == 0, ("%s: mbuf %p has M_EXT",
+ __func__, m));
m->m_ext.ext_buf = NULL;
+ }
zone = m_getzone(size);
return (uma_zalloc_arg(zone, m, how));
More information about the svn-src-all
mailing list