svn commit: r184205 - in head: . share/man/man9 sys/arm/arm
sys/cam/scsi sys/compat/linux sys/contrib/altq/altq
sys/contrib/ipfilter/netinet sys/dev/ar sys/dev/ce
sys/dev/hwpmc sys/dev/lmc sys/dev/...
Dag-Erling Smorgrav
des at FreeBSD.org
Thu Oct 23 15:53:53 UTC 2008
Author: des
Date: Thu Oct 23 15:53:51 2008
New Revision: 184205
URL: http://svn.freebsd.org/changeset/base/184205
Log:
Retire the MALLOC and FREE macros. They are an abomination unto style(9).
MFC after: 3 months
Modified:
head/Makefile.inc1
head/share/man/man9/Makefile
head/share/man/man9/malloc.9
head/sys/arm/arm/undefined.c
head/sys/cam/scsi/scsi_target.c
head/sys/compat/linux/linux_ioctl.c
head/sys/compat/linux/linux_socket.c
head/sys/compat/linux/linux_util.c
head/sys/contrib/altq/altq/altq_cbq.c
head/sys/contrib/altq/altq/altq_cdnr.c
head/sys/contrib/altq/altq/altq_hfsc.c
head/sys/contrib/altq/altq/altq_priq.c
head/sys/contrib/altq/altq/altq_red.c
head/sys/contrib/altq/altq/altq_rio.c
head/sys/contrib/altq/altq/altq_rmclass.c
head/sys/contrib/altq/altq/altq_subr.c
head/sys/contrib/ipfilter/netinet/ip_compat.h
head/sys/dev/ar/if_ar.c
head/sys/dev/ce/if_ce.c
head/sys/dev/hwpmc/hwpmc_amd.c
head/sys/dev/hwpmc/hwpmc_logging.c
head/sys/dev/hwpmc/hwpmc_mod.c
head/sys/dev/hwpmc/hwpmc_piv.c
head/sys/dev/hwpmc/hwpmc_ppro.c
head/sys/dev/hwpmc/hwpmc_x86.c
head/sys/dev/lmc/if_lmc.c
head/sys/dev/ray/if_ray.c
head/sys/dev/ray/if_rayvar.h
head/sys/dev/sr/if_sr.c
head/sys/dev/usb/udbp.c
head/sys/fs/cd9660/cd9660_node.c
head/sys/fs/cd9660/cd9660_vfsops.c
head/sys/fs/cd9660/cd9660_vnops.c
head/sys/fs/fdescfs/fdesc_vfsops.c
head/sys/fs/fdescfs/fdesc_vnops.c
head/sys/fs/fifofs/fifo_vnops.c
head/sys/fs/hpfs/hpfs_subr.c
head/sys/fs/hpfs/hpfs_vfsops.c
head/sys/fs/hpfs/hpfs_vnops.c
head/sys/fs/msdosfs/msdosfs_denode.c
head/sys/fs/msdosfs/msdosfs_vnops.c
head/sys/fs/ntfs/ntfs_subr.c
head/sys/fs/ntfs/ntfs_vfsops.c
head/sys/fs/ntfs/ntfs_vnops.c
head/sys/fs/nullfs/null_subr.c
head/sys/fs/nullfs/null_vnops.c
head/sys/fs/nwfs/nwfs_node.c
head/sys/fs/nwfs/nwfs_vfsops.c
head/sys/fs/portalfs/portal_vfsops.c
head/sys/fs/portalfs/portal_vnops.c
head/sys/fs/pseudofs/pseudofs.c
head/sys/fs/pseudofs/pseudofs_vncache.c
head/sys/fs/smbfs/smbfs_node.c
head/sys/fs/smbfs/smbfs_vfsops.c
head/sys/fs/udf/udf_vfsops.c
head/sys/fs/udf/udf_vnops.c
head/sys/fs/unionfs/union_subr.c
head/sys/gnu/fs/ext2fs/ext2_inode.c
head/sys/gnu/fs/ext2fs/ext2_lookup.c
head/sys/gnu/fs/ext2fs/ext2_vfsops.c
head/sys/gnu/fs/reiserfs/reiserfs_inode.c
head/sys/gnu/fs/reiserfs/reiserfs_vfsops.c
head/sys/i386/i386/sys_machdep.c
head/sys/ia64/ia64/sscdisk.c
head/sys/kern/kern_descrip.c
head/sys/kern/kern_event.c
head/sys/kern/kern_jail.c
head/sys/kern/kern_linker.c
head/sys/kern/kern_mtxpool.c
head/sys/kern/kern_proc.c
head/sys/kern/kern_prot.c
head/sys/kern/kern_resource.c
head/sys/kern/subr_blist.c
head/sys/kern/subr_witness.c
head/sys/kern/uipc_accf.c
head/sys/kern/uipc_mqueue.c
head/sys/kern/uipc_syscalls.c
head/sys/kern/uipc_usrreq.c
head/sys/kern/vfs_export.c
head/sys/kern/vfs_syscalls.c
head/sys/net/bpf.c
head/sys/net/bsd_comp.c
head/sys/net/if.c
head/sys/net/if_arcsubr.c
head/sys/net/if_ethersubr.c
head/sys/net/if_fddisubr.c
head/sys/net/if_iso88025subr.c
head/sys/net/if_ppp.c
head/sys/net/if_sl.c
head/sys/net/if_tap.c
head/sys/net/if_tun.c
head/sys/net/ppp_deflate.c
head/sys/net/rtsock.c
head/sys/net80211/ieee80211_acl.c
head/sys/net80211/ieee80211_crypto_ccmp.c
head/sys/net80211/ieee80211_crypto_tkip.c
head/sys/net80211/ieee80211_crypto_wep.c
head/sys/net80211/ieee80211_freebsd.c
head/sys/net80211/ieee80211_hostap.c
head/sys/net80211/ieee80211_input.c
head/sys/net80211/ieee80211_ioctl.c
head/sys/net80211/ieee80211_node.c
head/sys/net80211/ieee80211_power.c
head/sys/net80211/ieee80211_proto.c
head/sys/net80211/ieee80211_scan.c
head/sys/net80211/ieee80211_scan_sta.c
head/sys/net80211/ieee80211_sta.c
head/sys/netatalk/ddp_pcb.c
head/sys/netgraph/atm/sscfu/ng_sscfu_cust.h
head/sys/netgraph/bluetooth/drivers/h4/ng_h4.c
head/sys/netgraph/bluetooth/hci/ng_hci_main.c
head/sys/netgraph/bluetooth/hci/ng_hci_misc.c
head/sys/netgraph/bluetooth/l2cap/ng_l2cap_main.c
head/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
head/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.h
head/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c
head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c
head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c
head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c
head/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c
head/sys/netgraph/netflow/netflow.c
head/sys/netgraph/netflow/ng_netflow.c
head/sys/netgraph/netgraph.h
head/sys/netgraph/ng_UI.c
head/sys/netgraph/ng_async.c
head/sys/netgraph/ng_atmllc.c
head/sys/netgraph/ng_base.c
head/sys/netgraph/ng_bpf.c
head/sys/netgraph/ng_bridge.c
head/sys/netgraph/ng_cisco.c
head/sys/netgraph/ng_device.c
head/sys/netgraph/ng_eiface.c
head/sys/netgraph/ng_etf.c
head/sys/netgraph/ng_ether.c
head/sys/netgraph/ng_fec.c
head/sys/netgraph/ng_frame_relay.c
head/sys/netgraph/ng_gif.c
head/sys/netgraph/ng_gif_demux.c
head/sys/netgraph/ng_hole.c
head/sys/netgraph/ng_iface.c
head/sys/netgraph/ng_ipfw.c
head/sys/netgraph/ng_ksocket.c
head/sys/netgraph/ng_l2tp.c
head/sys/netgraph/ng_lmi.c
head/sys/netgraph/ng_message.h
head/sys/netgraph/ng_mppc.c
head/sys/netgraph/ng_nat.c
head/sys/netgraph/ng_one2many.c
head/sys/netgraph/ng_parse.c
head/sys/netgraph/ng_pipe.c
head/sys/netgraph/ng_ppp.c
head/sys/netgraph/ng_pptpgre.c
head/sys/netgraph/ng_rfc1490.c
head/sys/netgraph/ng_sample.c
head/sys/netgraph/ng_split.c
head/sys/netgraph/ng_sppp.c
head/sys/netgraph/ng_tag.c
head/sys/netgraph/ng_tcpmss.c
head/sys/netgraph/ng_tee.c
head/sys/netgraph/ng_tty.c
head/sys/netgraph/ng_vjc.c
head/sys/netgraph/ng_vlan.c
head/sys/netinet/igmp.c
head/sys/netinet/in_mcast.c
head/sys/netinet/in_pcb.c
head/sys/netinet/ip_carp.c
head/sys/netinet/sctp_os_bsd.h
head/sys/netinet/tcp_syncache.c
head/sys/netinet6/in6.c
head/sys/netinet6/in6_pcb.c
head/sys/netinet6/in6_src.c
head/sys/netinet6/raw_ip6.c
head/sys/netipsec/keysock.c
head/sys/netipsec/xform_ah.c
head/sys/netipx/ipx_pcb.c
head/sys/netipx/spx_usrreq.c
head/sys/netnatm/natm.c
head/sys/netnatm/natm_pcb.c
head/sys/netncp/ncp_conn.c
head/sys/netncp/ncp_rq.c
head/sys/netncp/ncp_sock.c
head/sys/netncp/ncp_subr.c
head/sys/netsmb/smb_rq.c
head/sys/netsmb/smb_trantcp.c
head/sys/nfs4client/nfs4_dev.c
head/sys/nfs4client/nfs4_idmap.c
head/sys/nfs4client/nfs4_socket.c
head/sys/nfs4client/nfs4_vfsops.c
head/sys/nfs4client/nfs4_vn_subs.c
head/sys/nfs4client/nfs4_vnops.c
head/sys/nfsclient/krpc_subr.c
head/sys/nfsclient/nfs_lock.c
head/sys/nfsclient/nfs_node.c
head/sys/nfsclient/nfs_socket.c
head/sys/nfsclient/nfs_subs.c
head/sys/nfsclient/nfs_vfsops.c
head/sys/nfsclient/nfs_vnops.c
head/sys/nfsserver/nfs_serv.c
head/sys/nfsserver/nfs_srvcache.c
head/sys/nfsserver/nfs_srvsock.c
head/sys/nfsserver/nfs_syscalls.c
head/sys/opencrypto/cryptodev.c
head/sys/opencrypto/cryptosoft.c
head/sys/opencrypto/deflate.c
head/sys/opencrypto/xform.c
head/sys/rpc/rpcclnt.c
head/sys/security/mac_bsdextended/mac_bsdextended.c
head/sys/security/mac_lomac/mac_lomac.c
head/sys/sys/malloc.h
head/sys/sys/param.h
head/sys/ufs/ffs/ffs_inode.c
head/sys/ufs/ffs/ffs_snapshot.c
head/sys/ufs/ffs/ffs_softdep.c
head/sys/ufs/ffs/ffs_vfsops.c
head/sys/ufs/ufs/ufs_dirhash.c
head/sys/ufs/ufs/ufs_extattr.c
head/sys/ufs/ufs/ufs_vnops.c
Modified: head/Makefile.inc1
==============================================================================
--- head/Makefile.inc1 Thu Oct 23 15:44:00 2008 (r184204)
+++ head/Makefile.inc1 Thu Oct 23 15:53:51 2008 (r184205)
@@ -758,11 +758,14 @@ buildkernel:
@echo "--------------------------------------------------------------"
cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} ${CLEANDIR}
.endif
+.if !defined(NO_KERNELOBJ)
@echo
@echo "--------------------------------------------------------------"
@echo ">>> stage 2.2: rebuilding the object tree"
@echo "--------------------------------------------------------------"
cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} obj
+.endif
+.if !defined(NO_KERNELTOOLS)
@echo
@echo "--------------------------------------------------------------"
@echo ">>> stage 2.3: build tools"
@@ -779,6 +782,7 @@ buildkernel:
${MAKE} -DWITHOUT_SSP -DNO_CPU_CFLAGS -DNO_CTF ${target}
.endfor
.endif
+.endif
.if !defined(NO_KERNELDEPEND)
@echo
@echo "--------------------------------------------------------------"
Modified: head/share/man/man9/Makefile
==============================================================================
--- head/share/man/man9/Makefile Thu Oct 23 15:44:00 2008 (r184204)
+++ head/share/man/man9/Makefile Thu Oct 23 15:53:51 2008 (r184205)
@@ -741,9 +741,7 @@ MLINKS+=LOCK_PROFILING.9 MUTEX_PROFILING
MLINKS+=make_dev.9 destroy_dev.9 \
make_dev.9 dev_depends.9 \
make_dev.9 make_dev_alias.9
-MLINKS+=malloc.9 FREE.9 \
- malloc.9 free.9 \
- malloc.9 MALLOC.9 \
+MLINKS+=malloc.9 free.9 \
malloc.9 MALLOC_DECLARE.9 \
malloc.9 MALLOC_DEFINE.9 \
malloc.9 realloc.9 \
Modified: head/share/man/man9/malloc.9
==============================================================================
--- head/share/man/man9/malloc.9 Thu Oct 23 15:44:00 2008 (r184204)
+++ head/share/man/man9/malloc.9 Thu Oct 23 15:53:51 2008 (r184205)
@@ -36,14 +36,12 @@
.\" $NetBSD: malloc.9,v 1.3 1996/11/11 00:05:11 lukem Exp $
.\" $FreeBSD$
.\"
-.Dd June 12, 2003
+.Dd October 23, 2008
.Dt MALLOC 9
.Os
.Sh NAME
.Nm malloc ,
-.Nm MALLOC ,
.Nm free ,
-.Nm FREE ,
.Nm realloc ,
.Nm reallocf ,
.Nm MALLOC_DEFINE ,
@@ -54,10 +52,8 @@
.In sys/malloc.h
.Ft void *
.Fn malloc "unsigned long size" "struct malloc_type *type" "int flags"
-.Fn MALLOC space cast "unsigned long size" "struct malloc_type *type" "int flags"
.Ft void
.Fn free "void *addr" "struct malloc_type *type"
-.Fn FREE "void *addr" "struct malloc_type *type"
.Ft void *
.Fn realloc "void *addr" "unsigned long size" "struct malloc_type *type" "int flags"
.Ft void *
@@ -123,20 +119,6 @@ function is identical to
except that it
will free the passed pointer when the requested memory cannot be allocated.
.Pp
-The
-.Fn MALLOC
-macro variant is functionally equivalent to
-.Bd -literal -offset indent
-(space) = (cast)malloc((u_long)(size), type, flags)
-.Ed
-.Pp
-and the
-.Fn FREE
-macro variant is equivalent to
-.Bd -literal -offset indent
-free((addr), type)
-.Ed
-.Pp
Unlike its standard C library counterpart
.Pq Xr malloc 3 ,
the kernel version takes two more arguments.
@@ -219,7 +201,7 @@ MALLOC_DEFINE(M_FOOBUF, "foobuffers", "B
/* sys/something/foo_subr.c */
\&...
-MALLOC(buf, struct foo_buf *, sizeof *buf, M_FOOBUF, M_NOWAIT);
+buf = malloc(sizeof *buf, M_FOOBUF, M_NOWAIT);
.Ed
.Pp
Modified: head/sys/arm/arm/undefined.c
==============================================================================
--- head/sys/arm/arm/undefined.c Thu Oct 23 15:44:00 2008 (r184204)
+++ head/sys/arm/arm/undefined.c Thu Oct 23 15:53:51 2008 (r184205)
@@ -106,7 +106,7 @@ install_coproc_handler(int coproc, undef
KASSERT(handler != NULL, ("handler is NULL")); /* Used to be legal. */
/* XXX: M_TEMP??? */
- MALLOC(uh, struct undefined_handler *, sizeof(*uh), M_TEMP, M_WAITOK);
+ uh = malloc(sizeof(*uh), M_TEMP, M_WAITOK);
uh->uh_handler = handler;
install_coproc_handler_static(coproc, uh);
return uh;
@@ -125,7 +125,7 @@ remove_coproc_handler(void *cookie)
struct undefined_handler *uh = cookie;
LIST_REMOVE(uh, uh_link);
- FREE(uh, M_TEMP);
+ free(uh, M_TEMP);
}
Modified: head/sys/cam/scsi/scsi_target.c
==============================================================================
--- head/sys/cam/scsi/scsi_target.c Thu Oct 23 15:44:00 2008 (r184204)
+++ head/sys/cam/scsi/scsi_target.c Thu Oct 23 15:53:51 2008 (r184205)
@@ -183,7 +183,7 @@ targopen(struct cdev *dev, int flags, in
make_dev(&targ_cdevsw, dev2unit(dev), UID_ROOT, GID_WHEEL, 0600,
"targ%d", dev2unit(dev));
}
- MALLOC(softc, struct targ_softc *, sizeof(*softc), M_TARG,
+ softc = malloc(sizeof(*softc), M_TARG,
M_WAITOK | M_ZERO);
dev->si_drv1 = softc;
softc->state = TARG_STATE_OPENED;
@@ -211,7 +211,7 @@ targclose(struct cdev *dev, int flag, in
if ((softc->periph == NULL) ||
(softc->state & TARG_STATE_LUN_ENABLED) == 0) {
destroy_dev(dev);
- FREE(softc, M_TARG);
+ free(softc, M_TARG);
return (0);
}
@@ -230,7 +230,7 @@ targclose(struct cdev *dev, int flag, in
softc->periph = NULL;
}
destroy_dev(dev);
- FREE(softc, M_TARG);
+ free(softc, M_TARG);
}
cam_periph_unlock(periph);
cam_periph_release(periph);
@@ -531,7 +531,7 @@ targdtor(struct cam_periph *periph)
}
while ((descr = TAILQ_FIRST(&softc->abort_queue)) != NULL) {
TAILQ_REMOVE(&softc->abort_queue, descr, tqe);
- FREE(descr, M_TARG);
+ free(descr, M_TARG);
}
softc->periph = NULL;
@@ -966,7 +966,7 @@ targgetccb(struct targ_softc *softc, xpt
int ccb_len;
ccb_len = targccblen(type);
- MALLOC(ccb, union ccb *, ccb_len, M_TARG, M_WAITOK);
+ ccb = malloc(ccb_len, M_TARG, M_WAITOK);
CAM_DEBUG(softc->path, CAM_DEBUG_PERIPH, ("getccb %p\n", ccb));
xpt_setup_ccb(&ccb->ccb_h, softc->path, priority);
@@ -981,13 +981,13 @@ targfreeccb(struct targ_softc *softc, un
{
CAM_DEBUG_PRINT(CAM_DEBUG_PERIPH, ("targfreeccb descr %p and\n",
ccb->ccb_h.targ_descr));
- FREE(ccb->ccb_h.targ_descr, M_TARG);
+ free(ccb->ccb_h.targ_descr, M_TARG);
switch (ccb->ccb_h.func_code) {
case XPT_ACCEPT_TARGET_IO:
case XPT_IMMED_NOTIFY:
CAM_DEBUG_PRINT(CAM_DEBUG_PERIPH, ("freeing ccb %p\n", ccb));
- FREE(ccb, M_TARG);
+ free(ccb, M_TARG);
break;
default:
/* Send back CCB if we got it from the periph */
@@ -998,7 +998,7 @@ targfreeccb(struct targ_softc *softc, un
} else {
CAM_DEBUG_PRINT(CAM_DEBUG_PERIPH,
("freeing ccb %p\n", ccb));
- FREE(ccb, M_TARG);
+ free(ccb, M_TARG);
}
break;
}
@@ -1009,7 +1009,7 @@ targgetdescr(struct targ_softc *softc)
{
struct targ_cmd_descr *descr;
- MALLOC(descr, struct targ_cmd_descr *, sizeof(*descr), M_TARG,
+ descr = malloc(sizeof(*descr), M_TARG,
M_WAITOK);
descr->mapinfo.num_bufs_used = 0;
return (descr);
Modified: head/sys/compat/linux/linux_ioctl.c
==============================================================================
--- head/sys/compat/linux/linux_ioctl.c Thu Oct 23 15:44:00 2008 (r184204)
+++ head/sys/compat/linux/linux_ioctl.c Thu Oct 23 15:53:51 2008 (r184205)
@@ -2673,7 +2673,7 @@ linux_ioctl_register_handler(struct linu
break;
}
if (he == NULL) {
- MALLOC(he, struct handler_element *, sizeof(*he),
+ he = malloc(sizeof(*he),
M_LINUX, M_WAITOK);
he->func = h->func;
} else
@@ -2711,7 +2711,7 @@ linux_ioctl_unregister_handler(struct li
if (he->func == h->func) {
TAILQ_REMOVE(&handlers, he, list);
sx_xunlock(&linux_ioctl_sx);
- FREE(he, M_LINUX);
+ free(he, M_LINUX);
return (0);
}
}
Modified: head/sys/compat/linux/linux_socket.c
==============================================================================
--- head/sys/compat/linux/linux_socket.c Thu Oct 23 15:44:00 2008 (r184204)
+++ head/sys/compat/linux/linux_socket.c Thu Oct 23 15:53:51 2008 (r184205)
@@ -120,7 +120,7 @@ do_sa_get(struct sockaddr **sap, const s
}
#endif
- MALLOC(kosa, struct osockaddr *, alloclen, mtype, M_WAITOK);
+ kosa = malloc(alloclen, mtype, M_WAITOK);
if ((error = copyin(osa, kosa, *osalen)))
goto out;
@@ -168,7 +168,7 @@ do_sa_get(struct sockaddr **sap, const s
return (0);
out:
- FREE(kosa, mtype);
+ free(kosa, mtype);
return (error);
}
@@ -458,7 +458,7 @@ linux_sendit(struct thread *td, int s, s
bad:
if (to)
- FREE(to, M_SONAME);
+ free(to, M_SONAME);
return (error);
}
Modified: head/sys/compat/linux/linux_util.c
==============================================================================
--- head/sys/compat/linux/linux_util.c Thu Oct 23 15:44:00 2008 (r184204)
+++ head/sys/compat/linux/linux_util.c Thu Oct 23 15:53:51 2008 (r184205)
@@ -165,7 +165,7 @@ linux_get_char_devices()
char formated[256];
int current_size = 0, string_size = 1024;
- MALLOC(string, char *, string_size, M_LINUX, M_WAITOK);
+ string = malloc(string_size, M_LINUX, M_WAITOK);
string[0] = '\000';
last = "";
TAILQ_FOREACH(de, &devices, list) {
@@ -181,10 +181,10 @@ linux_get_char_devices()
if (strlen(formated) + current_size
>= string_size) {
string_size *= 2;
- MALLOC(string, char *, string_size,
+ string = malloc(string_size,
M_LINUX, M_WAITOK);
bcopy(temp, string, current_size);
- FREE(temp, M_LINUX);
+ free(temp, M_LINUX);
}
strcat(string, formated);
current_size = strlen(string);
@@ -197,7 +197,7 @@ linux_get_char_devices()
void
linux_free_get_char_devices(char *string)
{
- FREE(string, M_LINUX);
+ free(string, M_LINUX);
}
static int linux_major_starting = 200;
@@ -210,7 +210,7 @@ linux_device_register_handler(struct lin
if (d == NULL)
return (EINVAL);
- MALLOC(de, struct device_element *, sizeof(*de),
+ de = malloc(sizeof(*de),
M_LINUX, M_WAITOK);
if (d->linux_major < 0) {
d->linux_major = linux_major_starting++;
@@ -234,7 +234,7 @@ linux_device_unregister_handler(struct l
TAILQ_FOREACH(de, &devices, list) {
if (bcmp(d, &de->entry, sizeof(*d)) == 0) {
TAILQ_REMOVE(&devices, de, list);
- FREE(de, M_LINUX);
+ free(de, M_LINUX);
return (0);
}
}
Modified: head/sys/contrib/altq/altq/altq_cbq.c
==============================================================================
--- head/sys/contrib/altq/altq/altq_cbq.c Thu Oct 23 15:44:00 2008 (r184204)
+++ head/sys/contrib/altq/altq/altq_cbq.c Thu Oct 23 15:53:51 2008 (r184205)
@@ -273,7 +273,7 @@ cbq_add_altq(struct pf_altq *a)
return (ENODEV);
/* allocate and initialize cbq_state_t */
- MALLOC(cbqp, cbq_state_t *, sizeof(cbq_state_t), M_DEVBUF, M_WAITOK);
+ cbqp = malloc(sizeof(cbq_state_t), M_DEVBUF, M_WAITOK);
if (cbqp == NULL)
return (ENOMEM);
bzero(cbqp, sizeof(cbq_state_t));
@@ -304,7 +304,7 @@ cbq_remove_altq(struct pf_altq *a)
cbq_class_destroy(cbqp, cbqp->ifnp.root_);
/* deallocate cbq_state_t */
- FREE(cbqp, M_DEVBUF);
+ free(cbqp, M_DEVBUF);
return (0);
}
@@ -927,7 +927,7 @@ cbq_ifattach(ifacep)
return (ENXIO);
/* allocate and initialize cbq_state_t */
- MALLOC(new_cbqp, cbq_state_t *, sizeof(cbq_state_t), M_DEVBUF, M_WAITOK);
+ new_cbqp = malloc(sizeof(cbq_state_t), M_DEVBUF, M_WAITOK);
if (new_cbqp == NULL)
return (ENOMEM);
bzero(new_cbqp, sizeof(cbq_state_t));
@@ -943,7 +943,7 @@ cbq_ifattach(ifacep)
cbq_enqueue, cbq_dequeue, cbq_request,
&new_cbqp->cbq_classifier, acc_classify);
if (error) {
- FREE(new_cbqp, M_DEVBUF);
+ free(new_cbqp, M_DEVBUF);
return (error);
}
@@ -987,7 +987,7 @@ cbq_ifdetach(ifacep)
}
/* deallocate cbq_state_t */
- FREE(cbqp, M_DEVBUF);
+ free(cbqp, M_DEVBUF);
return (0);
}
Modified: head/sys/contrib/altq/altq/altq_cdnr.c
==============================================================================
--- head/sys/contrib/altq/altq/altq_cdnr.c Thu Oct 23 15:44:00 2008 (r184204)
+++ head/sys/contrib/altq/altq/altq_cdnr.c Thu Oct 23 15:53:51 2008 (r184205)
@@ -274,7 +274,7 @@ cdnr_cballoc(top, type, input_func)
return (NULL);
}
- MALLOC(cb, struct cdnr_block *, size, M_DEVBUF, M_WAITOK);
+ cb = malloc(size, M_DEVBUF, M_WAITOK);
if (cb == NULL)
return (NULL);
bzero(cb, size);
@@ -319,7 +319,7 @@ cdnr_cbdestroy(cblock)
if (cb->cb_top != cblock)
LIST_REMOVE(cb, cb_next);
- FREE(cb, M_DEVBUF);
+ free(cb, M_DEVBUF);
}
/*
Modified: head/sys/contrib/altq/altq/altq_hfsc.c
==============================================================================
--- head/sys/contrib/altq/altq/altq_hfsc.c Thu Oct 23 15:44:00 2008 (r184204)
+++ head/sys/contrib/altq/altq/altq_hfsc.c Thu Oct 23 15:53:51 2008 (r184205)
@@ -202,7 +202,7 @@ hfsc_add_altq(struct pf_altq *a)
if (!ALTQ_IS_READY(&ifp->if_snd))
return (ENODEV);
- MALLOC(hif, struct hfsc_if *, sizeof(struct hfsc_if),
+ hif = malloc(sizeof(struct hfsc_if),
M_DEVBUF, M_WAITOK);
if (hif == NULL)
return (ENOMEM);
@@ -210,7 +210,7 @@ hfsc_add_altq(struct pf_altq *a)
hif->hif_eligible = ellist_alloc();
if (hif->hif_eligible == NULL) {
- FREE(hif, M_DEVBUF);
+ free(hif, M_DEVBUF);
return (ENOMEM);
}
@@ -236,7 +236,7 @@ hfsc_remove_altq(struct pf_altq *a)
ellist_destroy(hif->hif_eligible);
- FREE(hif, M_DEVBUF);
+ free(hif, M_DEVBUF);
return (0);
}
@@ -404,13 +404,13 @@ hfsc_class_create(struct hfsc_if *hif, s
}
#endif
- MALLOC(cl, struct hfsc_class *, sizeof(struct hfsc_class),
+ cl = malloc(sizeof(struct hfsc_class),
M_DEVBUF, M_WAITOK);
if (cl == NULL)
return (NULL);
bzero(cl, sizeof(struct hfsc_class));
- MALLOC(cl->cl_q, class_queue_t *, sizeof(class_queue_t),
+ cl->cl_q = malloc(sizeof(class_queue_t),
M_DEVBUF, M_WAITOK);
if (cl->cl_q == NULL)
goto err_ret;
@@ -471,8 +471,7 @@ hfsc_class_create(struct hfsc_if *hif, s
#endif /* ALTQ_RED */
if (rsc != NULL && (rsc->m1 != 0 || rsc->m2 != 0)) {
- MALLOC(cl->cl_rsc, struct internal_sc *,
- sizeof(struct internal_sc), M_DEVBUF, M_WAITOK);
+ cl->cl_rsc = malloc( sizeof(struct internal_sc), M_DEVBUF, M_WAITOK);
if (cl->cl_rsc == NULL)
goto err_ret;
sc2isc(rsc, cl->cl_rsc);
@@ -480,16 +479,14 @@ hfsc_class_create(struct hfsc_if *hif, s
rtsc_init(&cl->cl_eligible, cl->cl_rsc, 0, 0);
}
if (fsc != NULL && (fsc->m1 != 0 || fsc->m2 != 0)) {
- MALLOC(cl->cl_fsc, struct internal_sc *,
- sizeof(struct internal_sc), M_DEVBUF, M_WAITOK);
+ cl->cl_fsc = malloc( sizeof(struct internal_sc), M_DEVBUF, M_WAITOK);
if (cl->cl_fsc == NULL)
goto err_ret;
sc2isc(fsc, cl->cl_fsc);
rtsc_init(&cl->cl_virtual, cl->cl_fsc, 0, 0);
}
if (usc != NULL && (usc->m1 != 0 || usc->m2 != 0)) {
- MALLOC(cl->cl_usc, struct internal_sc *,
- sizeof(struct internal_sc), M_DEVBUF, M_WAITOK);
+ cl->cl_usc = malloc( sizeof(struct internal_sc), M_DEVBUF, M_WAITOK);
if (cl->cl_usc == NULL)
goto err_ret;
sc2isc(usc, cl->cl_usc);
@@ -565,14 +562,14 @@ hfsc_class_create(struct hfsc_if *hif, s
#endif
}
if (cl->cl_fsc != NULL)
- FREE(cl->cl_fsc, M_DEVBUF);
+ free(cl->cl_fsc, M_DEVBUF);
if (cl->cl_rsc != NULL)
- FREE(cl->cl_rsc, M_DEVBUF);
+ free(cl->cl_rsc, M_DEVBUF);
if (cl->cl_usc != NULL)
- FREE(cl->cl_usc, M_DEVBUF);
+ free(cl->cl_usc, M_DEVBUF);
if (cl->cl_q != NULL)
- FREE(cl->cl_q, M_DEVBUF);
- FREE(cl, M_DEVBUF);
+ free(cl->cl_q, M_DEVBUF);
+ free(cl, M_DEVBUF);
return (NULL);
}
@@ -649,13 +646,13 @@ hfsc_class_destroy(struct hfsc_class *cl
IFQ_UNLOCK(cl->cl_hif->hif_ifq);
if (cl->cl_usc != NULL)
- FREE(cl->cl_usc, M_DEVBUF);
+ free(cl->cl_usc, M_DEVBUF);
if (cl->cl_fsc != NULL)
- FREE(cl->cl_fsc, M_DEVBUF);
+ free(cl->cl_fsc, M_DEVBUF);
if (cl->cl_rsc != NULL)
- FREE(cl->cl_rsc, M_DEVBUF);
- FREE(cl->cl_q, M_DEVBUF);
- FREE(cl, M_DEVBUF);
+ free(cl->cl_rsc, M_DEVBUF);
+ free(cl->cl_q, M_DEVBUF);
+ free(cl, M_DEVBUF);
return (0);
}
@@ -1203,7 +1200,7 @@ ellist_alloc(void)
{
ellist_t *head;
- MALLOC(head, ellist_t *, sizeof(ellist_t), M_DEVBUF, M_WAITOK);
+ head = malloc(sizeof(ellist_t), M_DEVBUF, M_WAITOK);
TAILQ_INIT(head);
return (head);
}
@@ -1211,7 +1208,7 @@ ellist_alloc(void)
static void
ellist_destroy(ellist_t *head)
{
- FREE(head, M_DEVBUF);
+ free(head, M_DEVBUF);
}
static void
@@ -1306,7 +1303,7 @@ actlist_alloc(void)
{
actlist_t *head;
- MALLOC(head, actlist_t *, sizeof(actlist_t), M_DEVBUF, M_WAITOK);
+ head = malloc(sizeof(actlist_t), M_DEVBUF, M_WAITOK);
TAILQ_INIT(head);
return (head);
}
@@ -1314,7 +1311,7 @@ actlist_alloc(void)
static void
actlist_destroy(actlist_t *head)
{
- FREE(head, M_DEVBUF);
+ free(head, M_DEVBUF);
}
static void
actlist_insert(struct hfsc_class *cl)
@@ -1743,7 +1740,7 @@ hfsc_attach(ifq, bandwidth)
{
struct hfsc_if *hif;
- MALLOC(hif, struct hfsc_if *, sizeof(struct hfsc_if),
+ hif = malloc(sizeof(struct hfsc_if),
M_DEVBUF, M_WAITOK);
if (hif == NULL)
return (NULL);
@@ -1751,7 +1748,7 @@ hfsc_attach(ifq, bandwidth)
hif->hif_eligible = ellist_alloc();
if (hif->hif_eligible == NULL) {
- FREE(hif, M_DEVBUF);
+ free(hif, M_DEVBUF);
return NULL;
}
@@ -1787,7 +1784,7 @@ hfsc_detach(hif)
ellist_destroy(hif->hif_eligible);
- FREE(hif, M_DEVBUF);
+ free(hif, M_DEVBUF);
return (0);
}
@@ -1804,22 +1801,19 @@ hfsc_class_modify(cl, rsc, fsc, usc)
rsc_tmp = fsc_tmp = usc_tmp = NULL;
if (rsc != NULL && (rsc->m1 != 0 || rsc->m2 != 0) &&
cl->cl_rsc == NULL) {
- MALLOC(rsc_tmp, struct internal_sc *,
- sizeof(struct internal_sc), M_DEVBUF, M_WAITOK);
+ rsc_tmp = malloc( sizeof(struct internal_sc), M_DEVBUF, M_WAITOK);
if (rsc_tmp == NULL)
return (ENOMEM);
}
if (fsc != NULL && (fsc->m1 != 0 || fsc->m2 != 0) &&
cl->cl_fsc == NULL) {
- MALLOC(fsc_tmp, struct internal_sc *,
- sizeof(struct internal_sc), M_DEVBUF, M_WAITOK);
+ fsc_tmp = malloc( sizeof(struct internal_sc), M_DEVBUF, M_WAITOK);
if (fsc_tmp == NULL)
return (ENOMEM);
}
if (usc != NULL && (usc->m1 != 0 || usc->m2 != 0) &&
cl->cl_usc == NULL) {
- MALLOC(usc_tmp, struct internal_sc *,
- sizeof(struct internal_sc), M_DEVBUF, M_WAITOK);
+ usc_tmp = malloc( sizeof(struct internal_sc), M_DEVBUF, M_WAITOK);
if (usc_tmp == NULL)
return (ENOMEM);
}
@@ -1837,7 +1831,7 @@ hfsc_class_modify(cl, rsc, fsc, usc)
if (cl->cl_rsc != NULL) {
if (!qempty(cl->cl_q))
hfsc_purgeq(cl);
- FREE(cl->cl_rsc, M_DEVBUF);
+ free(cl->cl_rsc, M_DEVBUF);
cl->cl_rsc = NULL;
}
} else {
@@ -1859,7 +1853,7 @@ hfsc_class_modify(cl, rsc, fsc, usc)
if (cl->cl_fsc != NULL) {
if (!qempty(cl->cl_q))
hfsc_purgeq(cl);
- FREE(cl->cl_fsc, M_DEVBUF);
+ free(cl->cl_fsc, M_DEVBUF);
cl->cl_fsc = NULL;
}
} else {
@@ -1874,7 +1868,7 @@ hfsc_class_modify(cl, rsc, fsc, usc)
if (usc != NULL) {
if (usc->m1 == 0 && usc->m2 == 0) {
if (cl->cl_usc != NULL) {
- FREE(cl->cl_usc, M_DEVBUF);
+ free(cl->cl_usc, M_DEVBUF);
cl->cl_usc = NULL;
cl->cl_myf = 0;
}
Modified: head/sys/contrib/altq/altq/altq_priq.c
==============================================================================
--- head/sys/contrib/altq/altq/altq_priq.c Thu Oct 23 15:44:00 2008 (r184204)
+++ head/sys/contrib/altq/altq/altq_priq.c Thu Oct 23 15:53:51 2008 (r184205)
@@ -134,7 +134,7 @@ priq_add_altq(struct pf_altq *a)
if (!ALTQ_IS_READY(&ifp->if_snd))
return (ENODEV);
- MALLOC(pif, struct priq_if *, sizeof(struct priq_if),
+ pif = malloc(sizeof(struct priq_if),
M_DEVBUF, M_WAITOK);
if (pif == NULL)
return (ENOMEM);
@@ -160,7 +160,7 @@ priq_remove_altq(struct pf_altq *a)
(void)priq_clear_interface(pif);
- FREE(pif, M_DEVBUF);
+ free(pif, M_DEVBUF);
return (0);
}
@@ -320,13 +320,13 @@ priq_class_create(struct priq_if *pif, i
red_destroy(cl->cl_red);
#endif
} else {
- MALLOC(cl, struct priq_class *, sizeof(struct priq_class),
+ cl = malloc(sizeof(struct priq_class),
M_DEVBUF, M_WAITOK);
if (cl == NULL)
return (NULL);
bzero(cl, sizeof(struct priq_class));
- MALLOC(cl->cl_q, class_queue_t *, sizeof(class_queue_t),
+ cl->cl_q = malloc(sizeof(class_queue_t),
M_DEVBUF, M_WAITOK);
if (cl->cl_q == NULL)
goto err_ret;
@@ -397,8 +397,8 @@ priq_class_create(struct priq_if *pif, i
#endif
}
if (cl->cl_q != NULL)
- FREE(cl->cl_q, M_DEVBUF);
- FREE(cl, M_DEVBUF);
+ free(cl->cl_q, M_DEVBUF);
+ free(cl, M_DEVBUF);
return (NULL);
}
@@ -447,8 +447,8 @@ priq_class_destroy(struct priq_class *cl
red_destroy(cl->cl_red);
#endif
}
- FREE(cl->cl_q, M_DEVBUF);
- FREE(cl, M_DEVBUF);
+ free(cl->cl_q, M_DEVBUF);
+ free(cl, M_DEVBUF);
return (0);
}
@@ -666,7 +666,7 @@ priq_attach(ifq, bandwidth)
{
struct priq_if *pif;
- MALLOC(pif, struct priq_if *, sizeof(struct priq_if),
+ pif = malloc(sizeof(struct priq_if),
M_DEVBUF, M_WAITOK);
if (pif == NULL)
return (NULL);
@@ -702,7 +702,7 @@ priq_detach(pif)
ASSERT(p != NULL);
}
- FREE(pif, M_DEVBUF);
+ free(pif, M_DEVBUF);
return (0);
}
Modified: head/sys/contrib/altq/altq/altq_red.c
==============================================================================
--- head/sys/contrib/altq/altq/altq_red.c Thu Oct 23 15:44:00 2008 (r184204)
+++ head/sys/contrib/altq/altq/altq_red.c Thu Oct 23 15:53:51 2008 (r184205)
@@ -233,7 +233,7 @@ red_alloc(int weight, int inv_pmax, int
int w, i;
int npkts_per_sec;
- MALLOC(rp, red_t *, sizeof(red_t), M_DEVBUF, M_WAITOK);
+ rp = malloc(sizeof(red_t), M_DEVBUF, M_WAITOK);
if (rp == NULL)
return (NULL);
bzero(rp, sizeof(red_t));
@@ -321,7 +321,7 @@ red_destroy(red_t *rp)
#endif
#endif /* ALTQ3_COMPAT */
wtab_destroy(rp->red_wtab);
- FREE(rp, M_DEVBUF);
+ free(rp, M_DEVBUF);
}
void
@@ -646,7 +646,7 @@ wtab_alloc(int weight)
return (w);
}
- MALLOC(w, struct wtab *, sizeof(struct wtab), M_DEVBUF, M_WAITOK);
+ w = malloc(sizeof(struct wtab), M_DEVBUF, M_WAITOK);
if (w == NULL)
panic("wtab_alloc: malloc failed!");
bzero(w, sizeof(struct wtab));
@@ -682,7 +682,7 @@ wtab_destroy(struct wtab *w)
break;
}
- FREE(w, M_DEVBUF);
+ free(w, M_DEVBUF);
return (0);
}
@@ -816,17 +816,17 @@ redioctl(dev, cmd, addr, flag, p)
}
/* allocate and initialize red_queue_t */
- MALLOC(rqp, red_queue_t *, sizeof(red_queue_t), M_DEVBUF, M_WAITOK);
+ rqp = malloc(sizeof(red_queue_t), M_DEVBUF, M_WAITOK);
if (rqp == NULL) {
error = ENOMEM;
break;
}
bzero(rqp, sizeof(red_queue_t));
- MALLOC(rqp->rq_q, class_queue_t *, sizeof(class_queue_t),
+ rqp->rq_q = malloc(sizeof(class_queue_t),
M_DEVBUF, M_WAITOK);
if (rqp->rq_q == NULL) {
- FREE(rqp, M_DEVBUF);
+ free(rqp, M_DEVBUF);
error = ENOMEM;
break;
}
@@ -834,8 +834,8 @@ redioctl(dev, cmd, addr, flag, p)
rqp->rq_red = red_alloc(0, 0, 0, 0, 0, 0);
if (rqp->rq_red == NULL) {
- FREE(rqp->rq_q, M_DEVBUF);
- FREE(rqp, M_DEVBUF);
+ free(rqp->rq_q, M_DEVBUF);
+ free(rqp, M_DEVBUF);
error = ENOMEM;
break;
}
@@ -854,8 +854,8 @@ redioctl(dev, cmd, addr, flag, p)
NULL, NULL);
if (error) {
red_destroy(rqp->rq_red);
- FREE(rqp->rq_q, M_DEVBUF);
- FREE(rqp, M_DEVBUF);
+ free(rqp->rq_q, M_DEVBUF);
+ free(rqp, M_DEVBUF);
break;
}
@@ -1016,8 +1016,8 @@ red_detach(rqp)
}
red_destroy(rqp->rq_red);
- FREE(rqp->rq_q, M_DEVBUF);
- FREE(rqp, M_DEVBUF);
+ free(rqp->rq_q, M_DEVBUF);
+ free(rqp, M_DEVBUF);
return (error);
}
@@ -1297,16 +1297,16 @@ fv_alloc(rp)
int i, num;
num = FV_FLOWLISTSIZE;
- MALLOC(fv, struct flowvalve *, sizeof(struct flowvalve),
+ fv = malloc(sizeof(struct flowvalve),
M_DEVBUF, M_WAITOK);
if (fv == NULL)
return (NULL);
bzero(fv, sizeof(struct flowvalve));
- MALLOC(fv->fv_fves, struct fve *, sizeof(struct fve) * num,
+ fv->fv_fves = malloc(sizeof(struct fve) * num,
M_DEVBUF, M_WAITOK);
if (fv->fv_fves == NULL) {
- FREE(fv, M_DEVBUF);
+ free(fv, M_DEVBUF);
return (NULL);
}
bzero(fv->fv_fves, sizeof(struct fve) * num);
@@ -1323,11 +1323,11 @@ fv_alloc(rp)
fv->fv_pthresh = (FV_PSCALE(1) << FP_SHIFT) / rp->red_inv_pmax;
/* initialize drop rate to fraction table */
- MALLOC(fv->fv_p2ftab, int *, sizeof(int) * BRTT_SIZE,
+ fv->fv_p2ftab = malloc(sizeof(int) * BRTT_SIZE,
M_DEVBUF, M_WAITOK);
if (fv->fv_p2ftab == NULL) {
- FREE(fv->fv_fves, M_DEVBUF);
- FREE(fv, M_DEVBUF);
+ free(fv->fv_fves, M_DEVBUF);
+ free(fv, M_DEVBUF);
return (NULL);
}
/*
@@ -1348,9 +1348,9 @@ fv_alloc(rp)
static void fv_destroy(fv)
struct flowvalve *fv;
{
- FREE(fv->fv_p2ftab, M_DEVBUF);
- FREE(fv->fv_fves, M_DEVBUF);
- FREE(fv, M_DEVBUF);
+ free(fv->fv_p2ftab, M_DEVBUF);
+ free(fv->fv_fves, M_DEVBUF);
+ free(fv, M_DEVBUF);
}
static __inline int
Modified: head/sys/contrib/altq/altq/altq_rio.c
==============================================================================
--- head/sys/contrib/altq/altq/altq_rio.c Thu Oct 23 15:44:00 2008 (r184204)
+++ head/sys/contrib/altq/altq/altq_rio.c Thu Oct 23 15:53:51 2008 (r184205)
@@ -206,7 +206,7 @@ rio_alloc(int weight, struct redparams *
int w, i;
int npkts_per_sec;
- MALLOC(rp, rio_t *, sizeof(rio_t), M_DEVBUF, M_WAITOK);
+ rp = malloc(sizeof(rio_t), M_DEVBUF, M_WAITOK);
if (rp == NULL)
return (NULL);
bzero(rp, sizeof(rio_t));
@@ -293,7 +293,7 @@ void
rio_destroy(rio_t *rp)
{
wtab_destroy(rp->rio_wtab);
- FREE(rp, M_DEVBUF);
+ free(rp, M_DEVBUF);
}
void
@@ -572,17 +572,17 @@ rioioctl(dev, cmd, addr, flag, p)
}
/* allocate and initialize rio_queue_t */
- MALLOC(rqp, rio_queue_t *, sizeof(rio_queue_t), M_DEVBUF, M_WAITOK);
+ rqp = malloc(sizeof(rio_queue_t), M_DEVBUF, M_WAITOK);
if (rqp == NULL) {
error = ENOMEM;
break;
}
bzero(rqp, sizeof(rio_queue_t));
- MALLOC(rqp->rq_q, class_queue_t *, sizeof(class_queue_t),
+ rqp->rq_q = malloc(sizeof(class_queue_t),
M_DEVBUF, M_WAITOK);
if (rqp->rq_q == NULL) {
- FREE(rqp, M_DEVBUF);
+ free(rqp, M_DEVBUF);
error = ENOMEM;
break;
}
@@ -590,8 +590,8 @@ rioioctl(dev, cmd, addr, flag, p)
rqp->rq_rio = rio_alloc(0, NULL, 0, 0);
if (rqp->rq_rio == NULL) {
- FREE(rqp->rq_q, M_DEVBUF);
- FREE(rqp, M_DEVBUF);
+ free(rqp->rq_q, M_DEVBUF);
+ free(rqp, M_DEVBUF);
error = ENOMEM;
break;
}
@@ -610,8 +610,8 @@ rioioctl(dev, cmd, addr, flag, p)
NULL, NULL);
if (error) {
rio_destroy(rqp->rq_rio);
- FREE(rqp->rq_q, M_DEVBUF);
- FREE(rqp, M_DEVBUF);
+ free(rqp->rq_q, M_DEVBUF);
+ free(rqp, M_DEVBUF);
break;
}
@@ -759,8 +759,8 @@ rio_detach(rqp)
}
rio_destroy(rqp->rq_rio);
- FREE(rqp->rq_q, M_DEVBUF);
- FREE(rqp, M_DEVBUF);
+ free(rqp->rq_q, M_DEVBUF);
+ free(rqp, M_DEVBUF);
return (error);
}
Modified: head/sys/contrib/altq/altq/altq_rmclass.c
==============================================================================
--- head/sys/contrib/altq/altq/altq_rmclass.c Thu Oct 23 15:44:00 2008 (r184204)
+++ head/sys/contrib/altq/altq/altq_rmclass.c Thu Oct 23 15:53:51 2008 (r184205)
@@ -220,16 +220,16 @@ rmc_newclass(int pri, struct rm_ifdat *i
}
#endif
- MALLOC(cl, struct rm_class *, sizeof(struct rm_class),
+ cl = malloc(sizeof(struct rm_class),
M_DEVBUF, M_WAITOK);
if (cl == NULL)
return (NULL);
bzero(cl, sizeof(struct rm_class));
CALLOUT_INIT(&cl->callout_);
- MALLOC(cl->q_, class_queue_t *, sizeof(class_queue_t),
+ cl->q_ = malloc(sizeof(class_queue_t),
M_DEVBUF, M_WAITOK);
if (cl->q_ == NULL) {
- FREE(cl, M_DEVBUF);
+ free(cl, M_DEVBUF);
return (NULL);
}
bzero(cl->q_, sizeof(class_queue_t));
@@ -658,8 +658,8 @@ rmc_delete_class(struct rm_ifdat *ifd, s
red_destroy(cl->red_);
#endif
}
- FREE(cl->q_, M_DEVBUF);
- FREE(cl, M_DEVBUF);
+ free(cl->q_, M_DEVBUF);
+ free(cl, M_DEVBUF);
}
Modified: head/sys/contrib/altq/altq/altq_subr.c
==============================================================================
--- head/sys/contrib/altq/altq/altq_subr.c Thu Oct 23 15:44:00 2008 (r184204)
+++ head/sys/contrib/altq/altq/altq_subr.c Thu Oct 23 15:53:51 2008 (r184205)
@@ -397,13 +397,13 @@ tbr_set(ifq, profile)
return (ENOENT);
}
ifq->altq_tbr = NULL;
- FREE(tbr, M_DEVBUF);
+ free(tbr, M_DEVBUF);
IFQ_UNLOCK(ifq);
return (0);
}
IFQ_UNLOCK(ifq);
- MALLOC(tbr, struct tb_regulator *, sizeof(struct tb_regulator),
+ tbr = malloc(sizeof(struct tb_regulator),
M_DEVBUF, M_WAITOK);
if (tbr == NULL) { /* can not happen */
IFQ_UNLOCK(ifq);
@@ -426,7 +426,7 @@ tbr_set(ifq, profile)
ifq->altq_tbr = tbr; /* set the new tbr */
if (otbr != NULL)
- FREE(otbr, M_DEVBUF);
+ free(otbr, M_DEVBUF);
else {
if (tbr_timer == 0) {
CALLOUT_RESET(&tbr_callout, 1, tbr_timeout, (void *)0);
@@ -1402,7 +1402,7 @@ acc_add_filter(classifier, filter, class
return (EINVAL);
#endif
- MALLOC(afp, struct acc_filter *, sizeof(struct acc_filter),
+ afp = malloc(sizeof(struct acc_filter),
M_DEVBUF, M_WAITOK);
if (afp == NULL)
return (ENOMEM);
@@ -1529,7 +1529,7 @@ acc_delete_filter(classifier, handle)
LIST_REMOVE(afp, f_chain);
splx(s);
- FREE(afp, M_DEVBUF);
+ free(afp, M_DEVBUF);
/* todo: update filt_bmask */
@@ -1559,7 +1559,7 @@ acc_discard_filters(classifier, class, a
LIST_FOREACH(afp, &classifier->acc_filters[i], f_chain)
if (all || afp->f_class == class) {
LIST_REMOVE(afp, f_chain);
- FREE(afp, M_DEVBUF);
+ free(afp, M_DEVBUF);
/* start again from the head */
break;
}
@@ -1981,7 +1981,7 @@ ip4f_init(void)
TAILQ_INIT(&ip4f_list);
for (i=0; i<IP4F_TABSIZE; i++) {
- MALLOC(fp, struct ip4_frag *, sizeof(struct ip4_frag),
+ fp = malloc(sizeof(struct ip4_frag),
M_DEVBUF, M_NOWAIT);
if (fp == NULL) {
printf("ip4f_init: can't alloc %dth entry!\n", i);
Modified: head/sys/contrib/ipfilter/netinet/ip_compat.h
==============================================================================
--- head/sys/contrib/ipfilter/netinet/ip_compat.h Thu Oct 23 15:44:00 2008 (r184204)
+++ head/sys/contrib/ipfilter/netinet/ip_compat.h Thu Oct 23 15:53:51 2008 (r184205)
@@ -1662,12 +1662,23 @@ MALLOC_DECLARE(M_IPFILTER);
# endif /* M_IPFILTER */
# endif /* M_PFIL */
# endif /* IPFILTER_M_IPFILTER */
-# define KMALLOC(a, b) MALLOC((a), b, sizeof(*(a)), _M_IPF, M_NOWAIT)
-# if !defined(KMALLOCS)
-# define KMALLOCS(a, b, c) MALLOC((a), b, (c), _M_IPF, M_NOWAIT)
+# if defined(__FreeBSD__) && __FreeBSD_version >= 800051
+# define KMALLOC(a, b) do { \
+ a = (b)malloc(sizeof(*(a)), _M_IPF, M_NOWAIT); \
+ } while (0)
+# define KMALLOCS(a, b, c) do { \
+ a = (b)malloc((c), _M_IPF, ((c) > 4096) ? M_WAITOK : M_NOWAIT); \
+ } while (0)
+# define KFREE(x) free((x), _M_IPF)
+# define KFREES(x,s) free((x), _M_IPF)
+# else
+# define KMALLOC(a, b) MALLOC((a), b, sizeof(*(a)), _M_IPF, M_NOWAIT)
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
More information about the svn-src-head
mailing list