Module Name: src Committed By: maxv Date: Fri Apr 27 16:32:04 UTC 2018
Modified Files: src/sys/kern: uipc_mbuf.c src/sys/sys: mbuf.h Log Message: Remove unused ext_flags field in struct _m_ext_storage. Also, simplify MEXTMALLOC, mbtypes[] doesn't exist anymore, but the code still compiled correctly because "malloc" is a macro and the argument was dropped. To generate a diff of this commit: cvs rdiff -u -r1.207 -r1.208 src/sys/kern/uipc_mbuf.c cvs rdiff -u -r1.196 -r1.197 src/sys/sys/mbuf.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/kern/uipc_mbuf.c diff -u src/sys/kern/uipc_mbuf.c:1.207 src/sys/kern/uipc_mbuf.c:1.208 --- src/sys/kern/uipc_mbuf.c:1.207 Fri Apr 27 16:18:40 2018 +++ src/sys/kern/uipc_mbuf.c Fri Apr 27 16:32:03 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: uipc_mbuf.c,v 1.207 2018/04/27 16:18:40 maxv Exp $ */ +/* $NetBSD: uipc_mbuf.c,v 1.208 2018/04/27 16:32:03 maxv Exp $ */ /* * Copyright (c) 1999, 2001 The NetBSD Foundation, Inc. @@ -62,7 +62,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.207 2018/04/27 16:18:40 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.208 2018/04/27 16:32:03 maxv Exp $"); #ifdef _KERNEL_OPT #include "opt_mbuftrace.h" @@ -588,7 +588,6 @@ m_clget(struct mbuf *m, int nowait) m->m_data = m->m_ext.ext_buf; m->m_flags = (m->m_flags & ~M_EXTCOPYFLAGS) | M_EXT|M_EXT_CLUSTER|M_EXT_RW; - m->m_ext.ext_flags = 0; m->m_ext.ext_size = MCLBYTES; m->m_ext.ext_free = NULL; m->m_ext.ext_arg = NULL; Index: src/sys/sys/mbuf.h diff -u src/sys/sys/mbuf.h:1.196 src/sys/sys/mbuf.h:1.197 --- src/sys/sys/mbuf.h:1.196 Fri Apr 27 09:22:28 2018 +++ src/sys/sys/mbuf.h Fri Apr 27 16:32:03 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: mbuf.h,v 1.196 2018/04/27 09:22:28 maxv Exp $ */ +/* $NetBSD: mbuf.h,v 1.197 2018/04/27 16:32:03 maxv Exp $ */ /* * Copyright (c) 1996, 1997, 1999, 2001, 2007 The NetBSD Foundation, Inc. @@ -259,7 +259,6 @@ struct pkthdr { */ struct _m_ext_storage { unsigned int ext_refcnt; - int ext_flags; char *ext_buf; /* start of buffer */ void (*ext_free) /* free routine if not the usual */ (struct mbuf *, void *, size_t, void *); @@ -511,14 +510,12 @@ do { \ #define MEXTMALLOC(m, size, how) \ do { \ - (m)->m_ext_storage.ext_buf = (char *) \ - malloc((size), mbtypes[(m)->m_type], (how)); \ + (m)->m_ext_storage.ext_buf = malloc((size), 0, (how)); \ if ((m)->m_ext_storage.ext_buf != NULL) { \ MCLINITREFERENCE(m); \ (m)->m_data = (m)->m_ext.ext_buf; \ (m)->m_flags = ((m)->m_flags & ~M_EXTCOPYFLAGS) | \ M_EXT|M_EXT_RW; \ - (m)->m_ext.ext_flags = 0; \ (m)->m_ext.ext_size = (size); \ (m)->m_ext.ext_free = NULL; \ (m)->m_ext.ext_arg = NULL; \ @@ -531,7 +528,6 @@ do { \ MCLINITREFERENCE(m); \ (m)->m_data = (m)->m_ext.ext_buf = (char *)(buf); \ (m)->m_flags = ((m)->m_flags & ~M_EXTCOPYFLAGS) | M_EXT; \ - (m)->m_ext.ext_flags = 0; \ (m)->m_ext.ext_size = (size); \ (m)->m_ext.ext_free = (free); \ (m)->m_ext.ext_arg = (arg); \