From: matthew Date: Wed, 14 Jul 2010 10:31:54 +0000 (+0000) Subject: Eliminate some unused malloc(9) type defines. Also get rid of the X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=36be218ebf71fa0f309e546361e841ff6be61e71;p=openbsd Eliminate some unused malloc(9) type defines. Also get rid of the mysterious and unused mbtypes[] array in mbuf.h. ok tedu@, deraadt@ --- diff --git a/share/man/man9/malloc.9 b/share/man/man9/malloc.9 index 6ee1ffb0b06..549e57efa6b 100644 --- a/share/man/man9/malloc.9 +++ b/share/man/man9/malloc.9 @@ -1,4 +1,4 @@ -.\" $OpenBSD: malloc.9,v 1.45 2010/03/08 21:57:39 oga Exp $ +.\" $OpenBSD: malloc.9,v 1.46 2010/07/14 10:31:54 matthew Exp $ .\" $NetBSD: malloc.9,v 1.2 1996/10/30 05:29:54 lukem Exp $ .\" .\" Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -28,7 +28,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: March 8 2010 $ +.Dd $Mdocdate: July 14 2010 $ .Dt MALLOC 9 .Os .Sh NAME @@ -116,8 +116,6 @@ The following types are currently defined: .Bl -tag -offset indent -width XXXXXXXXXXXXXX -compact .It Dv M_FREE Should be on free list. -.It Dv M_MBUF -Mbuf memory. .It Dv M_DEVBUF Device driver memory. .It Dv M_DEBUG @@ -145,8 +143,6 @@ VFS mount structs. NFS request headers. .It Dv M_NFSMNT NFS mount structures. -.It Dv M_NFSNODE -NFS vnode private part. .It Dv M_VNODE Dynamically allocated vnodes. .It Dv M_CACHE @@ -183,8 +179,6 @@ MFS vnode private part. Export host address structures. .It Dv M_NFSSVC NFS server structures. -.It Dv M_NFSUID -NFS uid mapping structures. .It Dv M_NFSD NFS server daemon structures. .It Dv M_IPMOPTS @@ -245,20 +239,12 @@ data buffers. related credentials. .It Dv M_PACKET_TAGS Packet-attached information tags. -.It Dv M_1394CTL -IEEE 1394 control structures. -.It Dv M_1394DATA -IEEE 1394 data buffers. .It Dv M_EMULDATA Per process emulation data. .It Dv M_IP6OPT IPv6 options. .It Dv M_IP6NDP IPv6 neighbour discovery structures. -.It Dv M_IP6RR -IPv6 router renumbering prefix. -.It Dv M_RR_ADDR -IPv6 router renumbering interface identifiers. .It Dv M_TEMP Miscellaneous temporary data buffers. .It Dv M_NTFSMNT diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index 0d0d9820792..1b6400ce022 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_mbuf.c,v 1.141 2010/07/03 03:33:16 tedu Exp $ */ +/* $OpenBSD: uipc_mbuf.c,v 1.142 2010/07/14 10:31:54 matthew Exp $ */ /* $NetBSD: uipc_mbuf.c,v 1.15.4.1 1996/06/13 17:11:44 cgd Exp $ */ /* @@ -76,7 +76,6 @@ #include #include #include -#define MBTYPES #include #include #include diff --git a/sys/sys/malloc.h b/sys/sys/malloc.h index 31786d0cfd1..f5026ef7a8f 100644 --- a/sys/sys/malloc.h +++ b/sys/sys/malloc.h @@ -1,4 +1,4 @@ -/* $OpenBSD: malloc.h,v 1.96 2009/08/25 17:59:45 miod Exp $ */ +/* $OpenBSD: malloc.h,v 1.97 2010/07/14 10:31:54 matthew Exp $ */ /* $NetBSD: malloc.h,v 1.39 1998/07/12 19:52:01 augustss Exp $ */ /* @@ -61,7 +61,7 @@ * Types of memory to be allocated */ #define M_FREE 0 /* should be on free list */ -#define M_MBUF 1 /* mbuf */ +/* 1 - free */ #define M_DEVBUF 2 /* device driver memory */ #define M_DEBUG 3 /* debug chunk */ #define M_PCB 4 /* protocol control block */ @@ -81,7 +81,7 @@ /* 21 - free */ #define M_NFSREQ 22 /* NFS request header */ #define M_NFSMNT 23 /* NFS mount structure */ -#define M_NFSNODE 24 /* NFS vnode private part */ +/* 24 - free */ #define M_VNODE 25 /* Dynamically allocated vnodes */ #define M_CACHE 26 /* Dynamically allocated cache entries */ #define M_DQUOT 27 /* UFS quota entries */ @@ -104,7 +104,7 @@ /* 47-48 - free */ #define M_NETADDR 49 /* Export host address structure */ #define M_NFSSVC 50 /* Nfs server structure */ -#define M_NFSUID 51 /* Nfs uid mapping structure */ +/* 51 - free */ #define M_NFSD 52 /* Nfs server daemon structure */ #define M_IPMOPTS 53 /* internet multicast options */ #define M_IPMADDR 54 /* internet multicast address */ @@ -145,16 +145,14 @@ /* 109 - free */ #define M_CREDENTIALS 110 /* IPsec-related credentials and ID info */ #define M_PACKET_TAGS 111 /* Packet-attached information */ -#define M_1394CTL 112 /* IEEE 1394 control structures */ -#define M_1394DATA 113 /* IEEE 1394 data buffers */ +/* 112-113 - free */ #define M_EMULDATA 114 /* Per-process emulation data */ /* 115-122 - free */ /* KAME IPv6 */ #define M_IP6OPT 123 /* IPv6 options */ #define M_IP6NDP 124 /* IPv6 Neighbour Discovery */ -#define M_IP6RR 125 /* IPv6 Router Renumbering Prefix */ -#define M_RR_ADDR 126 /* IPv6 Router Renumbering Ifid */ +/* 125-126 - free */ #define M_TEMP 127 /* misc temporary data buffers */ #define M_NTFSMNT 128 /* NTFS mount structure */ @@ -187,7 +185,7 @@ #define INITKMEMNAMES { \ "free", /* 0 M_FREE */ \ - "mbuf", /* 1 M_MBUF */ \ + NULL, \ "devbuf", /* 2 M_DEVBUF */ \ "debug", /* 3 M_DEBUG */ \ "pcb", /* 4 M_PCB */ \ @@ -210,7 +208,7 @@ NULL, \ "NFS req", /* 22 M_NFSREQ */ \ "NFS mount", /* 23 M_NFSMNT */ \ - "NFS node", /* 24 M_NFSNODE */ \ + NULL, \ "vnodes", /* 25 M_VNODE */ \ "namecache", /* 26 M_CACHE */ \ "UFS quota", /* 27 M_DQUOT */ \ @@ -237,7 +235,7 @@ NULL, \ "Export Host", /* 49 M_NETADDR */ \ "NFS srvsock", /* 50 M_NFSSVC */ \ - "NFS uid", /* 51 M_NFSUID */ \ + NULL, \ "NFS daemon", /* 52 M_NFSD */ \ "ip_moptions", /* 53 M_IPMOPTS */ \ "in_multi", /* 54 M_IPMADDR */ \ @@ -289,15 +287,15 @@ NULL, \ "IPsec creds", /* 110 M_CREDENTIALS */ \ "packet tags", /* 111 M_PACKET_TAGS */ \ - "1394ctl", /* 112 M_1394CTL */ \ - "1394data", /* 113 M_1394DATA */ \ + NULL, \ + NULL, \ "emuldata", /* 114 M_EMULDATA */ \ NULL, NULL, NULL, NULL, \ NULL, NULL, NULL, NULL, \ "ip6_options", /* 123 M_IP6OPT */ \ "NDP", /* 124 M_IP6NDP */ \ - "ip6rr", /* 125 M_IP6RR */ \ - "rp_addr", /* 126 M_RR_ADDR */ \ + NULL, \ + NULL, \ "temp", /* 127 M_TEMP */ \ "NTFS mount", /* 128 M_NTFSMNT */ \ "NTFS node", /* 129 M_NTFSNTNODE */ \ diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h index 5b87f72c109..e3a134669da 100644 --- a/sys/sys/mbuf.h +++ b/sys/sys/mbuf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mbuf.h,v 1.141 2010/07/02 02:40:17 blambert Exp $ */ +/* $OpenBSD: mbuf.h,v 1.142 2010/07/14 10:31:54 matthew Exp $ */ /* $NetBSD: mbuf.h,v 1.19 1996/02/09 18:25:14 christos Exp $ */ /* @@ -382,7 +382,6 @@ extern int max_linkhdr; /* largest link-level header */ extern int max_protohdr; /* largest protocol header */ extern int max_hdr; /* largest link+protocol header */ extern int max_datalen; /* MHLEN - max_hdr */ -extern int mbtypes[]; /* XXX */ void mbinit(void); struct mbuf *m_copym2(struct mbuf *, int, int, int); @@ -447,16 +446,4 @@ struct m_tag *m_tag_next(struct mbuf *, struct m_tag *); #define PACKET_TAG_PF_DIVERT 0x0200 /* pf(4) diverted packet */ #define PACKET_TAG_PIPEX 0x0400 /* pipex context XXX */ -#ifdef MBTYPES -int mbtypes[] = { /* XXX */ - M_FREE, /* MT_FREE 0 should be on free list */ - M_MBUF, /* MT_DATA 1 dynamic (data) allocation */ - M_MBUF, /* MT_HEADER 2 packet header */ - M_MBUF, /* MT_SONAME 8 socket name */ - M_SOOPTS, /* MT_SOOPTS 10 socket options */ - M_FTABLE, /* MT_FTABLE 11 fragment reassembly header */ - M_MBUF, /* MT_CONTROL 14 extra-data protocol message */ - M_MBUF, /* MT_OOBDATA 15 expedited data */ -}; -#endif /* MBTYPES */ #endif