Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.

Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
This commit is contained in:
alfred 2003-01-21 08:56:16 +00:00
parent d20b9f1f76
commit 8f5153c3ea
591 changed files with 2123 additions and 2122 deletions

View File

@ -358,7 +358,7 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int flags,
if ((dmat->maxsize <= PAGE_SIZE) && dmat->lowaddr >= ptoa(Maxmem)) {
*vaddr = malloc(dmat->maxsize, M_DEVBUF,
(flags & BUS_DMA_NOWAIT) ? M_NOWAIT : M_WAITOK);
(flags & BUS_DMA_NOWAIT) ? M_NOWAIT : 0);
} else {
/*
* XXX Use Contigmalloc until it is merged into this facility
@ -366,7 +366,7 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int flags,
* multi-seg allocations yet though.
*/
*vaddr = contigmalloc(dmat->maxsize, M_DEVBUF,
(flags & BUS_DMA_NOWAIT) ? M_NOWAIT : M_WAITOK,
(flags & BUS_DMA_NOWAIT) ? M_NOWAIT : 0,
0ul, dmat->lowaddr, dmat->alignment? dmat->alignment : 1ul,
dmat->boundary);
}

View File

@ -112,7 +112,7 @@ exec_osf1_imgact(struct image_params *imgp)
printf("unknown ecoff magic %x\n", eap->magic);
return ENOEXEC;
}
osf_auxargs = malloc(sizeof(Osf_Auxargs), M_TEMP, M_WAITOK | M_ZERO);
osf_auxargs = malloc(sizeof(Osf_Auxargs), M_TEMP, M_ZERO);
imgp->auxargs = osf_auxargs;
osf_auxargs->executable = osf_auxargs->exec_path;
path_not_saved = copyinstr(imgp->fname, osf_auxargs->executable,
@ -135,7 +135,7 @@ exec_osf1_imgact(struct image_params *imgp)
* page of the loader.
*/
ndp = (struct nameidata *)malloc(sizeof(struct nameidata),
M_TEMP, M_WAITOK);
M_TEMP, 0);
NDINIT(ndp, LOOKUP, LOCKLEAF | FOLLOW | SAVENAME, UIO_SYSSPACE,
"/compat/osf1/sbin/loader",
FIRST_THREAD_IN_PROC(imgp->proc));
@ -218,7 +218,7 @@ exec_osf1_imgact(struct image_params *imgp)
raw_dend = (eap->data_start + eap->dsize);
if (dend > raw_dend) {
caddr_t zeros;
zeros = malloc(dend-raw_dend,M_TEMP,M_WAITOK|M_ZERO);
zeros = malloc(dend-raw_dend, M_TEMP, M_ZERO);
if ((error = copyout(zeros, (caddr_t)raw_dend,
dend-raw_dend))) {
uprintf("Can't zero start of bss, error %d\n",error);

View File

@ -121,7 +121,7 @@ osf1_emul_find(td, sgp, prefix, path, pbuf, cflag)
struct vattr vat;
struct vattr vatroot;
buf = (char *) malloc(MAXPATHLEN, M_TEMP, M_WAITOK);
buf = (char *) malloc(MAXPATHLEN, M_TEMP, 0);
*pbuf = path;
for (ptr = buf; (*ptr = *prefix) != '\0'; ptr++, prefix++)
@ -1181,8 +1181,8 @@ osf1_readv(td, uap)
osize = uap->iovcnt * sizeof (struct osf1_iovec);
nsize = uap->iovcnt * sizeof (struct iovec);
oio = malloc(osize, M_TEMP, M_WAITOK);
nio = malloc(nsize, M_TEMP, M_WAITOK);
oio = malloc(osize, M_TEMP, 0);
nio = malloc(nsize, M_TEMP, 0);
error = 0;
if ((error = copyin(uap->iovp, oio, osize)))
@ -1230,8 +1230,8 @@ osf1_writev(td, uap)
osize = uap->iovcnt * sizeof (struct osf1_iovec);
nsize = uap->iovcnt * sizeof (struct iovec);
oio = malloc(osize, M_TEMP, M_WAITOK);
nio = malloc(nsize, M_TEMP, M_WAITOK);
oio = malloc(osize, M_TEMP, 0);
nio = malloc(nsize, M_TEMP, 0);
error = 0;
if ((error = copyin(uap->iovp, oio, osize)))

View File

@ -557,7 +557,7 @@ i686_mrinit(struct mem_range_softc *sc)
sc->mr_desc =
(struct mem_range_desc *)malloc(nmdesc * sizeof(struct mem_range_desc),
M_MEMDESC, M_WAITOK | M_ZERO);
M_MEMDESC, M_ZERO);
sc->mr_ndesc = nmdesc;
mrd = sc->mr_desc;

View File

@ -388,7 +388,7 @@ bios16(struct bios_args *args, char *fmt, ...)
/*
* no page table, so create one and install it.
*/
pte = (pt_entry_t *)malloc(PAGE_SIZE, M_TEMP, M_WAITOK);
pte = (pt_entry_t *)malloc(PAGE_SIZE, M_TEMP, 0);
ptd = (pd_entry_t *)((u_int)ptd + KERNBASE);
*ptd = vtophys(pte) | PG_RW | PG_V;
} else {

View File

@ -339,7 +339,7 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int flags,
if ((dmat->maxsize <= PAGE_SIZE) && dmat->lowaddr >= ptoa(Maxmem)) {
*vaddr = malloc(dmat->maxsize, M_DEVBUF,
(flags & BUS_DMA_NOWAIT) ? M_NOWAIT : M_WAITOK);
(flags & BUS_DMA_NOWAIT) ? M_NOWAIT : 0);
} else {
/*
* XXX Use Contigmalloc until it is merged into this facility
@ -347,7 +347,7 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int flags,
* multi-seg allocations yet though.
*/
*vaddr = contigmalloc(dmat->maxsize, M_DEVBUF,
(flags & BUS_DMA_NOWAIT) ? M_NOWAIT : M_WAITOK,
(flags & BUS_DMA_NOWAIT) ? M_NOWAIT : 0,
0ul, dmat->lowaddr, dmat->alignment? dmat->alignment : 1ul,
dmat->boundary);
}

View File

@ -265,7 +265,7 @@ mmioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct thread *td)
if (nd > 0) {
md = (struct mem_range_desc *)
malloc(nd * sizeof(struct mem_range_desc),
M_MEMDESC, M_WAITOK);
M_MEMDESC, 0);
error = mem_range_attr_get(md, &nd);
if (!error)
error = copyout(md, mo->mo_desc,
@ -279,7 +279,7 @@ mmioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct thread *td)
case MEMRANGE_SET:
md = (struct mem_range_desc *)malloc(sizeof(struct mem_range_desc),
M_MEMDESC, M_WAITOK);
M_MEMDESC, 0);
error = copyin(mo->mo_desc, md, sizeof(struct mem_range_desc));
/* clamp description string */
md->mr_owner[sizeof(md->mr_owner) - 1] = 0;

View File

@ -919,13 +919,13 @@ mptable_pass2(void)
pgeflag = 0; /* XXX - Not used under SMP yet. */
MALLOC(io_apic_versions, u_int32_t *, sizeof(u_int32_t) * mp_napics,
M_DEVBUF, M_WAITOK);
M_DEVBUF, 0);
MALLOC(ioapic, volatile ioapic_t **, sizeof(ioapic_t *) * mp_napics,
M_DEVBUF, M_WAITOK);
M_DEVBUF, 0);
MALLOC(io_apic_ints, io_int *, sizeof(io_int) * (nintrs + 1),
M_DEVBUF, M_WAITOK);
M_DEVBUF, 0);
MALLOC(bus_data, bus_datum *, sizeof(bus_datum) * mp_nbusses,
M_DEVBUF, M_WAITOK);
M_DEVBUF, 0);
bzero(ioapic, sizeof(ioapic_t *) * mp_napics);

View File

@ -919,13 +919,13 @@ mptable_pass2(void)
pgeflag = 0; /* XXX - Not used under SMP yet. */
MALLOC(io_apic_versions, u_int32_t *, sizeof(u_int32_t) * mp_napics,
M_DEVBUF, M_WAITOK);
M_DEVBUF, 0);
MALLOC(ioapic, volatile ioapic_t **, sizeof(ioapic_t *) * mp_napics,
M_DEVBUF, M_WAITOK);
M_DEVBUF, 0);
MALLOC(io_apic_ints, io_int *, sizeof(io_int) * (nintrs + 1),
M_DEVBUF, M_WAITOK);
M_DEVBUF, 0);
MALLOC(bus_data, bus_datum *, sizeof(bus_datum) * mp_nbusses,
M_DEVBUF, M_WAITOK);
M_DEVBUF, 0);
bzero(ioapic, sizeof(ioapic_t *) * mp_napics);

View File

@ -298,7 +298,7 @@ user_ldt_alloc(struct mdproc *mdp, int len)
mtx_unlock_spin(&sched_lock);
mtx_assert(&sched_lock, MA_NOTOWNED);
MALLOC(new_ldt, struct proc_ldt *, sizeof(struct proc_ldt),
M_SUBPROC, M_WAITOK);
M_SUBPROC, 0);
new_ldt->ldt_len = len = NEW_MAX_LD(len);
new_ldt->ldt_base = (caddr_t)kmem_alloc(kernel_map,

View File

@ -106,7 +106,7 @@ ia32_emul_find(td, sgp, prefix, path, pbuf, cflag)
struct vattr vat;
struct vattr vatroot;
buf = (char *) malloc(MAXPATHLEN, M_TEMP, M_WAITOK);
buf = (char *) malloc(MAXPATHLEN, M_TEMP, 0);
*pbuf = path;
for (ptr = buf; (*ptr = *prefix) != '\0'; ptr++, prefix++)
@ -769,8 +769,8 @@ ia32_readv(struct thread *td, struct ia32_readv_args *uap)
osize = uap->iovcnt * sizeof (struct iovec32);
nsize = uap->iovcnt * sizeof (struct iovec);
oio = malloc(osize, M_TEMP, M_WAITOK);
nio = malloc(nsize, M_TEMP, M_WAITOK);
oio = malloc(osize, M_TEMP, 0);
nio = malloc(nsize, M_TEMP, 0);
error = 0;
if ((error = copyin(uap->iovp, oio, osize)))
@ -815,8 +815,8 @@ ia32_writev(struct thread *td, struct ia32_writev_args *uap)
osize = uap->iovcnt * sizeof (struct iovec32);
nsize = uap->iovcnt * sizeof (struct iovec);
oio = malloc(osize, M_TEMP, M_WAITOK);
nio = malloc(nsize, M_TEMP, M_WAITOK);
oio = malloc(osize, M_TEMP, 0);
nio = malloc(nsize, M_TEMP, 0);
error = 0;
if ((error = copyin(uap->iovp, oio, osize)))

View File

@ -919,13 +919,13 @@ mptable_pass2(void)
pgeflag = 0; /* XXX - Not used under SMP yet. */
MALLOC(io_apic_versions, u_int32_t *, sizeof(u_int32_t) * mp_napics,
M_DEVBUF, M_WAITOK);
M_DEVBUF, 0);
MALLOC(ioapic, volatile ioapic_t **, sizeof(ioapic_t *) * mp_napics,
M_DEVBUF, M_WAITOK);
M_DEVBUF, 0);
MALLOC(io_apic_ints, io_int *, sizeof(io_int) * (nintrs + 1),
M_DEVBUF, M_WAITOK);
M_DEVBUF, 0);
MALLOC(bus_data, bus_datum *, sizeof(bus_datum) * mp_nbusses,
M_DEVBUF, M_WAITOK);
M_DEVBUF, 0);
bzero(ioapic, sizeof(ioapic_t *) * mp_napics);

View File

@ -89,7 +89,7 @@ periphdriver_register(void *data)
int ndrivers;
ndrivers = nperiph_drivers + 2;
newdrivers = malloc(sizeof(*newdrivers) * ndrivers, M_TEMP, M_WAITOK);
newdrivers = malloc(sizeof(*newdrivers) * ndrivers, M_TEMP, 0);
if (periph_drivers)
bcopy(periph_drivers, newdrivers,
sizeof(*newdrivers) * nperiph_drivers);

View File

@ -67,7 +67,7 @@ cam_sim_alloc(sim_action_func sim_action, sim_poll_func sim_poll,
*/
if (strcmp(sim_name, "xpt") == 0)
sim = (struct cam_sim *)malloc(sizeof(struct cam_sim),
M_DEVBUF, M_WAITOK);
M_DEVBUF, 0);
else
sim = (struct cam_sim *)malloc(sizeof(struct cam_sim),
M_DEVBUF, M_NOWAIT);

View File

@ -4804,7 +4804,7 @@ xpt_alloc_ccb()
{
union ccb *new_ccb;
new_ccb = malloc(sizeof(*new_ccb), M_DEVBUF, M_WAITOK);
new_ccb = malloc(sizeof(*new_ccb), M_DEVBUF, 0);
return (new_ccb);
}
@ -5169,7 +5169,7 @@ xpt_scan_bus(struct cam_periph *periph, union ccb *request_ccb)
/* Save some state for use while we probe for devices */
scan_info = (xpt_scan_bus_info *)
malloc(sizeof(xpt_scan_bus_info), M_TEMP, M_WAITOK);
malloc(sizeof(xpt_scan_bus_info), M_TEMP, 0);
scan_info->request_ccb = request_ccb;
scan_info->cpi = &work_ccb->cpi;

View File

@ -1788,7 +1788,7 @@ cdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
struct cd_mode_data *data;
data = malloc(sizeof(struct cd_mode_data), M_TEMP,
M_WAITOK);
0);
CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE,
("trying to do CDIOCPLAYTRACKS\n"));
@ -1822,7 +1822,7 @@ cdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
struct cd_mode_data *data;
data = malloc(sizeof(struct cd_mode_data), M_TEMP,
M_WAITOK);
0);
CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE,
("trying to do CDIOCPLAYMSF\n"));
@ -1857,7 +1857,7 @@ cdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
("trying to do CDIOCPLAYBLOCKS\n"));
data = malloc(sizeof(struct cd_mode_data), M_TEMP,
M_WAITOK);
0);
error = cdgetmode(periph, data, AUDIO_PAGE);
if (error) {
@ -1884,7 +1884,7 @@ cdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
("trying to do CDIOCREADSUBCHANNEL\n"));
data = malloc(sizeof(struct cd_sub_channel_info),
M_TEMP, M_WAITOK);
M_TEMP, 0);
if ((len > sizeof(struct cd_sub_channel_info)) ||
(len < sizeof(struct cd_sub_channel_header))) {
@ -1928,7 +1928,7 @@ cdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
("trying to do CDIOREADTOCHEADER\n"));
th = malloc(sizeof(struct ioc_toc_header), M_TEMP,
M_WAITOK);
0);
error = cdreadtoc(periph, 0, 0,
(struct cd_toc_entry *)th,
sizeof (*th));
@ -1971,8 +1971,8 @@ cdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE,
("trying to do CDIOREADTOCENTRYS\n"));
data = malloc(sizeof(data_t), M_TEMP, M_WAITOK);
lead = malloc(sizeof(lead_t), M_TEMP, M_WAITOK);
data = malloc(sizeof(data_t), M_TEMP, 0);
lead = malloc(sizeof(lead_t), M_TEMP, 0);
if (te->data_len < sizeof(struct cd_toc_entry)
|| (te->data_len % sizeof(struct cd_toc_entry)) != 0
@ -2098,7 +2098,7 @@ cdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE,
("trying to do CDIOREADTOCENTRY\n"));
data = malloc(sizeof(data_t), M_TEMP, M_WAITOK);
data = malloc(sizeof(data_t), M_TEMP, 0);
if (te->address_format != CD_MSF_FORMAT
&& te->address_format != CD_LBA_FORMAT) {
@ -2164,7 +2164,7 @@ cdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
("trying to do CDIOCSETPATCH\n"));
data = malloc(sizeof(struct cd_mode_data), M_TEMP,
M_WAITOK);
0);
error = cdgetmode(periph, data, AUDIO_PAGE);
if (error) {
free(data, M_TEMP);
@ -2189,7 +2189,7 @@ cdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
("trying to do CDIOCGETVOL\n"));
data = malloc(sizeof(struct cd_mode_data), M_TEMP,
M_WAITOK);
0);
error = cdgetmode(periph, data, AUDIO_PAGE);
if (error) {
free(data, M_TEMP);
@ -2213,7 +2213,7 @@ cdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
("trying to do CDIOCSETVOL\n"));
data = malloc(sizeof(struct cd_mode_data), M_TEMP,
M_WAITOK);
0);
error = cdgetmode(periph, data, AUDIO_PAGE);
if (error) {
free(data, M_TEMP);
@ -2239,7 +2239,7 @@ cdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
("trying to do CDIOCSETMONO\n"));
data = malloc(sizeof(struct cd_mode_data),
M_TEMP, M_WAITOK);
M_TEMP, 0);
error = cdgetmode(periph, data, AUDIO_PAGE);
if (error) {
free(data, M_TEMP);
@ -2263,7 +2263,7 @@ cdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
("trying to do CDIOCSETSTEREO\n"));
data = malloc(sizeof(struct cd_mode_data), M_TEMP,
M_WAITOK);
0);
error = cdgetmode(periph, data, AUDIO_PAGE);
if (error) {
free(data, M_TEMP);
@ -2287,7 +2287,7 @@ cdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
("trying to do CDIOCSETMUTE\n"));
data = malloc(sizeof(struct cd_mode_data), M_TEMP,
M_WAITOK);
0);
error = cdgetmode(periph, data, AUDIO_PAGE);
if (error) {
free(data, M_TEMP);
@ -2309,7 +2309,7 @@ cdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
("trying to do CDIOCSETLEFT\n"));
data = malloc(sizeof(struct cd_mode_data), M_TEMP,
M_WAITOK);
0);
error = cdgetmode(periph, data, AUDIO_PAGE);
if (error) {
free(data, M_TEMP);
@ -2333,7 +2333,7 @@ cdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
("trying to do CDIOCSETRIGHT\n"));
data = malloc(sizeof(struct cd_mode_data), M_TEMP,
M_WAITOK);
0);
error = cdgetmode(periph, data, AUDIO_PAGE);
if (error) {
free(data, M_TEMP);
@ -2485,7 +2485,7 @@ cdsize(dev_t dev, u_int32_t *size)
ccb = cdgetccb(periph, /* priority */ 1);
rcap_buf = malloc(sizeof(struct scsi_read_capacity_data),
M_TEMP, M_WAITOK);
M_TEMP, 0);
scsi_read_capacity(&ccb->csio,
/*retries*/ 1,
@ -3054,7 +3054,7 @@ cdreportkey(struct cam_periph *periph, struct dvd_authinfo *authinfo)
}
if (length != 0) {
databuf = malloc(length, M_DEVBUF, M_WAITOK | M_ZERO);
databuf = malloc(length, M_DEVBUF, M_ZERO);
} else
databuf = NULL;
@ -3187,7 +3187,7 @@ cdsendkey(struct cam_periph *periph, struct dvd_authinfo *authinfo)
length = sizeof(*challenge_data);
challenge_data = malloc(length, M_DEVBUF, M_WAITOK | M_ZERO);
challenge_data = malloc(length, M_DEVBUF, M_ZERO);
databuf = (u_int8_t *)challenge_data;
@ -3204,7 +3204,7 @@ cdsendkey(struct cam_periph *periph, struct dvd_authinfo *authinfo)
length = sizeof(*key2_data);
key2_data = malloc(length, M_DEVBUF, M_WAITOK | M_ZERO);
key2_data = malloc(length, M_DEVBUF, M_ZERO);
databuf = (u_int8_t *)key2_data;
@ -3221,7 +3221,7 @@ cdsendkey(struct cam_periph *periph, struct dvd_authinfo *authinfo)
length = sizeof(*rpc_data);
rpc_data = malloc(length, M_DEVBUF, M_WAITOK | M_ZERO);
rpc_data = malloc(length, M_DEVBUF, M_ZERO);
databuf = (u_int8_t *)rpc_data;
@ -3363,7 +3363,7 @@ cdreaddvdstructure(struct cam_periph *periph, struct dvd_struct *dvdstruct)
}
if (length != 0) {
databuf = malloc(length, M_DEVBUF, M_WAITOK | M_ZERO);
databuf = malloc(length, M_DEVBUF, M_ZERO);
} else
databuf = NULL;

View File

@ -1100,7 +1100,7 @@ chgetelemstatus(struct cam_periph *periph,
* we can allocate enough storage for all of them. We assume
* that the first one can fit into 1k.
*/
data = (caddr_t)malloc(1024, M_DEVBUF, M_WAITOK);
data = (caddr_t)malloc(1024, M_DEVBUF, 0);
ccb = cam_periph_getccb(periph, /*priority*/ 1);
@ -1137,7 +1137,7 @@ chgetelemstatus(struct cam_periph *periph,
* device.
*/
free(data, M_DEVBUF);
data = (caddr_t)malloc(size, M_DEVBUF, M_WAITOK);
data = (caddr_t)malloc(size, M_DEVBUF, 0);
scsi_read_element_status(&ccb->csio,
/* retries */ 1,
@ -1172,7 +1172,7 @@ chgetelemstatus(struct cam_periph *periph,
user_data = (struct changer_element_status *)
malloc(avail * sizeof(struct changer_element_status),
M_DEVBUF, M_WAITOK | M_ZERO);
M_DEVBUF, M_ZERO);
desc = (struct read_element_status_descriptor *)((uintptr_t)data +
sizeof(struct read_element_status_header) +

View File

@ -575,7 +575,7 @@ daopen(dev_t dev, int flags __unused, int fmt __unused, struct thread *td __unus
/* Do a read capacity */
rcap = (struct scsi_read_capacity_data *)malloc(sizeof(*rcap),
M_TEMP,
M_WAITOK);
0);
ccb = cam_periph_getccb(periph, /*priority*/1);
scsi_read_capacity(&ccb->csio,

View File

@ -961,7 +961,7 @@ scsi_low_rescan_bus_cam(slp)
struct scsi_low_softc *slp;
{
struct cam_path *path;
union ccb *ccb = malloc(sizeof(union ccb), M_DEVBUF, M_WAITOK);
union ccb *ccb = malloc(sizeof(union ccb), M_DEVBUF, 0);
cam_status status;
bzero(ccb, sizeof(union ccb));

View File

@ -1895,7 +1895,7 @@ samount(struct cam_periph *periph, int oflags, dev_t dev)
* read a full record.
*/
rblim = (struct scsi_read_block_limits_data *)
malloc(8192, M_TEMP, M_WAITOK);
malloc(8192, M_TEMP, 0);
if (rblim == NULL) {
xpt_print_path(ccb->ccb_h.path);
printf("no memory for test read\n");
@ -2520,7 +2520,7 @@ sagetparams(struct cam_periph *periph, sa_params params_to_get,
mode_buffer_len += sizeof (sa_comp_t);
}
mode_buffer = malloc(mode_buffer_len, M_TEMP, M_WAITOK | M_ZERO);
mode_buffer = malloc(mode_buffer_len, M_TEMP, M_ZERO);
mode_hdr = (struct scsi_mode_header_6 *)mode_buffer;
mode_blk = (struct scsi_mode_blk_desc *)&mode_hdr[1];
@ -2700,7 +2700,7 @@ sasetparams(struct cam_periph *periph, sa_params params_to_set,
softc = (struct sa_softc *)periph->softc;
ccomp = malloc(sizeof (sa_comp_t), M_TEMP, M_WAITOK);
ccomp = malloc(sizeof (sa_comp_t), M_TEMP, 0);
/*
* Since it doesn't make sense to set the number of blocks, or
@ -2723,7 +2723,7 @@ sasetparams(struct cam_periph *periph, sa_params params_to_set,
if (params_to_set & SA_PARAM_COMPRESSION)
mode_buffer_len += sizeof (sa_comp_t);
mode_buffer = malloc(mode_buffer_len, M_TEMP, M_WAITOK | M_ZERO);
mode_buffer = malloc(mode_buffer_len, M_TEMP, M_ZERO);
mode_hdr = (struct scsi_mode_header_6 *)mode_buffer;
mode_blk = (struct scsi_mode_blk_desc *)&mode_hdr[1];

View File

@ -189,7 +189,7 @@ targopen(dev_t dev, int flags, int fmt, struct thread *td)
"targ%d", dev2unit(dev));
}
MALLOC(softc, struct targ_softc *, sizeof(*softc), M_TARG,
M_WAITOK | M_ZERO);
M_ZERO);
dev->si_drv1 = softc;
softc->state = TARG_STATE_OPENED;
softc->periph = NULL;
@ -977,7 +977,7 @@ targgetccb(struct targ_softc *softc, xpt_opcode type, int priority)
int ccb_len;
ccb_len = targccblen(type);
MALLOC(ccb, union ccb *, ccb_len, M_TARG, M_WAITOK);
MALLOC(ccb, union ccb *, ccb_len, M_TARG, 0);
CAM_DEBUG(softc->path, CAM_DEBUG_PERIPH, ("getccb %p\n", ccb));
xpt_setup_ccb(&ccb->ccb_h, softc->path, priority);
@ -1021,7 +1021,7 @@ targgetdescr(struct targ_softc *softc)
struct targ_cmd_descr *descr;
MALLOC(descr, struct targ_cmd_descr *, sizeof(*descr), M_TARG,
M_WAITOK);
0);
descr->mapinfo.num_bufs_used = 0;
return (descr);
}

View File

@ -66,7 +66,7 @@ MALLOC_DECLARE(M_CODA);
#define CODA_ALLOC(ptr, cast, size) \
do { \
ptr = (cast)malloc((unsigned long) size, M_CODA, M_WAITOK); \
ptr = (cast)malloc((unsigned long) size, M_CODA, 0); \
if (ptr == 0) { \
panic("kernel malloc returns 0 at %s:%d\n", __FILE__, __LINE__); \
} \

View File

@ -106,7 +106,7 @@ ia32_emul_find(td, sgp, prefix, path, pbuf, cflag)
struct vattr vat;
struct vattr vatroot;
buf = (char *) malloc(MAXPATHLEN, M_TEMP, M_WAITOK);
buf = (char *) malloc(MAXPATHLEN, M_TEMP, 0);
*pbuf = path;
for (ptr = buf; (*ptr = *prefix) != '\0'; ptr++, prefix++)
@ -769,8 +769,8 @@ ia32_readv(struct thread *td, struct ia32_readv_args *uap)
osize = uap->iovcnt * sizeof (struct iovec32);
nsize = uap->iovcnt * sizeof (struct iovec);
oio = malloc(osize, M_TEMP, M_WAITOK);
nio = malloc(nsize, M_TEMP, M_WAITOK);
oio = malloc(osize, M_TEMP, 0);
nio = malloc(nsize, M_TEMP, 0);
error = 0;
if ((error = copyin(uap->iovp, oio, osize)))
@ -815,8 +815,8 @@ ia32_writev(struct thread *td, struct ia32_writev_args *uap)
osize = uap->iovcnt * sizeof (struct iovec32);
nsize = uap->iovcnt * sizeof (struct iovec);
oio = malloc(osize, M_TEMP, M_WAITOK);
nio = malloc(nsize, M_TEMP, M_WAITOK);
oio = malloc(osize, M_TEMP, 0);
nio = malloc(nsize, M_TEMP, 0);
error = 0;
if ((error = copyin(uap->iovp, oio, osize)))

View File

@ -297,7 +297,7 @@ getdents_common(struct thread *td, struct linux_getdents64_args *args,
buflen = max(LINUX_DIRBLKSIZ, nbytes);
buflen = min(buflen, MAXBSIZE);
buf = malloc(buflen, M_TEMP, M_WAITOK);
buf = malloc(buflen, M_TEMP, 0);
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
again:

View File

@ -181,7 +181,7 @@ linux_getcwd_scandir(lvpp, uvpp, bpp, bufp, td)
dirbuflen = DIRBLKSIZ;
if (dirbuflen < va.va_blocksize)
dirbuflen = va.va_blocksize;
dirbuf = (char *)malloc(dirbuflen, M_TEMP, M_WAITOK);
dirbuf = (char *)malloc(dirbuflen, M_TEMP, 0);
#if 0
unionread:
@ -429,7 +429,7 @@ linux_getcwd(struct thread *td, struct linux_getcwd_args *args)
else if (len < 2)
return ERANGE;
path = (char *)malloc(len, M_TEMP, M_WAITOK);
path = (char *)malloc(len, M_TEMP, 0);
error = kern___getcwd(td, path, UIO_SYSSPACE, len);
if (!error) {

View File

@ -2420,7 +2420,7 @@ linux_ioctl_register_handler(struct linux_ioctl_handler *h)
}
if (he == NULL) {
MALLOC(he, struct handler_element *, sizeof(*he),
M_LINUX, M_WAITOK);
M_LINUX, 0);
he->func = h->func;
} else
TAILQ_REMOVE(&handlers, he, list);

View File

@ -139,7 +139,7 @@ linux_get_prison(struct proc *p)
if (pr->pr_linux == NULL) {
mtx_unlock(&pr->pr_mtx);
MALLOC(lpr, struct linux_prison *, sizeof *lpr,
M_PRISON, M_WAITOK|M_ZERO);
M_PRISON, M_ZERO);
mtx_lock(&pr->pr_mtx);
if (pr->pr_linux == NULL) {
pr->pr_linux = lpr;

View File

@ -92,7 +92,7 @@ linux_sysctl(struct thread *td, struct linux_sysctl_args *args)
if (la.nlen <= 0 || la.nlen > LINUX_CTL_MAXNAME)
return (ENOTDIR);
mib = malloc(la.nlen * sizeof(l_int), M_TEMP, M_WAITOK);
mib = malloc(la.nlen * sizeof(l_int), M_TEMP, 0);
error = copyin(la.name, mib, la.nlen * sizeof(l_int));
if (error) {
free(mib, M_TEMP);

View File

@ -101,7 +101,7 @@ linux_emul_convpath(td, path, pathseg, pbuf, cflag)
char *ptr, *buf, *cp;
size_t len, sz;
buf = (char *) malloc(MAXPATHLEN, M_TEMP, M_WAITOK);
buf = (char *) malloc(MAXPATHLEN, M_TEMP, 0);
*pbuf = buf;
prefix = linux_emul_path;

View File

@ -184,7 +184,7 @@ pecoff_coredump(register struct thread * td, register struct vnode * vp,
limit)
return (EFAULT);
tempuser = malloc(ctob(uarea_pages + kstack_pages), M_TEMP,
M_WAITOK | M_ZERO);
M_ZERO);
if (tempuser == NULL)
return (ENOMEM);
PROC_LOCK(p);
@ -393,7 +393,7 @@ pecoff_load_file(struct thread * td, const char *file, u_long * addr, u_long * e
goto fail;
if ((error = pecoff_signature(td, imgp->vp, &dh) != 0))
goto fail;
fp = malloc(PECOFF_HDR_SIZE, M_TEMP, M_WAITOK);
fp = malloc(PECOFF_HDR_SIZE, M_TEMP, 0);
peofs = dh.d_peofs + sizeof(signature) - 1;
if ((error = pecoff_read_from(td, imgp->vp, peofs, (caddr_t) fp, PECOFF_HDR_SIZE) != 0))
goto fail;
@ -405,7 +405,7 @@ pecoff_load_file(struct thread * td, const char *file, u_long * addr, u_long * e
wp = (void *) ((char *) ap + sizeof(struct coff_aouthdr));
/* read section header */
scnsiz = sizeof(struct coff_scnhdr) * fp->f_nscns;
sh = malloc(scnsiz, M_TEMP, M_WAITOK);
sh = malloc(scnsiz, M_TEMP, 0);
if ((error = pecoff_read_from(td, imgp->vp, peofs + PECOFF_HDR_SIZE,
(caddr_t) sh, scnsiz)) != 0)
goto fail;
@ -481,7 +481,7 @@ exec_pecoff_coff_prep_zmagic(struct image_params * imgp,
struct vmspace *vmspace;
struct pecoff_args *argp = NULL;
sh = malloc(scnsiz, M_TEMP, M_WAITOK);
sh = malloc(scnsiz, M_TEMP, 0);
wp = (void *) ((char *) ap + sizeof(struct coff_aouthdr));
error = pecoff_read_from(FIRST_THREAD_IN_PROC(imgp->proc), imgp->vp,
@ -529,7 +529,7 @@ exec_pecoff_coff_prep_zmagic(struct image_params * imgp,
vmspace->vm_taddr = (caddr_t) (uintptr_t) text_addr;
vmspace->vm_dsize = data_size >> PAGE_SHIFT;
vmspace->vm_daddr = (caddr_t) (uintptr_t) data_addr;
argp = malloc(sizeof(struct pecoff_args), M_TEMP, M_WAITOK);
argp = malloc(sizeof(struct pecoff_args), M_TEMP, 0);
if (argp == NULL) {
error = ENOMEM;
goto fail;
@ -659,7 +659,7 @@ imgact_pecoff(struct image_params * imgp)
VOP_UNLOCK(imgp->vp, 0, td);
peofs = dp->d_peofs + sizeof(signature) - 1;
fp = malloc(PECOFF_HDR_SIZE, M_TEMP, M_WAITOK);
fp = malloc(PECOFF_HDR_SIZE, M_TEMP, 0);
error = pecoff_read_from(FIRST_THREAD_IN_PROC(imgp->proc),
imgp->vp, peofs, (caddr_t) fp, PECOFF_HDR_SIZE);
if (error)

View File

@ -68,7 +68,7 @@ svr4_sys_poll(td, uap)
pa.timeout = uap->timeout;
siz = uap->nfds * sizeof(struct pollfd);
pfd = (struct pollfd *)malloc(siz, M_TEMP, M_WAITOK);
pfd = (struct pollfd *)malloc(siz, M_TEMP, 0);
error = poll(td, (struct poll_args *)uap);

View File

@ -296,7 +296,7 @@ svr4_sys_getdents64(td, uap)
#define DIRBLKSIZ 512 /* XXX we used to use ufs's DIRBLKSIZ */
buflen = max(DIRBLKSIZ, nbytes);
buflen = min(buflen, MAXBSIZE);
buf = malloc(buflen, M_TEMP, M_WAITOK);
buf = malloc(buflen, M_TEMP, 0);
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
again:
aiov.iov_base = buf;
@ -459,7 +459,7 @@ svr4_sys_getdents(td, uap)
}
buflen = min(MAXBSIZE, uap->nbytes);
buf = malloc(buflen, M_TEMP, M_WAITOK);
buf = malloc(buflen, M_TEMP, 0);
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
off = fp->f_offset;
again:

View File

@ -138,7 +138,7 @@ svr4_add_socket(td, path, st)
atomic_store_rel_int(&svr4_str_initialized, 2);
}
e = malloc(sizeof(*e), M_TEMP, M_WAITOK);
e = malloc(sizeof(*e), M_TEMP, 0);
e->cookie = NULL;
e->dev = st->st_dev;
e->ino = st->st_ino;

View File

@ -212,7 +212,7 @@ svr4_sendit(td, s, mp, flags)
if (KTRPOINT(td, KTR_GENIO)) {
int iovlen = auio.uio_iovcnt * sizeof (struct iovec);
MALLOC(ktriov, struct iovec *, iovlen, M_TEMP, M_WAITOK);
MALLOC(ktriov, struct iovec *, iovlen, M_TEMP, 0);
bcopy((caddr_t)auio.uio_iov, (caddr_t)ktriov, iovlen);
ktruio = auio;
}
@ -297,7 +297,7 @@ svr4_recvit(td, s, mp, namelenp)
if (KTRPOINT(td, KTR_GENIO)) {
int iovlen = auio.uio_iovcnt * sizeof (struct iovec);
MALLOC(ktriov, struct iovec *, iovlen, M_TEMP, M_WAITOK);
MALLOC(ktriov, struct iovec *, iovlen, M_TEMP, 0);
bcopy((caddr_t)auio.uio_iov, (caddr_t)ktriov, iovlen);
ktruio = auio;
}
@ -408,7 +408,7 @@ show_ioc(str, ioc)
const char *str;
struct svr4_strioctl *ioc;
{
u_char *ptr = (u_char *) malloc(ioc->len, M_TEMP, M_WAITOK);
u_char *ptr = (u_char *) malloc(ioc->len, M_TEMP, 0);
int error;
uprintf("%s cmd = %ld, timeout = %d, len = %d, buf = %p { ",
@ -444,7 +444,7 @@ show_strbuf(str)
len = maxlen;
if (len > 0) {
ptr = (u_char *) malloc(len, M_TEMP, M_WAITOK);
ptr = (u_char *) malloc(len, M_TEMP, 0);
if ((error = copyin(str->buf, ptr, len)) != 0) {
free((char *) ptr, M_TEMP);

View File

@ -267,7 +267,7 @@ svr4_emul_find(td, sgp, prefix, path, pbuf, cflag)
char *ptr, *buf, *cp;
size_t sz, len;
buf = (char *) malloc(MAXPATHLEN, M_TEMP, M_WAITOK);
buf = (char *) malloc(MAXPATHLEN, M_TEMP, 0);
*pbuf = path;
for (ptr = buf; (*ptr = *prefix) != '\0'; ptr++, prefix++)

View File

@ -65,7 +65,7 @@ static struct cdevsw fladisk_cdevsw;
void *
doc2k_malloc(int bytes)
{
return malloc(bytes, M_FLA, M_WAITOK);
return malloc(bytes, M_FLA, 0);
}
void

View File

@ -1405,14 +1405,14 @@ DriverReceiveFrameCompleted(void *DriverHandle, int ByteCount, int FragmentCount
if (sc->state > OL_CLOSED) {
if (ReceiveStatus == TRLLD_RCV_OK) {
MGETHDR(m0, M_DONTWAIT, MT_DATA);
MGETHDR(m0, M_NOWAIT, MT_DATA);
mbuf_size = MHLEN - 2;
if (!m0) {
ifp->if_ierrors++;
goto dropped;
}
if (ByteCount + 2 > MHLEN) {
MCLGET(m0, M_DONTWAIT);
MCLGET(m0, M_NOWAIT);
mbuf_size = MCLBYTES - 2;
if (!(m0->m_flags & M_EXT)) {
m_freem(m0);
@ -1447,7 +1447,7 @@ DriverReceiveFrameCompleted(void *DriverHandle, int ByteCount, int FragmentCount
frag_offset = 0;
}
if ((mbuf_offset == mbuf_size) && (frame_len > 0)) {
MGET(m1, M_DONTWAIT, MT_DATA);
MGET(m1, M_NOWAIT, MT_DATA);
mbuf_size = MHLEN;
if (!m1) {
ifp->if_ierrors++;
@ -1455,7 +1455,7 @@ DriverReceiveFrameCompleted(void *DriverHandle, int ByteCount, int FragmentCount
goto dropped;
}
if (frame_len > MHLEN) {
MCLGET(m1, M_DONTWAIT);
MCLGET(m1, M_NOWAIT);
mbuf_size = MCLBYTES;
if (!(m1->m_flags & M_EXT)) {
m_freem(m0);

View File

@ -1188,7 +1188,7 @@ int out;
mc = dupmsg(m);
# else
# if defined(__OpenBSD__) && (OpenBSD >= 199905)
mc = m_copym2(m, 0, M_COPYALL, M_DONTWAIT);
mc = m_copym2(m, 0, M_COPYALL, M_NOWAIT);
# else
mc = m_copy(m, 0, M_COPYALL);
# endif
@ -1587,7 +1587,7 @@ m_copyback(m0, off, len, cp)
off -= mlen;
totlen += mlen;
if (m->m_next == 0) {
n = m_getclr(M_DONTWAIT, m->m_type);
n = m_getclr(M_NOWAIT, m->m_type);
if (n == 0)
goto out;
n->m_len = min(MLEN, len + off);
@ -1606,7 +1606,7 @@ m_copyback(m0, off, len, cp)
if (len == 0)
break;
if (m->m_next == 0) {
n = m_get(M_DONTWAIT, m->m_type);
n = m_get(M_NOWAIT, m->m_type);
if (n == 0)
break;
n->m_len = min(MLEN, len);

View File

@ -1160,9 +1160,9 @@ fr_info_t *fin;
if (tcp->th_flags & TH_RST)
return -1; /* feedback loop */
# if (BSD < 199306) || defined(__sgi)
m = m_get(M_DONTWAIT, MT_HEADER);
m = m_get(M_NOWAIT, MT_HEADER);
# else
m = m_gethdr(M_DONTWAIT, MT_HEADER);
m = m_gethdr(M_NOWAIT, MT_HEADER);
# endif
if (m == NULL)
return ENOBUFS;
@ -1337,10 +1337,10 @@ int dst;
# if (BSD < 199306) || defined(__sgi)
avail = MLEN;
m = m_get(M_DONTWAIT, MT_HEADER);
m = m_get(M_NOWAIT, MT_HEADER);
# else
avail = MHLEN;
m = m_gethdr(M_DONTWAIT, MT_HEADER);
m = m_gethdr(M_NOWAIT, MT_HEADER);
# endif
if (m == NULL)
return ENOBUFS;
@ -1364,11 +1364,11 @@ int dst;
if (type == ICMP6_DST_UNREACH)
code = icmptoicmp6unreach[code];
MGETHDR(m, M_DONTWAIT, MT_HEADER);
MGETHDR(m, M_NOWAIT, MT_HEADER);
if (!m)
return ENOBUFS;
MCLGET(m, M_DONTWAIT);
MCLGET(m, M_NOWAIT);
if ((m->m_flags & M_EXT) == 0) {
m_freem(m);
return ENOBUFS;
@ -1564,7 +1564,7 @@ frdest_t *fdp;
* problem.
*/
if (M_WRITABLE(m) == 0) {
if ((m0 = m_dup(m, M_DONTWAIT)) != NULL) {
if ((m0 = m_dup(m, M_NOWAIT)) != NULL) {
m_freem(*mpp);
*mpp = m0;
m = m0;
@ -1747,9 +1747,9 @@ frdest_t *fdp;
mhlen = sizeof (struct ip);
for (off = hlen + len; off < ip->ip_len; off += len) {
# ifdef MGETHDR
MGETHDR(m, M_DONTWAIT, MT_HEADER);
MGETHDR(m, M_NOWAIT, MT_HEADER);
# else
MGET(m, M_DONTWAIT, MT_HEADER);
MGET(m, M_NOWAIT, MT_HEADER);
# endif
if (m == 0) {
error = ENOBUFS;

View File

@ -351,7 +351,7 @@ agp_generic_alloc_memory(device_t dev, int type, vm_size_t size)
return 0;
}
mem = malloc(sizeof *mem, M_AGP, M_WAITOK);
mem = malloc(sizeof *mem, M_AGP, 0);
mem->am_id = sc->as_nextid++;
mem->am_size = size;
mem->am_type = 0;

View File

@ -500,7 +500,7 @@ agp_i810_alloc_memory(device_t dev, int type, vm_size_t size)
return 0;
}
mem = malloc(sizeof *mem, M_AGP, M_WAITOK);
mem = malloc(sizeof *mem, M_AGP, 0);
mem->am_id = sc->agp.as_nextid++;
mem->am_size = size;
mem->am_type = type;

View File

@ -433,7 +433,7 @@ amr_ioctl(dev_t dev, u_long cmd, caddr_t addr, int32_t flag, d_thread_t *td)
debug(1, "AMR_IO_COMMAND 0x%x", au->au_cmd[0]);
/* handle inbound data buffer */
if (au->au_length != 0) {
if ((dp = malloc(au->au_length, M_DEVBUF, M_WAITOK)) == NULL) {
if ((dp = malloc(au->au_length, M_DEVBUF, 0)) == NULL) {
error = ENOMEM;
break;
}
@ -449,7 +449,7 @@ amr_ioctl(dev_t dev, u_long cmd, caddr_t addr, int32_t flag, d_thread_t *td)
/* handle SCSI passthrough command */
if (au->au_cmd[0] == AMR_CMD_PASS) {
if ((ap = malloc(sizeof(*ap), M_DEVBUF, M_WAITOK | M_ZERO)) == NULL) {
if ((ap = malloc(sizeof(*ap), M_DEVBUF, M_ZERO)) == NULL) {
error = ENOMEM;
break;
}

View File

@ -922,12 +922,12 @@ an_rxeof(sc)
/* dump raw 802.11 packet to bpf and skip ip stack */
BPF_TAP(ifp, bpf_buf, len);
} else {
MGETHDR(m, M_DONTWAIT, MT_DATA);
MGETHDR(m, M_NOWAIT, MT_DATA);
if (m == NULL) {
ifp->if_ierrors++;
return;
}
MCLGET(m, M_DONTWAIT);
MCLGET(m, M_NOWAIT);
if (!(m->m_flags & M_EXT)) {
m_freem(m);
ifp->if_ierrors++;
@ -1007,12 +1007,12 @@ an_rxeof(sc)
if (an_rx_desc.an_done && !an_rx_desc.an_valid) {
buf = sc->an_rx_buffer[count].an_dma_vaddr;
MGETHDR(m, M_DONTWAIT, MT_DATA);
MGETHDR(m, M_NOWAIT, MT_DATA);
if (m == NULL) {
ifp->if_ierrors++;
return;
}
MCLGET(m, M_DONTWAIT);
MCLGET(m, M_NOWAIT);
if (!(m->m_flags & M_EXT)) {
m_freem(m);
ifp->if_ierrors++;
@ -3580,7 +3580,7 @@ flashcard(ifp, l_ioctl)
free(sc->an_flash_buffer, M_DEVBUF);
sc->an_flash_buffer = NULL;
}
sc->an_flash_buffer = malloc(FLASH_SIZE, M_DEVBUF, M_WAITOK);
sc->an_flash_buffer = malloc(FLASH_SIZE, M_DEVBUF, 0);
if (sc->an_flash_buffer)
return setflashmode(ifp);
else

View File

@ -1078,7 +1078,7 @@ arc_init(struct ar_hardc *hc)
u_char isr, mar;
MALLOC(sc, struct ar_softc *, hc->numports * sizeof(struct ar_softc),
M_DEVBUF, M_WAITOK | M_ZERO);
M_DEVBUF, M_ZERO);
if (sc == NULL)
return;
hc->sc = sc;
@ -1678,7 +1678,7 @@ ar_get_packets(struct ar_softc *sc)
while(ar_packet_avail(sc, &len, &rxstat)) {
TRC(printf("apa: len %d, rxstat %x\n", len, rxstat));
if(((rxstat & SCA_DESC_ERRORS) == 0) && (len < MCLBYTES)) {
MGETHDR(m, M_DONTWAIT, MT_DATA);
MGETHDR(m, M_NOWAIT, MT_DATA);
if(m == NULL) {
/* eat packet if get mbuf fail!! */
ar_eat_packet(sc, 1);
@ -1693,7 +1693,7 @@ ar_get_packets(struct ar_softc *sc)
#endif /* NETGRAPH */
m->m_pkthdr.len = m->m_len = len;
if(len > MHLEN) {
MCLGET(m, M_DONTWAIT);
MCLGET(m, M_NOWAIT);
if((m->m_flags & M_EXT) == 0) {
m_freem(m);
ar_eat_packet(sc, 1);

View File

@ -911,7 +911,7 @@ asr_alloc_ccb (
OUT union asr_ccb * new_ccb;
if ((new_ccb = (union asr_ccb *)malloc(sizeof(*new_ccb),
M_DEVBUF, M_WAITOK | M_ZERO)) != (union asr_ccb *)NULL) {
M_DEVBUF, M_ZERO)) != (union asr_ccb *)NULL) {
new_ccb->ccb_h.pinfo.priority = 1;
new_ccb->ccb_h.pinfo.index = CAM_UNQUEUED_INDEX;
new_ccb->ccb_h.spriv_ptr0 = sc;
@ -1205,7 +1205,7 @@ ASR_getTidAddress(
if ((new_entry == FALSE)
|| ((sc->ha_targets[bus] = bus_ptr = (target2lun_t *)malloc (
sizeof(*bus_ptr) + (sizeof(bus_ptr->LUN) * new_size),
M_TEMP, M_WAITOK | M_ZERO))
M_TEMP, M_ZERO))
== (target2lun_t *)NULL)) {
debug_asr_printf("failed to allocate bus list\n");
return ((tid_t *)NULL);
@ -1222,7 +1222,7 @@ ASR_getTidAddress(
if ((new_entry == FALSE)
|| ((new_bus_ptr = (target2lun_t *)malloc (
sizeof(*bus_ptr) + (sizeof(bus_ptr->LUN) * new_size),
M_TEMP, M_WAITOK | M_ZERO))
M_TEMP, M_ZERO))
== (target2lun_t *)NULL)) {
debug_asr_printf("failed to reallocate bus list\n");
return ((tid_t *)NULL);
@ -1258,7 +1258,7 @@ ASR_getTidAddress(
if ((new_entry == FALSE)
|| ((bus_ptr->LUN[target] = target_ptr = (lun2tid_t *)malloc (
sizeof(*target_ptr) + (sizeof(target_ptr->TID) * new_size),
M_TEMP, M_WAITOK | M_ZERO))
M_TEMP, M_ZERO))
== (lun2tid_t *)NULL)) {
debug_asr_printf("failed to allocate target list\n");
return ((tid_t *)NULL);
@ -1275,7 +1275,7 @@ ASR_getTidAddress(
if ((new_entry == FALSE)
|| ((new_target_ptr = (lun2tid_t *)malloc (
sizeof(*target_ptr) + (sizeof(target_ptr->TID) * new_size),
M_TEMP, M_WAITOK | M_ZERO))
M_TEMP, M_ZERO))
== (lun2tid_t *)NULL)) {
debug_asr_printf("failed to reallocate target list\n");
return ((tid_t *)NULL);
@ -1808,7 +1808,7 @@ ASR_acquireLct (
MessageSizeInBytes = sizeof(I2O_EXEC_LCT_NOTIFY_MESSAGE)
- sizeof(I2O_SG_ELEMENT) + sizeof(I2O_SGE_SIMPLE_ELEMENT);
if ((Message_Ptr = (PI2O_EXEC_LCT_NOTIFY_MESSAGE)malloc (
MessageSizeInBytes, M_TEMP, M_WAITOK))
MessageSizeInBytes, M_TEMP, 0))
== (PI2O_EXEC_LCT_NOTIFY_MESSAGE)NULL) {
return (ENOMEM);
}
@ -1852,7 +1852,7 @@ ASR_acquireLct (
free (Message_Ptr, M_TEMP);
return (EINVAL);
}
if ((sc->ha_LCT = (PI2O_LCT)malloc (len, M_TEMP, M_WAITOK))
if ((sc->ha_LCT = (PI2O_LCT)malloc (len, M_TEMP, 0))
== (PI2O_LCT)NULL) {
free (Message_Ptr, M_TEMP);
return (ENOMEM);
@ -1921,7 +1921,7 @@ ASR_acquireLct (
PI2O_EXEC_LCT_NOTIFY_MESSAGE NewMessage_Ptr;
if ((NewMessage_Ptr = (PI2O_EXEC_LCT_NOTIFY_MESSAGE)
malloc (MessageSizeInBytes, M_TEMP, M_WAITOK))
malloc (MessageSizeInBytes, M_TEMP, 0))
== (PI2O_EXEC_LCT_NOTIFY_MESSAGE)NULL) {
free (sc->ha_LCT, M_TEMP);
sc->ha_LCT = (PI2O_LCT)NULL;
@ -2262,7 +2262,7 @@ ASR_initOutBound (
* initialization time.
*/
if ((sc->ha_Msgs = (PI2O_SCSI_ERROR_REPLY_MESSAGE_FRAME)
contigmalloc (size, M_DEVBUF, M_WAITOK, 0ul,
contigmalloc (size, M_DEVBUF, 0, 0ul,
0xFFFFFFFFul, (u_long)sizeof(U32), 0ul))
!= (PI2O_SCSI_ERROR_REPLY_MESSAGE_FRAME)NULL) {
(void)bzero ((char *)sc->ha_Msgs, size);
@ -2296,7 +2296,7 @@ ASR_setSysTab(
int retVal;
if ((SystemTable = (PI2O_SET_SYSTAB_HEADER)malloc (
sizeof(I2O_SET_SYSTAB_HEADER), M_TEMP, M_WAITOK | M_ZERO))
sizeof(I2O_SET_SYSTAB_HEADER), M_TEMP, M_ZERO))
== (PI2O_SET_SYSTAB_HEADER)NULL) {
return (ENOMEM);
}
@ -2306,7 +2306,7 @@ ASR_setSysTab(
if ((Message_Ptr = (PI2O_EXEC_SYS_TAB_SET_MESSAGE)malloc (
sizeof(I2O_EXEC_SYS_TAB_SET_MESSAGE) - sizeof(I2O_SG_ELEMENT)
+ ((3+SystemTable->NumberEntries) * sizeof(I2O_SGE_SIMPLE_ELEMENT)),
M_TEMP, M_WAITOK)) == (PI2O_EXEC_SYS_TAB_SET_MESSAGE)NULL) {
M_TEMP, 0)) == (PI2O_EXEC_SYS_TAB_SET_MESSAGE)NULL) {
free (SystemTable, M_TEMP);
return (ENOMEM);
}
@ -2918,7 +2918,7 @@ asr_attach (ATTACH_ARGS)
/* Check if the device is there? */
if ((ASR_resetIOP(sc->ha_Virt, sc->ha_Fvirt) == 0)
|| ((status = (PI2O_EXEC_STATUS_GET_REPLY)malloc (
sizeof(I2O_EXEC_STATUS_GET_REPLY), M_TEMP, M_WAITOK))
sizeof(I2O_EXEC_STATUS_GET_REPLY), M_TEMP, 0))
== (PI2O_EXEC_STATUS_GET_REPLY)NULL)
|| (ASR_getStatus(sc->ha_Virt, sc->ha_Fvirt, status) == NULL)) {
printf ("asr%d: could not initialize hardware\n", unit);
@ -3037,7 +3037,7 @@ asr_attach (ATTACH_ARGS)
printf ("asr%d:", unit);
if ((iq = (struct scsi_inquiry_data *)malloc (
sizeof(struct scsi_inquiry_data), M_TEMP, M_WAITOK | M_ZERO))
sizeof(struct scsi_inquiry_data), M_TEMP, M_ZERO))
!= (struct scsi_inquiry_data *)NULL) {
defAlignLong(PRIVATE_SCSI_SCB_EXECUTE_MESSAGE,Message);
PPRIVATE_SCSI_SCB_EXECUTE_MESSAGE Message_Ptr;
@ -3947,7 +3947,7 @@ ASR_queue_i(
}
/* Copy in the message into a local allocation */
if ((Message_Ptr = (PI2O_MESSAGE_FRAME)malloc (
sizeof(I2O_MESSAGE_FRAME), M_TEMP, M_WAITOK))
sizeof(I2O_MESSAGE_FRAME), M_TEMP, 0))
== (PI2O_MESSAGE_FRAME)NULL) {
debug_usr_cmd_printf (
"Failed to acquire I2O_MESSAGE_FRAME memory\n");
@ -4014,7 +4014,7 @@ ASR_queue_i(
}
if ((Message_Ptr = (PI2O_MESSAGE_FRAME)malloc (MessageSizeInBytes,
M_TEMP, M_WAITOK)) == (PI2O_MESSAGE_FRAME)NULL) {
M_TEMP, 0)) == (PI2O_MESSAGE_FRAME)NULL) {
debug_usr_cmd_printf ("Failed to acquire frame[%d] memory\n",
MessageSizeInBytes);
return (ENOMEM);
@ -4030,7 +4030,7 @@ ASR_queue_i(
/* Check the size of the reply frame, and start constructing */
if ((Reply_Ptr = (PI2O_SCSI_ERROR_REPLY_MESSAGE_FRAME)malloc (
sizeof(I2O_MESSAGE_FRAME), M_TEMP, M_WAITOK))
sizeof(I2O_MESSAGE_FRAME), M_TEMP, 0))
== (PI2O_SCSI_ERROR_REPLY_MESSAGE_FRAME)NULL) {
free (Message_Ptr, M_TEMP);
debug_usr_cmd_printf (
@ -4061,7 +4061,7 @@ ASR_queue_i(
((ReplySizeInBytes > sizeof(I2O_SCSI_ERROR_REPLY_MESSAGE_FRAME))
? ReplySizeInBytes
: sizeof(I2O_SCSI_ERROR_REPLY_MESSAGE_FRAME)),
M_TEMP, M_WAITOK)) == (PI2O_SCSI_ERROR_REPLY_MESSAGE_FRAME)NULL) {
M_TEMP, 0)) == (PI2O_SCSI_ERROR_REPLY_MESSAGE_FRAME)NULL) {
free (Message_Ptr, M_TEMP);
debug_usr_cmd_printf ("Failed to acquire frame[%d] memory\n",
ReplySizeInBytes);
@ -4130,7 +4130,7 @@ ASR_queue_i(
if ((elm = (struct ioctlSgList_S *)malloc (
sizeof(*elm) - sizeof(elm->KernelSpace) + len,
M_TEMP, M_WAITOK))
M_TEMP, 0))
== (struct ioctlSgList_S *)NULL) {
debug_usr_cmd_printf (
"Failed to allocate SG[%d]\n", len);
@ -4219,7 +4219,7 @@ ASR_queue_i(
if ((NewMessage_Ptr
= (PI2O_MESSAGE_FRAME)
malloc (MessageSizeInBytes,
M_TEMP, M_WAITOK))
M_TEMP, 0))
== (PI2O_MESSAGE_FRAME)NULL) {
debug_usr_cmd_printf (
"Failed to acquire frame[%d] memory\n",

View File

@ -624,7 +624,7 @@ static void
cam_rescan(struct cam_sim *sim)
{
struct cam_path *path;
union ccb *ccb = malloc(sizeof(union ccb), M_ATACAM, M_WAITOK | M_ZERO);
union ccb *ccb = malloc(sizeof(union ccb), M_ATACAM, M_ZERO);
if (xpt_create_path(&path, xpt_periph, cam_sim_path(sim),
CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP)

View File

@ -1243,7 +1243,7 @@ awi_fix_txhdr(sc, m0)
llc->llc_snap.org_code[2] = 0;
llc->llc_snap.ether_type = eh.ether_type;
}
M_PREPEND(m0, sizeof(struct ieee80211_frame), M_DONTWAIT);
M_PREPEND(m0, sizeof(struct ieee80211_frame), M_NOWAIT);
if (m0 == NULL)
return NULL;
wh = mtod(m0, struct ieee80211_frame *);
@ -1321,7 +1321,7 @@ awi_fix_rxhdr(sc, m0)
off = 0;
while (m0->m_pkthdr.len > off) {
if (n0 == NULL) {
MGETHDR(n, M_DONTWAIT, MT_DATA);
MGETHDR(n, M_NOWAIT, MT_DATA);
if (n == NULL) {
m_freem(m0);
return NULL;
@ -1329,7 +1329,7 @@ awi_fix_rxhdr(sc, m0)
M_MOVE_PKTHDR(n, m0);
n->m_len = MHLEN;
} else {
MGET(n, M_DONTWAIT, MT_DATA);
MGET(n, M_NOWAIT, MT_DATA);
if (n == NULL) {
m_freem(m0);
m_freem(n0);
@ -1338,7 +1338,7 @@ awi_fix_rxhdr(sc, m0)
n->m_len = MLEN;
}
if (m0->m_pkthdr.len - off >= MINCLSIZE) {
MCLGET(n, M_DONTWAIT);
MCLGET(n, M_NOWAIT);
if (n->m_flags & M_EXT)
n->m_len = n->m_ext.ext_size;
}
@ -1549,14 +1549,14 @@ awi_devget(sc, off, len)
while (len > 0) {
if (top == NULL) {
MGETHDR(m, M_DONTWAIT, MT_DATA);
MGETHDR(m, M_NOWAIT, MT_DATA);
if (m == NULL)
return NULL;
m->m_pkthdr.rcvif = sc->sc_ifp;
m->m_pkthdr.len = len;
m->m_len = MHLEN;
} else {
MGET(m, M_DONTWAIT, MT_DATA);
MGET(m, M_NOWAIT, MT_DATA);
if (m == NULL) {
m_freem(top);
return NULL;
@ -1564,7 +1564,7 @@ awi_devget(sc, off, len)
m->m_len = MLEN;
}
if (len >= MINCLSIZE) {
MCLGET(m, M_DONTWAIT);
MCLGET(m, M_NOWAIT);
if (m->m_flags & M_EXT)
m->m_len = m->m_ext.ext_size;
}
@ -2232,7 +2232,7 @@ awi_send_deauth(sc)
struct ieee80211_frame *wh;
u_int8_t *deauth;
MGETHDR(m, M_DONTWAIT, MT_DATA);
MGETHDR(m, M_NOWAIT, MT_DATA);
if (m == NULL)
return;
if (ifp->if_flags & IFF_DEBUG)
@ -2269,7 +2269,7 @@ awi_send_auth(sc, seq)
struct ieee80211_frame *wh;
u_int8_t *auth;
MGETHDR(m, M_DONTWAIT, MT_DATA);
MGETHDR(m, M_NOWAIT, MT_DATA);
if (m == NULL)
return;
sc->sc_status = AWI_ST_AUTH;
@ -2370,7 +2370,7 @@ awi_send_asreq(sc, reassoc)
u_int16_t capinfo, lintval;
u_int8_t *asreq;
MGETHDR(m, M_DONTWAIT, MT_DATA);
MGETHDR(m, M_NOWAIT, MT_DATA);
if (m == NULL)
return;
sc->sc_status = AWI_ST_ASSOC;

View File

@ -319,7 +319,7 @@ awi_wep_encrypt(sc, m0, txflag)
ctx = sc->sc_wep_ctx;
m = m0;
left = m->m_pkthdr.len;
MGET(n, M_DONTWAIT, m->m_type);
MGET(n, M_NOWAIT, m->m_type);
n0 = n;
if (n == NULL)
goto fail;
@ -333,7 +333,7 @@ awi_wep_encrypt(sc, m0, txflag)
}
n->m_len = MHLEN;
if (n->m_pkthdr.len >= MINCLSIZE) {
MCLGET(n, M_DONTWAIT);
MCLGET(n, M_NOWAIT);
if (n->m_flags & M_EXT)
n->m_len = n->m_ext.ext_size;
}
@ -382,13 +382,13 @@ awi_wep_encrypt(sc, m0, txflag)
if (len > n->m_len - noff) {
len = n->m_len - noff;
if (len == 0) {
MGET(n->m_next, M_DONTWAIT, n->m_type);
MGET(n->m_next, M_NOWAIT, n->m_type);
if (n->m_next == NULL)
goto fail;
n = n->m_next;
n->m_len = MLEN;
if (left >= MINCLSIZE) {
MCLGET(n, M_DONTWAIT);
MCLGET(n, M_NOWAIT);
if (n->m_flags & M_EXT)
n->m_len = n->m_ext.ext_size;
}
@ -418,7 +418,7 @@ awi_wep_encrypt(sc, m0, txflag)
n->m_len = noff + sizeof(crcbuf);
else {
n->m_len = noff;
MGET(n->m_next, M_DONTWAIT, n->m_type);
MGET(n->m_next, M_NOWAIT, n->m_type);
if (n->m_next == NULL)
goto fail;
n = n->m_next;

View File

@ -719,12 +719,12 @@ bge_newbuf_std(sc, i, m)
struct bge_rx_bd *r;
if (m == NULL) {
MGETHDR(m_new, M_DONTWAIT, MT_DATA);
MGETHDR(m_new, M_NOWAIT, MT_DATA);
if (m_new == NULL) {
return(ENOBUFS);
}
MCLGET(m_new, M_DONTWAIT);
MCLGET(m_new, M_NOWAIT);
if (!(m_new->m_flags & M_EXT)) {
m_freem(m_new);
return(ENOBUFS);
@ -765,7 +765,7 @@ bge_newbuf_jumbo(sc, i, m)
caddr_t *buf = NULL;
/* Allocate the mbuf. */
MGETHDR(m_new, M_DONTWAIT, MT_DATA);
MGETHDR(m_new, M_NOWAIT, MT_DATA);
if (m_new == NULL) {
return(ENOBUFS);
}

View File

@ -424,7 +424,7 @@ cardbus_read_device(device_t brdev, int b, int s, int f)
if (REG(PCIR_DEVVENDOR, 4) != 0xffffffff) {
devlist_entry = malloc(sizeof(struct cardbus_devinfo),
M_DEVBUF, M_WAITOK | M_ZERO);
M_DEVBUF, M_ZERO);
if (devlist_entry == NULL)
return (NULL);

View File

@ -168,7 +168,7 @@ DECODE_PROTOTYPE(copy)
struct cis_tupleinfo *tmpbuf;
tmpbuf = malloc(sizeof(struct cis_tupleinfo) * (ncisread_buf+1),
M_DEVBUF, M_WAITOK);
M_DEVBUF, 0);
if (ncisread_buf > 0) {
memcpy(tmpbuf, cisread_buf,
sizeof(struct cis_tupleinfo) * ncisread_buf);
@ -178,7 +178,7 @@ DECODE_PROTOTYPE(copy)
cisread_buf[ncisread_buf].id = id;
cisread_buf[ncisread_buf].len = len;
cisread_buf[ncisread_buf].data = malloc(len, M_DEVBUF, M_WAITOK);
cisread_buf[ncisread_buf].data = malloc(len, M_DEVBUF, 0);
memcpy(cisread_buf[ncisread_buf].data, tupledata, len);
ncisread_buf++;
return (0);
@ -705,7 +705,7 @@ cardbus_alloc_resources(device_t cbdev, device_t child)
if (count == 0)
return (0);
barlist = malloc(sizeof(struct resource_list_entry*) * count, M_DEVBUF,
M_WAITOK);
0);
count = 0;
SLIST_FOREACH(rle, &dinfo->pci.resources, link) {
barlist[count] = rle;

View File

@ -206,7 +206,7 @@ ccdnew(int unit)
if (IS_ALLOCATED(unit) || unit > 32)
return (NULL);
MALLOC(sc, struct ccd_s *, sizeof(*sc), M_CCD, M_WAITOK | M_ZERO);
MALLOC(sc, struct ccd_s *, sizeof(*sc), M_CCD, M_ZERO);
sc->sc_unit = unit;
LIST_INSERT_HEAD(&ccd_softc_list, sc, list);
/* XXX: UNLOCK(unique unit numbers) */
@ -283,7 +283,7 @@ ccdinit(struct ccd_s *cs, char **cpaths, struct thread *td)
/* Allocate space for the component info. */
cs->sc_cinfo = malloc(cs->sc_nccdisks * sizeof(struct ccdcinfo),
M_CCD, M_WAITOK);
M_CCD, 0);
/*
* Verify that each component piece exists and record
@ -291,7 +291,7 @@ ccdinit(struct ccd_s *cs, char **cpaths, struct thread *td)
*/
maxsecsize = 0;
minsize = 0;
tmppath = malloc(MAXPATHLEN, M_CCD, M_WAITOK);
tmppath = malloc(MAXPATHLEN, M_CCD, 0);
for (ix = 0; ix < cs->sc_nccdisks; ix++) {
vp = cs->sc_vpp[ix];
ci = &cs->sc_cinfo[ix];
@ -304,7 +304,7 @@ ccdinit(struct ccd_s *cs, char **cpaths, struct thread *td)
MAXPATHLEN, &ci->ci_pathlen)) != 0) {
goto fail;
}
ci->ci_path = malloc(ci->ci_pathlen, M_CCD, M_WAITOK);
ci->ci_path = malloc(ci->ci_pathlen, M_CCD, 0);
bcopy(tmppath, ci->ci_path, ci->ci_pathlen);
ci->ci_dev = vn_todev(vp);
@ -459,7 +459,7 @@ ccdinterleave(struct ccd_s *cs, int unit)
*/
size = (cs->sc_nccdisks + 1) * sizeof(struct ccdiinfo);
cs->sc_itable = (struct ccdiinfo *)malloc(size, M_CCD,
M_WAITOK | M_ZERO);
M_ZERO);
/*
* Trivial case: no interleave (actually interleave of disk size).
@ -473,7 +473,7 @@ ccdinterleave(struct ccd_s *cs, int unit)
for (ix = 0; ix < cs->sc_nccdisks; ix++) {
/* Allocate space for ii_index. */
ii->ii_index = malloc(sizeof(int), M_CCD, M_WAITOK);
ii->ii_index = malloc(sizeof(int), M_CCD, 0);
ii->ii_ndisk = 1;
ii->ii_startblk = bn;
ii->ii_startoff = 0;
@ -496,7 +496,7 @@ ccdinterleave(struct ccd_s *cs, int unit)
* we use.
*/
ii->ii_index = malloc((sizeof(int) * cs->sc_nccdisks),
M_CCD, M_WAITOK);
M_CCD, 0);
/*
* Locate the smallest of the remaining components
@ -1107,9 +1107,9 @@ ccdioctltoo(int unit, u_long cmd, caddr_t data, int flag, struct thread *td)
* componet pathnames and device numbers.
*/
cpp = malloc(ccio->ccio_ndisks * sizeof(char *),
M_CCD, M_WAITOK);
M_CCD, 0);
vpp = malloc(ccio->ccio_ndisks * sizeof(struct vnode *),
M_CCD, M_WAITOK);
M_CCD, 0);
error = copyin((caddr_t)ccio->ccio_disks, (caddr_t)cpp,
ccio->ccio_ndisks * sizeof(char **));
@ -1164,7 +1164,7 @@ ccdioctltoo(int unit, u_long cmd, caddr_t data, int flag, struct thread *td)
*/
ccio->ccio_unit = unit;
ccio->ccio_size = cs->sc_size;
cs->sc_disk = malloc(sizeof(struct disk), M_CCD, M_WAITOK);
cs->sc_disk = malloc(sizeof(struct disk), M_CCD, 0);
cs->sc_dev = disk_create(unit, cs->sc_disk, 0,
&ccd_cdevsw, &ccddisk_cdevsw);
cs->sc_dev->si_drv1 = cs;

View File

@ -1859,7 +1859,7 @@ ciss_user_command(struct ciss_softc *sc, IOCTL_Command_struct *ioc)
*/
cr->cr_length = ioc->buf_size;
if (ioc->buf_size > 0) {
if ((cr->cr_data = malloc(ioc->buf_size, CISS_MALLOC_CLASS, M_WAITOK)) == NULL) {
if ((cr->cr_data = malloc(ioc->buf_size, CISS_MALLOC_CLASS, 0)) == NULL) {
error = ENOMEM;
goto out;
}
@ -2038,7 +2038,7 @@ ciss_cam_rescan_target(struct ciss_softc *sc, int target)
debug_called(1);
if ((ccb = malloc(sizeof(union ccb), M_TEMP, M_WAITOK | M_ZERO)) == NULL) {
if ((ccb = malloc(sizeof(union ccb), M_TEMP, M_ZERO)) == NULL) {
ciss_printf(sc, "rescan failed (can't allocate CCB)\n");
return;
}

View File

@ -644,7 +644,7 @@ cm_srint(vsc)
splx(s);
/* Allocate header mbuf */
MGETHDR(m, M_DONTWAIT, MT_DATA);
MGETHDR(m, M_NOWAIT, MT_DATA);
if (m == 0) {
/*
@ -681,7 +681,7 @@ cm_srint(vsc)
*/
if ((len + 2 + 2) > MHLEN) {
/* attach an mbuf cluster */
MCLGET(m, M_DONTWAIT);
MCLGET(m, M_NOWAIT);
/* Insist on getting a cluster */
if ((m->m_flags & M_EXT) == 0) {

View File

@ -941,7 +941,7 @@ cnw_read(sc)
bufbytes = 0;
bufptr = 0; /* XXX make gcc happy */
MGETHDR(m, M_DONTWAIT, MT_DATA);
MGETHDR(m, M_NOWAIT, MT_DATA);
if (m == 0)
return (0);
#if !defined(__FreeBSD__)
@ -956,7 +956,7 @@ cnw_read(sc)
while (totbytes > 0) {
if (top) {
MGET(m, M_DONTWAIT, MT_DATA);
MGET(m, M_NOWAIT, MT_DATA);
if (m == 0) {
m_freem(top);
return (0);
@ -964,7 +964,7 @@ cnw_read(sc)
mbytes = MLEN;
}
if (totbytes >= MINCLSIZE) {
MCLGET(m, M_DONTWAIT);
MCLGET(m, M_NOWAIT);
if ((m->m_flags & M_EXT) == 0) {
m_free(m);
m_freem(top);

View File

@ -780,12 +780,12 @@ cs_get_packet(struct cs_softc *sc)
return -1;
}
MGETHDR(m, M_DONTWAIT, MT_DATA);
MGETHDR(m, M_NOWAIT, MT_DATA);
if (m==NULL)
return -1;
if (length > MHLEN) {
MCLGET(m, M_DONTWAIT);
MCLGET(m, M_NOWAIT);
if (!(m->m_flags & M_EXT)) {
m_freem(m);
return -1;

View File

@ -2423,11 +2423,11 @@ dc_newbuf(sc, i, m)
c = &sc->dc_ldata->dc_rx_list[i];
if (m == NULL) {
MGETHDR(m_new, M_DONTWAIT, MT_DATA);
MGETHDR(m_new, M_NOWAIT, MT_DATA);
if (m_new == NULL)
return(ENOBUFS);
MCLGET(m_new, M_DONTWAIT);
MCLGET(m_new, M_NOWAIT);
if (!(m_new->m_flags & M_EXT)) {
m_freem(m_new);
return(ENOBUFS);
@ -3186,11 +3186,11 @@ dc_coal(sc, m_head)
struct mbuf *m_new, *m;
m = *m_head;
MGETHDR(m_new, M_DONTWAIT, MT_DATA);
MGETHDR(m_new, M_NOWAIT, MT_DATA);
if (m_new == NULL)
return(ENOBUFS);
if (m->m_pkthdr.len > MHLEN) {
MCLGET(m_new, M_DONTWAIT);
MCLGET(m_new, M_NOWAIT);
if (!(m_new->m_flags & M_EXT)) {
m_freem(m_new);
return(ENOBUFS);

View File

@ -195,7 +195,7 @@ tulip_txprobe(
* either is connected so the transmit is the only way
* to verify the connectivity.
*/
MGETHDR(m, M_DONTWAIT, MT_DATA);
MGETHDR(m, M_NOWAIT, MT_DATA);
if (m == NULL)
return 0;
/*
@ -3545,12 +3545,12 @@ tulip_rx_intr(
*/
if (accept || ms == NULL) {
struct mbuf *m0;
MGETHDR(m0, M_DONTWAIT, MT_DATA);
MGETHDR(m0, M_NOWAIT, MT_DATA);
if (m0 != NULL) {
#if defined(TULIP_COPY_RXDATA)
if (!accept || total_len >= (MHLEN - 2)) {
#endif
MCLGET(m0, M_DONTWAIT);
MCLGET(m0, M_NOWAIT);
if ((m0->m_flags & M_EXT) == 0) {
m_freem(m0);
m0 = NULL;
@ -4061,10 +4061,10 @@ tulip_mbuf_compress(
{
struct mbuf *m0;
#if MCLBYTES >= ETHERMTU + 18 && !defined(BIG_PACKET)
MGETHDR(m0, M_DONTWAIT, MT_DATA);
MGETHDR(m0, M_NOWAIT, MT_DATA);
if (m0 != NULL) {
if (m->m_pkthdr.len > MHLEN) {
MCLGET(m0, M_DONTWAIT);
MCLGET(m0, M_NOWAIT);
if ((m0->m_flags & M_EXT) == 0) {
m_freem(m);
m_freem(m0);
@ -4081,9 +4081,9 @@ tulip_mbuf_compress(
while (len > 0) {
if (mlen == MHLEN) {
MGETHDR(*mp, M_DONTWAIT, MT_DATA);
MGETHDR(*mp, M_NOWAIT, MT_DATA);
} else {
MGET(*mp, M_DONTWAIT, MT_DATA);
MGET(*mp, M_NOWAIT, MT_DATA);
}
if (*mp == NULL) {
m_freem(m0);
@ -4091,7 +4091,7 @@ tulip_mbuf_compress(
break;
}
if (len > MLEN) {
MCLGET(*mp, M_DONTWAIT);
MCLGET(*mp, M_NOWAIT);
if (((*mp)->m_flags & M_EXT) == 0) {
m_freem(m0);
m0 = NULL;

View File

@ -546,12 +546,12 @@ digi_init(struct digi_softc *sc)
if (sc->ports)
free(sc->ports, M_TTYS);
sc->ports = malloc(sizeof(struct digi_p) * sc->numports,
M_TTYS, M_WAITOK | M_ZERO);
M_TTYS, M_ZERO);
if (sc->ttys)
free(sc->ttys, M_TTYS);
sc->ttys = malloc(sizeof(struct tty) * sc->numports,
M_TTYS, M_WAITOK | M_ZERO);
M_TTYS, M_ZERO);
/*
* XXX Should read port 0xc90 for an array of 2byte values, 1 per
@ -1035,7 +1035,7 @@ digi_loadmoduledata(struct digi_softc *sc)
KASSERT(sc->module != NULL, ("Uninitialised module name"));
modlen = strlen(sc->module);
modfile = malloc(modlen + 6, M_TEMP, M_WAITOK);
modfile = malloc(modlen + 6, M_TEMP, 0);
snprintf(modfile, modlen + 6, "digi_%s", sc->module);
if ((res = linker_reference_module(modfile, NULL, &lf)) != 0) {
if (res == ENOENT && rootdev == NODEV)
@ -1049,7 +1049,7 @@ digi_loadmoduledata(struct digi_softc *sc)
if (res != 0)
return (res);
sym = malloc(modlen + 10, M_TEMP, M_WAITOK);
sym = malloc(modlen + 10, M_TEMP, 0);
snprintf(sym, modlen + 10, "digi_mod_%s", sc->module);
if ((symptr = linker_file_lookup_symbol(lf, sym, 0)) == NULL)
printf("digi_%s.ko: Symbol `%s' not found\n", sc->module, sym);
@ -1065,19 +1065,19 @@ digi_loadmoduledata(struct digi_softc *sc)
sc->bios.size = digi_mod->dm_bios.size;
if (sc->bios.size != 0 && digi_mod->dm_bios.data != NULL) {
sc->bios.data = malloc(sc->bios.size, M_TTYS, M_WAITOK);
sc->bios.data = malloc(sc->bios.size, M_TTYS, 0);
bcopy(digi_mod->dm_bios.data, sc->bios.data, sc->bios.size);
}
sc->fep.size = digi_mod->dm_fep.size;
if (sc->fep.size != 0 && digi_mod->dm_fep.data != NULL) {
sc->fep.data = malloc(sc->fep.size, M_TTYS, M_WAITOK);
sc->fep.data = malloc(sc->fep.size, M_TTYS, 0);
bcopy(digi_mod->dm_fep.data, sc->fep.data, sc->fep.size);
}
sc->link.size = digi_mod->dm_link.size;
if (sc->link.size != 0 && digi_mod->dm_link.data != NULL) {
sc->link.data = malloc(sc->link.size, M_TTYS, M_WAITOK);
sc->link.data = malloc(sc->link.size, M_TTYS, 0);
bcopy(digi_mod->dm_link.data, sc->link.data, sc->link.size);
}

View File

@ -2321,12 +2321,12 @@ dpt_user_cmd(dpt_softc_t * dpt, eata_pt_t * user_cmd,
/* Data I/O is involved in this command. Alocate buffer */
if (ccb->eata_ccb.cp_datalen > PAGE_SIZE) {
data = contigmalloc(ccb->eata_ccb.cp_datalen,
M_TEMP, M_WAITOK, 0, ~0,
M_TEMP, 0, 0, ~0,
ccb->eata_ccb.cp_datalen,
0x10000);
} else {
data = malloc(ccb->eata_ccb.cp_datalen, M_TEMP,
M_WAITOK);
0);
}
if (data == NULL) {

View File

@ -1451,7 +1451,7 @@ DRM(linux_ioctl)(DRM_OS_STRUCTPROC *p, struct linux_ioctl_args* args)
if ( size > STK_PARAMS ) {
if ( size > IOCPARM_MAX )
return EINVAL;
memp = malloc( (u_long)size, DRM(M_DRM), M_WAITOK );
memp = malloc( (u_long)size, DRM(M_DRM), 0 );
data = memp;
} else {
data = ubuf.stkbuf;

View File

@ -288,7 +288,7 @@ unsigned long DRM(alloc_pages)(int order, int area)
address = __get_free_pages(GFP_KERNEL, order);
#endif /* __linux__ */
#ifdef __FreeBSD__
address = (vm_offset_t) contigmalloc(bytes, DRM(M_DRM), M_WAITOK, 0, ~0, 1, 0);
address = (vm_offset_t) contigmalloc(bytes, DRM(M_DRM), 0, 0, ~0, 1, 0);
#endif /* __FreeBSD__ */
if (!address) {
DRM_OS_SPINLOCK(&DRM(mem_lock));

View File

@ -2679,7 +2679,7 @@ ed_get_packet(sc, buf, len)
struct mbuf *m;
/* Allocate a header mbuf */
MGETHDR(m, M_DONTWAIT, MT_DATA);
MGETHDR(m, M_NOWAIT, MT_DATA);
if (m == NULL)
return;
m->m_pkthdr.rcvif = ifp;
@ -2693,7 +2693,7 @@ ed_get_packet(sc, buf, len)
*/
if ((len + 2) > MHLEN) {
/* Attach an mbuf cluster */
MCLGET(m, M_DONTWAIT);
MCLGET(m, M_NOWAIT);
/* Insist on getting a cluster */
if ((m->m_flags & M_EXT) == 0) {

View File

@ -1802,12 +1802,12 @@ em_get_buf(int i, struct adapter *adapter,
ifp = &adapter->interface_data.ac_if;
if (mp == NULL) {
MGETHDR(mp, M_DONTWAIT, MT_DATA);
MGETHDR(mp, M_NOWAIT, MT_DATA);
if (mp == NULL) {
adapter->mbuf_alloc_failed++;
return(ENOBUFS);
}
MCLGET(mp, M_DONTWAIT);
MCLGET(mp, M_NOWAIT);
if ((mp->m_flags & M_EXT) == 0) {
m_freem(mp);
adapter->mbuf_cluster_failed++;

View File

@ -601,7 +601,7 @@ u_int totlen, *drqneed;
struct mbuf *top, **mp;
*drqneed = 0;
MGETHDR(m, M_DONTWAIT, MT_DATA);
MGETHDR(m, M_NOWAIT, MT_DATA);
if (m == NULL)
return(NULL);
m->m_pkthdr.rcvif = &sc->enif;
@ -613,7 +613,7 @@ u_int totlen, *drqneed;
/* if (top != NULL) then we've already got 1 mbuf on the chain */
while (totlen > 0) {
if (top) {
MGET(m, M_DONTWAIT, MT_DATA);
MGET(m, M_NOWAIT, MT_DATA);
if (!m) {
m_freem(top);
return(NULL); /* out of mbufs */
@ -621,7 +621,7 @@ u_int totlen, *drqneed;
m->m_len = MLEN;
}
if (totlen >= MINCLSIZE) {
MCLGET(m, M_DONTWAIT);
MCLGET(m, M_NOWAIT);
if ((m->m_flags & M_EXT) == 0) {
m_free(m);
m_freem(top);
@ -1770,12 +1770,12 @@ struct mbuf **mm, *prev;
m->m_data = (caddr_t)d;
} else {
/* can't write to an M_EXT mbuf since it may be shared */
MGET(new, M_DONTWAIT, MT_DATA);
MGET(new, M_NOWAIT, MT_DATA);
if (!new) {
EN_COUNT(sc->mfixfail);
return(0);
}
MCLGET(new, M_DONTWAIT);
MCLGET(new, M_NOWAIT);
if ((new->m_flags & M_EXT) == 0) {
m_free(new);
EN_COUNT(sc->mfixfail);
@ -1837,14 +1837,14 @@ STATIC int en_makeexclusive(sc, mm, prev)
if (MEXT_IS_REF(m)) {
/* make a real copy of the M_EXT mbuf since it is shared */
MGET(new, M_DONTWAIT, MT_DATA);
MGET(new, M_NOWAIT, MT_DATA);
if (!new) {
EN_COUNT(sc->mfixfail);
return(0);
}
if (m->m_flags & M_PKTHDR)
M_MOVE_PKTHDR(new, m);
MCLGET(new, M_DONTWAIT);
MCLGET(new, M_NOWAIT);
if ((new->m_flags & M_EXT) == 0) {
m_free(new);
EN_COUNT(sc->mfixfail);

View File

@ -686,11 +686,11 @@ epread(sc)
rx_fifo = rx_fifo2 = status & RX_BYTES_MASK;
if (EP_FTST(sc, F_RX_FIRST)) {
MGETHDR(m, M_DONTWAIT, MT_DATA);
MGETHDR(m, M_NOWAIT, MT_DATA);
if (!m)
goto out;
if (rx_fifo >= MINCLSIZE)
MCLGET(m, M_DONTWAIT);
MCLGET(m, M_NOWAIT);
sc->top = sc->mcur = top = m;
#define EROUND ((sizeof(struct ether_header) + 3) & ~3)
#define EOFF (EROUND - sizeof(struct ether_header))
@ -714,11 +714,11 @@ epread(sc)
lenthisone = min(rx_fifo, M_TRAILINGSPACE(m));
if (lenthisone == 0) { /* no room in this one */
mcur = m;
MGET(m, M_DONTWAIT, MT_DATA);
MGET(m, M_NOWAIT, MT_DATA);
if (!m)
goto out;
if (rx_fifo >= MINCLSIZE)
MCLGET(m, M_DONTWAIT);
MCLGET(m, M_NOWAIT);
m->m_len = 0;
mcur->m_next = m;
lenthisone = min(rx_fifo, M_TRAILINGSPACE(m));

View File

@ -695,7 +695,7 @@ ex_rx_intr(struct ex_softc *sc)
QQQ = pkt_len = inw(iobase + IO_PORT_REG);
if (rx_status & RCV_OK_bit) {
MGETHDR(m, M_DONTWAIT, MT_DATA);
MGETHDR(m, M_NOWAIT, MT_DATA);
ipkt = m;
if (ipkt == NULL) {
ifp->if_iqdrops++;
@ -706,7 +706,7 @@ ex_rx_intr(struct ex_softc *sc)
while (pkt_len > 0) {
if (pkt_len > MINCLSIZE) {
MCLGET(m, M_DONTWAIT);
MCLGET(m, M_NOWAIT);
if (m->m_flags & M_EXT) {
m->m_len = MCLBYTES;
} else {
@ -731,7 +731,7 @@ ex_rx_intr(struct ex_softc *sc)
pkt_len -= m->m_len;
if (pkt_len > 0) {
MGET(m->m_next, M_DONTWAIT, MT_DATA);
MGET(m->m_next, M_NOWAIT, MT_DATA);
if (m->m_next == NULL) {
m_freem(ipkt);
ifp->if_iqdrops++;

View File

@ -86,12 +86,12 @@ vid_realloc_array(void)
s = spltty();
newsize = ((adapters + ARRAY_DELTA)/ARRAY_DELTA)*ARRAY_DELTA;
new_adp = malloc(sizeof(*new_adp)*newsize, M_DEVBUF, M_WAITOK | M_ZERO);
new_adp = malloc(sizeof(*new_adp)*newsize, M_DEVBUF, M_ZERO);
new_vidsw = malloc(sizeof(*new_vidsw)*newsize, M_DEVBUF,
M_WAITOK | M_ZERO);
M_ZERO);
#ifdef FB_INSTALL_CDEV
new_cdevsw = malloc(sizeof(*new_cdevsw)*newsize, M_DEVBUF,
M_WAITOK | M_ZERO);
M_ZERO);
#endif
bcopy(adapter, new_adp, sizeof(*adapter)*adapters);
bcopy(vidsw, new_vidsw, sizeof(*vidsw)*adapters);

View File

@ -2848,7 +2848,7 @@ get_palette(video_adapter_t *adp, int base, int count,
if ((base < 0) || (base >= 256) || (base + count > 256))
return EINVAL;
r = malloc(count*3, M_DEVBUF, M_WAITOK);
r = malloc(count*3, M_DEVBUF, 0);
g = r + count;
b = g + count;
if (vga_save_palette2(adp, base, count, r, g, b)) {
@ -2879,7 +2879,7 @@ set_palette(video_adapter_t *adp, int base, int count,
if ((base < 0) || (base >= 256) || (base + count > 256))
return EINVAL;
r = malloc(count*3, M_DEVBUF, M_WAITOK);
r = malloc(count*3, M_DEVBUF, 0);
g = r + count;
b = g + count;
copyin(red, r, count);

View File

@ -1847,13 +1847,13 @@ fe_get_packet (struct fe_softc * sc, u_short len)
*/
/* Allocate an mbuf with packet header info. */
MGETHDR(m, M_DONTWAIT, MT_DATA);
MGETHDR(m, M_NOWAIT, MT_DATA);
if (m == NULL)
return -1;
/* Attach a cluster if this packet doesn't fit in a normal mbuf. */
if (len > MHLEN - NFS_MAGIC_OFFSET) {
MCLGET(m, M_DONTWAIT);
MCLGET(m, M_NOWAIT);
if (!(m->m_flags & M_EXT)) {
m_freem(m);
return -1;

View File

@ -466,7 +466,7 @@ fwe_as_output(struct fwe_softc *fwe, struct ifnet *ifp)
xfer->act.hand = fwe_output_callback;
/* keep ip packet alignment for alpha */
M_PREPEND(m, ALIGN_PAD, M_DONTWAIT);
M_PREPEND(m, ALIGN_PAD, M_NOWAIT);
fp = (struct fw_pkt *)&xfer->dst; /* XXX */
xfer->dst = *((int32_t *)&fwe->pkt_hdr);
fp->mode.stream.len = htons(m->m_pkthdr.len);
@ -544,7 +544,7 @@ fwe_as_input(struct fw_xferq *xferq)
while ((xfer = STAILQ_FIRST(&xferq->q)) != NULL) {
STAILQ_REMOVE_HEAD(&xferq->q, link);
xferq->queued --;
MGETHDR(m, M_DONTWAIT, MT_DATA);
MGETHDR(m, M_NOWAIT, MT_DATA);
if (m == NULL) {
printf("MGETHDR failed\n");
fw_xfer_free(xfer);

View File

@ -763,7 +763,7 @@ END_DEBUG
static void
sbp_cam_scan_lun(struct sbp_dev *sdev)
{
union ccb *ccb = malloc(sizeof(union ccb), M_SBP, M_WAITOK | M_ZERO);
union ccb *ccb = malloc(sizeof(union ccb), M_SBP, M_ZERO);
SBP_DEBUG(0)
sbp_show_sdev_info(sdev, 2);
@ -822,9 +822,9 @@ sbp_ping_unit(struct sbp_dev *sdev)
union ccb *ccb;
struct scsi_inquiry_data *inq_buf;
ccb = malloc(sizeof(union ccb), M_SBP, M_WAITOK | M_ZERO);
ccb = malloc(sizeof(union ccb), M_SBP, M_ZERO);
inq_buf = (struct scsi_inquiry_data *)
malloc(sizeof(*inq_buf), M_SBP, M_WAITOK);
malloc(sizeof(*inq_buf), M_SBP, 0);
SBP_DEBUG(1)
sbp_show_sdev_info(sdev, 2);

View File

@ -1068,13 +1068,13 @@ fxp_start(struct ifnet *ifp)
* mbuf chain first. Bail out if we can't get the
* new buffers.
*/
MGETHDR(mn, M_DONTWAIT, MT_DATA);
MGETHDR(mn, M_NOWAIT, MT_DATA);
if (mn == NULL) {
m_freem(mb_head);
break;
}
if (mb_head->m_pkthdr.len > MHLEN) {
MCLGET(mn, M_DONTWAIT);
MCLGET(mn, M_NOWAIT);
if ((mn->m_flags & M_EXT) == 0) {
m_freem(mn);
m_freem(mb_head);
@ -1872,7 +1872,7 @@ fxp_add_rfabuf(struct fxp_softc *sc, struct mbuf *oldm)
struct mbuf *m;
struct fxp_rfa *rfa, *p_rfa;
m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR);
m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR);
if (m == NULL) { /* try to recycle the old mbuf instead */
if (oldm == NULL)
return 1;

View File

@ -1425,7 +1425,7 @@ gem_add_rxbuf(sc, idx)
struct mbuf *m;
int error;
m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR);
m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR);
if (m == NULL)
return (ENOBUFS);
m->m_len = m->m_pkthdr.len = m->m_ext.ext_size;

View File

@ -1068,13 +1068,13 @@ gx_newbuf(struct gx_softc *gx, int idx, struct mbuf *m)
struct gx_rx_desc *r;
if (m == NULL) {
MGETHDR(m_new, M_DONTWAIT, MT_DATA);
MGETHDR(m_new, M_NOWAIT, MT_DATA);
if (m_new == NULL) {
device_printf(gx->gx_dev,
"mbuf allocation failed -- packet dropped\n");
return (ENOBUFS);
}
MCLGET(m_new, M_DONTWAIT);
MCLGET(m_new, M_NOWAIT);
if ((m_new->m_flags & M_EXT) == 0) {
device_printf(gx->gx_dev,
"cluster allocation failed -- packet dropped\n");

View File

@ -1669,14 +1669,14 @@ hifn_crypto(
totlen = cmd->src_mapsize;
if (cmd->src_m->m_flags & M_PKTHDR) {
len = MHLEN;
MGETHDR(m0, M_DONTWAIT, MT_DATA);
if (m0 && !m_dup_pkthdr(m0, cmd->src_m, M_DONTWAIT)) {
MGETHDR(m0, M_NOWAIT, MT_DATA);
if (m0 && !m_dup_pkthdr(m0, cmd->src_m, M_NOWAIT)) {
m_free(m0);
m0 = NULL;
}
} else {
len = MLEN;
MGET(m0, M_DONTWAIT, MT_DATA);
MGET(m0, M_NOWAIT, MT_DATA);
}
if (m0 == NULL) {
hifnstats.hst_nomem_mbuf++;
@ -1684,7 +1684,7 @@ hifn_crypto(
goto err_srcmap;
}
if (totlen >= MINCLSIZE) {
MCLGET(m0, M_DONTWAIT);
MCLGET(m0, M_NOWAIT);
if ((m0->m_flags & M_EXT) == 0) {
hifnstats.hst_nomem_mcl++;
err = dma->cmdu ? ERESTART : ENOMEM;
@ -1698,7 +1698,7 @@ hifn_crypto(
mlast = m0;
while (totlen > 0) {
MGET(m, M_DONTWAIT, MT_DATA);
MGET(m, M_NOWAIT, MT_DATA);
if (m == NULL) {
hifnstats.hst_nomem_mbuf++;
err = dma->cmdu ? ERESTART : ENOMEM;
@ -1707,7 +1707,7 @@ hifn_crypto(
}
len = MLEN;
if (totlen >= MINCLSIZE) {
MCLGET(m, M_DONTWAIT);
MCLGET(m, M_NOWAIT);
if ((m->m_flags & M_EXT) == 0) {
hifnstats.hst_nomem_mcl++;
err = dma->cmdu ? ERESTART : ENOMEM;

View File

@ -493,7 +493,7 @@ hme_add_rxbuf(struct hme_softc *sc, unsigned int ri, int keepold)
hme_discard_rxbuf(sc, ri, 0);
return (0);
}
if ((m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR)) == NULL)
if ((m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR)) == NULL)
return (ENOBUFS);
m->m_len = m->m_pkthdr.len = m->m_ext.ext_size;
b = mtod(m, uintptr_t);

View File

@ -1171,10 +1171,10 @@ nicstar_ld_rcv_buf(IDT * idt)
idt_sysctl_buflarge = 10;
while (card_small < idt_sysctl_bufsmall) { /* 05/25/2001 from fixed */
MGETHDR(m1, M_DONTWAIT, MT_DATA);
MGETHDR(m1, M_NOWAIT, MT_DATA);
if (m1 == NULL)
break;
MGETHDR(m2, M_DONTWAIT, MT_DATA);
MGETHDR(m2, M_NOWAIT, MT_DATA);
if (m2 == NULL) {
m_free(m1);
break;
@ -2006,11 +2006,11 @@ idt_mbufcl_get(void)
{
struct mbuf *m;
MGETHDR(m, M_DONTWAIT, MT_DATA);
MGETHDR(m, M_NOWAIT, MT_DATA);
if (m == NULL)
return (NULL);
MCLGET(m, M_DONTWAIT);
MCLGET(m, M_NOWAIT);
if (m->m_flags & M_EXT)
return (m);

View File

@ -1133,7 +1133,7 @@ ieget(int unit, struct ie_softc *ie, struct mbuf **mp)
if (totlen <= 0)
return (-1);
MGETHDR(m, M_DONTWAIT, MT_DATA);
MGETHDR(m, M_NOWAIT, MT_DATA);
if (!m) {
ie_drop_packet_buffer(unit, ie);
/* XXXX if_ierrors++; */
@ -1188,7 +1188,7 @@ ieget(int unit, struct ie_softc *ie, struct mbuf **mp)
* single mbuf which may or may not be big enough. Got that?
*/
if (top) {
MGET(m, M_DONTWAIT, MT_DATA);
MGET(m, M_NOWAIT, MT_DATA);
if (!m) {
m_freem(top);
ie_drop_packet_buffer(unit, ie);
@ -1197,7 +1197,7 @@ ieget(int unit, struct ie_softc *ie, struct mbuf **mp)
m->m_len = MLEN;
}
if (resid >= MINCLSIZE) {
MCLGET(m, M_DONTWAIT);
MCLGET(m, M_NOWAIT);
if (m->m_flags & M_EXT)
m->m_len = min(resid, MCLBYTES);
} else {

View File

@ -192,14 +192,14 @@ icioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
return (error);
sc->ic_obuf = malloc(sc->ic_if.if_mtu + ICHDRLEN,
M_DEVBUF, M_WAITOK);
M_DEVBUF, 0);
if (!sc->ic_obuf) {
iicbus_release_bus(parent, icdev);
return ENOBUFS;
}
sc->ic_ifbuf = malloc(sc->ic_if.if_mtu + ICHDRLEN,
M_DEVBUF, M_WAITOK);
M_DEVBUF, 0);
if (!sc->ic_ifbuf) {
iicbus_release_bus(parent, icdev);
return ENOBUFS;

View File

@ -624,7 +624,7 @@ isp_pci_attach(device_t dev)
}
if (amt) {
FCPARAM(isp)->isp_dump_data =
malloc(amt, M_DEVBUF, M_WAITOK | M_ZERO);
malloc(amt, M_DEVBUF, M_ZERO);
} else {
device_printf(dev,
"f/w crash dumps not supported for this model\n");
@ -1105,14 +1105,14 @@ isp_pci_mbxdma(struct ispsoftc *isp)
len = sizeof (XS_T **) * isp->isp_maxcmds;
isp->isp_xflist = (XS_T **) malloc(len, M_DEVBUF, M_WAITOK | M_ZERO);
isp->isp_xflist = (XS_T **) malloc(len, M_DEVBUF, M_ZERO);
if (isp->isp_xflist == NULL) {
isp_prt(isp, ISP_LOGERR, "cannot alloc xflist array");
ISP_LOCK(isp);
return (1);
}
len = sizeof (bus_dmamap_t) * isp->isp_maxcmds;
pcs->dmaps = (bus_dmamap_t *) malloc(len, M_DEVBUF, M_WAITOK);
pcs->dmaps = (bus_dmamap_t *) malloc(len, M_DEVBUF, 0);
if (pcs->dmaps == NULL) {
isp_prt(isp, ISP_LOGERR, "can't alloc dma map storage");
free(isp->isp_xflist, M_DEVBUF);

View File

@ -498,14 +498,14 @@ isp_sbus_mbxdma(struct ispsoftc *isp)
}
len = sizeof (XS_T **) * isp->isp_maxcmds;
isp->isp_xflist = (XS_T **) malloc(len, M_DEVBUF, M_WAITOK | M_ZERO);
isp->isp_xflist = (XS_T **) malloc(len, M_DEVBUF, M_ZERO);
if (isp->isp_xflist == NULL) {
isp_prt(isp, ISP_LOGERR, "cannot alloc xflist array");
ISP_LOCK(isp);
return (1);
}
len = sizeof (bus_dmamap_t) * isp->isp_maxcmds;
sbs->dmaps = (bus_dmamap_t *) malloc(len, M_DEVBUF, M_WAITOK);
sbs->dmaps = (bus_dmamap_t *) malloc(len, M_DEVBUF, 0);
if (sbs->dmaps == NULL) {
isp_prt(isp, ISP_LOGERR, "can't alloc dma map storage");
free(isp->isp_xflist, M_DEVBUF);

View File

@ -454,7 +454,7 @@ kbd_attach(keyboard_t *kbd)
"kbd%r", kbd->kb_index);
if (dev->si_drv1 == NULL)
dev->si_drv1 = malloc(sizeof(genkbd_softc_t), M_DEVBUF,
M_WAITOK);
0);
bzero(dev->si_drv1, sizeof(genkbd_softc_t));
printf("kbd%d at %s%d\n", kbd->kb_index, kbd->kb_name, kbd->kb_unit);

View File

@ -784,7 +784,7 @@ lge_newbuf(sc, c, m)
caddr_t *buf = NULL;
if (m == NULL) {
MGETHDR(m_new, M_DONTWAIT, MT_DATA);
MGETHDR(m_new, M_NOWAIT, MT_DATA);
if (m_new == NULL) {
printf("lge%d: no memory for rx list "
"-- packet dropped!\n", sc->lge_unit);

View File

@ -621,9 +621,9 @@ lmc_rx_intr(lmc_softc_t * const sc)
*/
if (accept || ms == NULL) {
struct mbuf *m0;
MGETHDR(m0, M_DONTWAIT, MT_DATA);
MGETHDR(m0, M_NOWAIT, MT_DATA);
if (m0 != NULL) {
MCLGET(m0, M_DONTWAIT);
MCLGET(m0, M_NOWAIT);
if ((m0->m_flags & M_EXT) == 0) {
m_freem(m0);
m0 = NULL;
@ -830,10 +830,10 @@ lmc_mbuf_compress(struct mbuf *m)
{
struct mbuf *m0;
#if MCLBYTES >= LMC_MTU + PPP_HEADER_LEN && !defined(BIG_PACKET)
MGETHDR(m0, M_DONTWAIT, MT_DATA);
MGETHDR(m0, M_NOWAIT, MT_DATA);
if (m0 != NULL) {
if (m->m_pkthdr.len > MHLEN) {
MCLGET(m0, M_DONTWAIT);
MCLGET(m0, M_NOWAIT);
if ((m0->m_flags & M_EXT) == 0) {
m_freem(m);
m_freem(m0);
@ -850,9 +850,9 @@ lmc_mbuf_compress(struct mbuf *m)
while (len > 0) {
if (mlen == MHLEN) {
MGETHDR(*mp, M_DONTWAIT, MT_DATA);
MGETHDR(*mp, M_NOWAIT, MT_DATA);
} else {
MGET(*mp, M_DONTWAIT, MT_DATA);
MGET(*mp, M_NOWAIT, MT_DATA);
}
if (*mp == NULL) {
m_freem(m0);
@ -860,7 +860,7 @@ lmc_mbuf_compress(struct mbuf *m)
break;
}
if (len > MLEN) {
MCLGET(*mp, M_DONTWAIT);
MCLGET(*mp, M_NOWAIT);
if (((*mp)->m_flags & M_EXT) == 0) {
m_freem(m0);
m0 = NULL;

View File

@ -314,10 +314,10 @@ alloc_mbuf_cluster(struct lnc_softc *sc, struct host_ring_entry *desc)
sc->mbufs = m->m_next;
/* XXX m->m_data = m->m_ext.ext_buf;*/
} else {
MGET(m, M_DONTWAIT, MT_DATA);
MGET(m, M_NOWAIT, MT_DATA);
if (!m)
return(1);
MCLGET(m, M_DONTWAIT);
MCLGET(m, M_NOWAIT);
if (!m->m_ext.ext_buf) {
m_free(m);
return(1);
@ -379,7 +379,7 @@ mbuf_packet(struct lnc_softc *sc, int start_of_packet, int pkt_len)
int amount;
/* Get a pkthdr mbuf for the start of packet */
MGETHDR(head, M_DONTWAIT, MT_DATA);
MGETHDR(head, M_NOWAIT, MT_DATA);
if (!head) {
LNCSTATS(drop_packet)
return(0);
@ -409,13 +409,13 @@ mbuf_packet(struct lnc_softc *sc, int start_of_packet, int pkt_len)
if (amount == 0) {
/* mbuf must be empty */
m_prev = m;
MGET(m, M_DONTWAIT, MT_DATA);
MGET(m, M_NOWAIT, MT_DATA);
if (!m) {
m_freem(head);
return(0);
}
if (pkt_len >= MINCLSIZE)
MCLGET(m, M_DONTWAIT);
MCLGET(m, M_NOWAIT);
m->m_len = 0;
m_prev->m_next = m;
amount = min(blen, M_TRAILINGSPACE(m));
@ -1218,9 +1218,9 @@ chain_to_cluster(struct mbuf *m)
{
struct mbuf *new;
MGET(new, M_DONTWAIT, MT_DATA);
MGET(new, M_NOWAIT, MT_DATA);
if (new) {
MCLGET(new, M_DONTWAIT);
MCLGET(new, M_NOWAIT);
if (new->m_ext.ext_buf) {
new->m_len = mbuf_to_buffer(m, new->m_data);
m_freem(m);

View File

@ -759,7 +759,7 @@ mdnew(int unit)
unit = max + 1;
if (unit > 255)
return (NULL);
sc = (struct md_s *)malloc(sizeof *sc, M_MD, M_WAITOK | M_ZERO);
sc = (struct md_s *)malloc(sizeof *sc, M_MD, M_ZERO);
sc->unit = unit;
bioq_init(&sc->bio_queue);
mtx_init(&sc->queue_mtx, "md bio queue", NULL, MTX_DEF);
@ -918,7 +918,7 @@ mdsetcred(struct md_s *sc, struct ucred *cred)
struct uio auio;
struct iovec aiov;
tmpbuf = malloc(sc->secsize, M_TEMP, M_WAITOK);
tmpbuf = malloc(sc->secsize, M_TEMP, 0);
bzero(&auio, sizeof(auio));
aiov.iov_base = tmpbuf;

View File

@ -1880,7 +1880,7 @@ mlx_user_command(struct mlx_softc *sc, struct mlx_usercommand *mu)
if (mu->mu_datasize > 0) {
if (mu->mu_datasize > MAXPHYS)
return (EINVAL);
if (((kbuf = malloc(mu->mu_datasize, M_DEVBUF, M_WAITOK)) == NULL) ||
if (((kbuf = malloc(mu->mu_datasize, M_DEVBUF, 0)) == NULL) ||
(error = copyin(mu->mu_buf, kbuf, mu->mu_datasize)))
goto out;
debug(0, "got kernel buffer");

View File

@ -2008,7 +2008,7 @@ mly_cam_rescan_btl(struct mly_softc *sc, int bus, int target)
debug_called(1);
if ((ccb = malloc(sizeof(union ccb), M_TEMP, M_WAITOK | M_ZERO)) == NULL) {
if ((ccb = malloc(sizeof(union ccb), M_TEMP, M_ZERO)) == NULL) {
mly_printf(sc, "rescan failed (can't allocate CCB)\n");
return;
}

View File

@ -478,7 +478,7 @@ mpt_dma_mem_alloc(mpt_softc_t *mpt)
len = sizeof (request_t *) * MPT_REQ_MEM_SIZE(mpt);
#ifdef RELENG_4
mpt->request_pool = (request_t *) malloc(len, M_DEVBUF, M_WAITOK);
mpt->request_pool = (request_t *) malloc(len, M_DEVBUF, 0);
if (mpt->request_pool == NULL) {
device_printf(dev, "cannot allocate request pool\n");
return (1);
@ -486,7 +486,7 @@ mpt_dma_mem_alloc(mpt_softc_t *mpt)
bzero(mpt->request_pool, len);
#else
mpt->request_pool = (request_t *)
malloc(len, M_DEVBUF, M_WAITOK | M_ZERO);
malloc(len, M_DEVBUF, M_ZERO);
if (mpt->request_pool == NULL) {
device_printf(dev, "cannot allocate request pool\n");
return (1);

View File

@ -696,9 +696,9 @@ musycc_intr0_rx_eom(struct softc *sc, int ch)
m->m_len = m->m_pkthdr.len = status & 0x3fff;
error = (status >> 16) & 0xf;
if (error == 0) {
MGETHDR(m2, M_DONTWAIT, MT_DATA);
MGETHDR(m2, M_NOWAIT, MT_DATA);
if (m2 != NULL) {
MCLGET(m2, M_DONTWAIT);
MCLGET(m2, M_NOWAIT);
if((m2->m_flags & M_EXT) != 0) {
/* Substitute the mbuf+cluster. */
md->m = m2;
@ -1069,7 +1069,7 @@ musycc_newhook(node_p node, hook_p hook, const char *name)
return (EINVAL);
if (sc->chan[chan] == NULL) {
MALLOC(sch, struct schan *, sizeof(*sch), M_MUSYCC, M_WAITOK | M_ZERO);
MALLOC(sch, struct schan *, sizeof(*sch), M_MUSYCC, M_ZERO);
sch->sc = sc;
sch->state = DOWN;
sch->chan = chan;
@ -1268,9 +1268,9 @@ musycc_connect(hook_p hook)
sch->nmd = nmd = 200 + nts * 4;
sch->rx_last_md = 0;
MALLOC(sc->mdt[ch], struct mdesc *,
sizeof(struct mdesc) * nmd, M_MUSYCC, M_WAITOK);
sizeof(struct mdesc) * nmd, M_MUSYCC, 0);
MALLOC(sc->mdr[ch], struct mdesc *,
sizeof(struct mdesc) * nmd, M_MUSYCC, M_WAITOK);
sizeof(struct mdesc) * nmd, M_MUSYCC, 0);
for (i = 0; i < nmd; i++) {
if (i == nmd - 1) {
sc->mdt[ch][i].snext = &sc->mdt[ch][0];
@ -1287,13 +1287,13 @@ musycc_connect(hook_p hook)
sc->mdt[ch][i].m = NULL;
sc->mdt[ch][i].data = 0;
MGETHDR(m, M_TRYWAIT, MT_DATA);
MGETHDR(m, 0, MT_DATA);
if (m == NULL)
goto errfree;
MCLGET(m, M_TRYWAIT);
MCLGET(m, 0);
if ((m->m_flags & M_EXT) == 0) {
/* We've waited mbuf_wait and still got nothing.
We're calling with M_TRYWAIT anyway - a little
We're calling with 0 anyway - a little
defensive programming costs us very little - if
anything at all in the case of error. */
m_free(m);
@ -1455,7 +1455,7 @@ musycc_attach(device_t self)
f = pci_get_function(self);
/* For function zero allocate a csoftc */
if (f == 0) {
MALLOC(csc, struct csoftc *, sizeof(*csc), M_MUSYCC, M_WAITOK | M_ZERO);
MALLOC(csc, struct csoftc *, sizeof(*csc), M_MUSYCC, M_ZERO);
csc->bus = pci_get_bus(self);
csc->slot = pci_get_slot(self);
LIST_INSERT_HEAD(&sc_list, csc, list);
@ -1529,7 +1529,7 @@ musycc_attach(device_t self)
sc->reg = (struct globalr *)
(csc->virbase[0] + i * 0x800);
MALLOC(sc->mycg, struct mycg *,
sizeof(struct mycg), M_MUSYCC, M_WAITOK | M_ZERO);
sizeof(struct mycg), M_MUSYCC, M_ZERO);
sc->ram = &sc->mycg->cg;
error = ng_make_node_common(&ngtypestruct, &sc->node);

View File

@ -1179,14 +1179,14 @@ my_newbuf(struct my_softc * sc, struct my_chain_onefrag * c)
struct mbuf *m_new = NULL;
MY_LOCK(sc);
MGETHDR(m_new, M_DONTWAIT, MT_DATA);
MGETHDR(m_new, M_NOWAIT, MT_DATA);
if (m_new == NULL) {
printf("my%d: no memory for rx list -- packet dropped!\n",
sc->my_unit);
MY_UNLOCK(sc);
return (ENOBUFS);
}
MCLGET(m_new, M_DONTWAIT);
MCLGET(m_new, M_NOWAIT);
if (!(m_new->m_flags & M_EXT)) {
printf("my%d: no memory for rx list -- packet dropped!\n",
sc->my_unit);
@ -1451,14 +1451,14 @@ my_encap(struct my_softc * sc, struct my_chain * c, struct mbuf * m_head)
* chain.
*/
m = m_head;
MGETHDR(m_new, M_DONTWAIT, MT_DATA);
MGETHDR(m_new, M_NOWAIT, MT_DATA);
if (m_new == NULL) {
printf("my%d: no memory for tx list", sc->my_unit);
MY_UNLOCK(sc);
return (1);
}
if (m_head->m_pkthdr.len > MHLEN) {
MCLGET(m_new, M_DONTWAIT);
MCLGET(m_new, M_NOWAIT);
if (!(m_new->m_flags & M_EXT)) {
m_freem(m_new);
printf("my%d: no memory for tx list", sc->my_unit);

View File

@ -1162,7 +1162,7 @@ nge_newbuf(sc, c, m)
caddr_t *buf = NULL;
if (m == NULL) {
MGETHDR(m_new, M_DONTWAIT, MT_DATA);
MGETHDR(m_new, M_NOWAIT, MT_DATA);
if (m_new == NULL) {
printf("nge%d: no memory for rx list "
"-- packet dropped!\n", sc->nge_unit);

View File

@ -133,7 +133,7 @@ nmdminit(n)
if (n & ~0xff)
return;
pt = malloc(sizeof(*pt), M_NLMDM, M_WAITOK);
pt = malloc(sizeof(*pt), M_NLMDM, 0);
bzero(pt, sizeof(*pt));
pt->part1.dev = dev1 = make_dev(&nmdm_cdevsw, n+n,
0, 0, 0666, "nmdm%dA", n);

View File

@ -127,7 +127,7 @@ null_modevent(module_t mod, int type, void *data)
case MOD_LOAD:
if (bootverbose)
printf("null: <null device, zero device>\n");
zbuf = (void *)malloc(PAGE_SIZE, M_TEMP, M_WAITOK | M_ZERO);
zbuf = (void *)malloc(PAGE_SIZE, M_TEMP, M_ZERO);
zero_dev = make_dev(&zero_cdevsw, ZERO_MINOR, UID_ROOT,
GID_WHEEL, 0666, "zero");
null_dev = make_dev(&null_cdevsw, NULL_MINOR, UID_ROOT,

View File

@ -292,7 +292,7 @@ OF_getprop(phandle_t package, char *propname, void *buf, int buflen)
/*
* Store the value of a property of a package into newly allocated memory (using
* the M_OFWPROP malloc pool and M_WAITOK). elsz is the size of a single element,
* the M_OFWPROP malloc pool and 0). elsz is the size of a single element,
* the number of elements is return in number.
*/
int
@ -305,7 +305,7 @@ OF_getprop_alloc(phandle_t package, char *propname, int elsz, void **buf)
len % elsz != 0)
return (-1);
*buf = malloc(len, M_OFWPROP, M_WAITOK);
*buf = malloc(len, M_OFWPROP, 0);
if (OF_getprop(package, propname, *buf, len) == -1) {
free(*buf, M_OFWPROP);
*buf = NULL;

View File

@ -115,7 +115,7 @@ openfirm_getstr(int len, const char *user, char **cpp)
if ((u_int)len > OFW_NAME_MAX)
return (ENAMETOOLONG);
*cpp = cp = malloc(len + 1, M_TEMP, M_WAITOK);
*cpp = cp = malloc(len + 1, M_TEMP, 0);
if (cp == NULL)
return (ENOMEM);
error = copyin(user, cp, len);
@ -183,7 +183,7 @@ openfirm_ioctl(dev_t dev, u_long cmd, caddr_t data, int flags,
/* -1 means no entry; 0 means no value */
if (len <= 0)
break;
value = malloc(len, M_TEMP, M_WAITOK);
value = malloc(len, M_TEMP, 0);
if (value == NULL) {
error = ENOMEM;
break;

View File

@ -224,7 +224,7 @@ pccard_attach_card(device_t dev)
* can be on at a time.
*/
ivar = malloc(sizeof(struct pccard_ivar), M_DEVBUF,
M_WAITOK | M_ZERO);
M_ZERO);
child = device_add_child(dev, NULL, -1);
device_set_ivars(child, ivar);
ivar->fcn = pf;

View File

@ -333,7 +333,7 @@ pci_read_device(device_t pcib, int b, int s, int f, size_t size)
devlist_entry = NULL;
if (PCIB_READ_CONFIG(pcib, b, s, f, PCIR_DEVVENDOR, 4) != -1) {
devlist_entry = malloc(size, M_DEVBUF, M_WAITOK | M_ZERO);
devlist_entry = malloc(size, M_DEVBUF, M_ZERO);
if (devlist_entry == NULL)
return (NULL);

View File

@ -307,7 +307,7 @@ pci_ioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
* Allocate a buffer to hold the patterns.
*/
pattern_buf = malloc(cio->pat_buf_len, M_TEMP,
M_WAITOK);
0);
error = copyin(cio->patterns, pattern_buf,
cio->pat_buf_len);
if (error != 0)

Some files were not shown because too many files have changed in this diff Show More