after discussions with beck deraadt kettenis.
-/* $OpenBSD: fifo_vnops.c,v 1.39 2013/03/28 03:29:44 guenther Exp $ */
+/* $OpenBSD: fifo_vnops.c,v 1.40 2014/07/12 18:43:52 tedu Exp $ */
/* $NetBSD: fifo_vnops.c,v 1.18 1996/03/16 23:52:42 christos Exp $ */
/*
fip = malloc(sizeof(*fip), M_VNODE, M_WAITOK);
vp->v_fifoinfo = fip;
if ((error = socreate(AF_LOCAL, &rso, SOCK_STREAM, 0)) != 0) {
- free(fip, M_VNODE);
+ free(fip, M_VNODE, 0);
vp->v_fifoinfo = NULL;
return (error);
}
fip->fi_readsock = rso;
if ((error = socreate(AF_LOCAL, &wso, SOCK_STREAM, 0)) != 0) {
(void)soclose(rso);
- free(fip, M_VNODE);
+ free(fip, M_VNODE, 0);
vp->v_fifoinfo = NULL;
return (error);
}
if ((error = unp_connect2(wso, rso)) != 0) {
(void)soclose(wso);
(void)soclose(rso);
- free(fip, M_VNODE);
+ free(fip, M_VNODE, 0);
vp->v_fifoinfo = NULL;
return (error);
}
if (fip->fi_readers == 0 && fip->fi_writers == 0) {
error1 = soclose(fip->fi_readsock);
error2 = soclose(fip->fi_writesock);
- free(fip, M_VNODE);
+ free(fip, M_VNODE, 0);
vp->v_fifoinfo = NULL;
}
return (error1 ? error1 : error2);
soclose(fip->fi_readsock);
soclose(fip->fi_writesock);
- free(fip, M_VNODE);
+ free(fip, M_VNODE, 0);
vp->v_fifoinfo = NULL;
return (0);
-/* $OpenBSD: fuse_device.c,v 1.14 2014/03/18 08:51:53 mpi Exp $ */
+/* $OpenBSD: fuse_device.c,v 1.15 2014/07/12 18:43:52 tedu Exp $ */
/*
* Copyright (c) 2012-2013 Sylvestre Gallon <ccna.syl@gmail.com>
*
{
LIST_REMOVE(fd, fd_list);
fuse_device_cleanup(dev, NULL);
- free(fd, M_DEVBUF);
+ free(fd, M_DEVBUF, 0);
}
/*
#endif
/* Adding fbuf in fd_fbufs_wait */
- free(fbuf->fb_dat, M_FUSEFS);
+ free(fbuf->fb_dat, M_FUSEFS, 0);
fbuf->fb_dat = NULL;
SIMPLEQ_INSERT_TAIL(&fd->fd_fbufs_wait, fbuf, fb_next);
stat_fbufs_wait++;
ioexch->fbxch_len);
if (error) {
printf("fuse: Cannot copyin\n");
- free(fbuf->fb_dat, M_FUSEFS);
+ free(fbuf->fb_dat, M_FUSEFS, 0);
fbuf->fb_dat = NULL;
return (error);
}
-/* $OpenBSD: fuse_vfsops.c,v 1.10 2014/06/04 18:52:53 syl Exp $ */
+/* $OpenBSD: fuse_vfsops.c,v 1.11 2014/07/12 18:43:52 tedu Exp $ */
/*
* Copyright (c) 2012-2013 Sylvestre Gallon <ccna.syl@gmail.com>
*
fuse_device_cleanup(fmp->dev, NULL);
fuse_device_set_fmp(fmp, 0);
- free(fmp, M_FUSEFS);
+ free(fmp, M_FUSEFS, 0);
return (error);
}
-/* $OpenBSD: fuse_vnops.c,v 1.18 2014/05/20 13:32:22 syl Exp $ */
+/* $OpenBSD: fuse_vnops.c,v 1.19 2014/07/12 18:43:52 tedu Exp $ */
/*
* Copyright (c) 2012-2013 Sylvestre Gallon <ccna.syl@gmail.com>
*
ufs_ihashrem(&ip->ufs_ino);
cache_purge(vp);
- free(ip, M_FUSEFS);
+ free(ip, M_FUSEFS, 0);
vp->v_data = NULL;
return (0);
}
-/* $OpenBSD: fusebuf.c,v 1.6 2013/10/07 18:15:21 syl Exp $ */
+/* $OpenBSD: fusebuf.c,v 1.7 2014/07/12 18:43:52 tedu Exp $ */
/*
* Copyright (c) 2012-2013 Sylvestre Gallon <ccna.syl@gmail.com>
*
fb_delete(struct fusebuf *fbuf)
{
if (fbuf != NULL) {
- free(fbuf->fb_dat, M_FUSEFS);
+ free(fbuf->fb_dat, M_FUSEFS, 0);
pool_put(&fusefs_fbuf_pool, fbuf);
}
}
-/* $OpenBSD: procfs_cmdline.c,v 1.12 2014/07/08 17:19:25 deraadt Exp $ */
+/* $OpenBSD: procfs_cmdline.c,v 1.13 2014/07/12 18:43:52 tedu Exp $ */
/* $NetBSD: procfs_cmdline.c,v 1.3 1999/03/13 22:26:48 thorpej Exp $ */
/*
else
error = uiomove(arg, len - uio->uio_offset, uio);
- free(arg, M_TEMP);
+ free(arg, M_TEMP, 0);
return (error);
}
*/
/* XXXCDC: how should locking work here? */
if ((pr->ps_flags & PS_EXITING) || (pr->ps_vmspace->vm_refcnt < 1)) {
- free(arg, M_TEMP);
+ free(arg, M_TEMP, 0);
return (EFAULT);
}
vm = pr->ps_vmspace;
bad:
uvmspace_free(vm);
- free(arg, M_TEMP);
+ free(arg, M_TEMP, 0);
return (error);
}
-/* $OpenBSD: procfs_status.c,v 1.15 2013/10/01 20:15:56 sf Exp $ */
+/* $OpenBSD: procfs_status.c,v 1.16 2014/07/12 18:43:52 tedu Exp $ */
/* $NetBSD: procfs_status.c,v 1.11 1996/03/16 23:52:50 christos Exp $ */
/*
error = uiomove(ps + uio->uio_offset, len, uio);
}
- free(ps, M_TEMP);
+ free(ps, M_TEMP, 0);
return (error);
}
-/* $OpenBSD: procfs_subr.c,v 1.35 2011/12/24 04:34:20 guenther Exp $ */
+/* $OpenBSD: procfs_subr.c,v 1.36 2014/07/12 18:43:52 tedu Exp $ */
/* $NetBSD: procfs_subr.c,v 1.15 1996/02/12 15:01:42 christos Exp $ */
/*
struct pfsnode *pfs = VTOPFS(vp);
TAILQ_REMOVE(&pfshead, pfs, list);
- free(vp->v_data, M_TEMP);
+ free(vp->v_data, M_TEMP, 0);
vp->v_data = 0;
return (0);
}
-/* $OpenBSD: procfs_vfsops.c,v 1.31 2014/07/08 17:19:25 deraadt Exp $ */
+/* $OpenBSD: procfs_vfsops.c,v 1.32 2014/07/12 18:43:52 tedu Exp $ */
/* $NetBSD: procfs_vfsops.c,v 1.25 1996/02/09 22:40:53 christos Exp $ */
/*
if ((error = vflush(mp, 0, flags)) != 0)
return (error);
- free(VFSTOPROC(mp), M_MISCFSMNT);
+ free(VFSTOPROC(mp), M_MISCFSMNT, 0);
mp->mnt_data = 0;
return (0);
-/* $OpenBSD: nfs_aiod.c,v 1.5 2013/11/03 13:50:24 miod Exp $ */
+/* $OpenBSD: nfs_aiod.c,v 1.6 2014/07/12 18:43:52 tedu Exp $ */
/*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
goto loop;
out1:
- free(aiod, M_TEMP);
+ free(aiod, M_TEMP, 0);
nfs_numaiods--;
KASSERT(nfs_numaiods >= 0);
/* Rejust the limit of bufs to queue. See comment above. */
-/* $OpenBSD: nfs_kq.c,v 1.19 2014/07/08 17:19:26 deraadt Exp $ */
+/* $OpenBSD: nfs_kq.c,v 1.20 2014/07/12 18:43:52 tedu Exp $ */
/* $NetBSD: nfs_kq.c,v 1.7 2003/10/30 01:43:10 simonb Exp $ */
/*-
} else {
/* last user, g/c */
SLIST_REMOVE(&kevlist, ke, kevq, kev_link);
- free(ke, M_KEVENT);
+ free(ke, M_KEVENT, 0);
}
break;
}
-/* $OpenBSD: nfs_node.c,v 1.55 2010/12/21 20:14:43 thib Exp $ */
+/* $OpenBSD: nfs_node.c,v 1.56 2014/07/12 18:43:52 tedu Exp $ */
/* $NetBSD: nfs_node.c,v 1.16 1996/02/18 11:53:42 fvdl Exp $ */
/*
nfs_removeit(sp);
crfree(sp->s_cred);
vrele(sp->s_dvp);
- free(sp, M_NFSREQ);
+ free(sp, M_NFSREQ, 0);
}
np->n_flag &= (NMODIFIED | NFLUSHINPROG | NFLUSHWANT);
-/* $OpenBSD: nfs_serv.c,v 1.96 2014/07/08 17:19:26 deraadt Exp $ */
+/* $OpenBSD: nfs_serv.c,v 1.97 2014/07/12 18:43:52 tedu Exp $ */
/* $NetBSD: nfs_serv.c,v 1.34 1997/05/12 23:37:12 fvdl Exp $ */
/*
uiop->uio_segflg = UIO_SYSSPACE;
error = VOP_READ(vp, uiop, IO_NODELOCKED, cred);
off = uiop->uio_offset;
- free(iv2, M_TEMP);
+ free(iv2, M_TEMP, 0);
if (error || (getret = VOP_GETATTR(vp, &va, cred, procp)) != 0){
if (!error)
error = getret;
uiop->uio_offset = off;
error = VOP_WRITE(vp, uiop, ioflags, cred);
nfsstats.srvvop_writes++;
- free(iv, M_TEMP);
+ free(iv, M_TEMP, 0);
}
aftat_ret = VOP_GETATTR(vp, &va, cred, procp);
vput(vp);
}
out:
if (pathcp)
- free(pathcp, M_TEMP);
+ free(pathcp, M_TEMP, 0);
if (dirp) {
diraft_ret = VOP_GETATTR(dirp, &diraft, cred, procp);
vrele(dirp);
if (nd.ni_vp)
vrele(nd.ni_vp);
if (pathcp)
- free(pathcp, M_TEMP);
+ free(pathcp, M_TEMP, 0);
return (error);
}
VOP_UNLOCK(vp, 0, procp);
if (error) {
vrele(vp);
- free((caddr_t)rbuf, M_TEMP);
+ free((caddr_t)rbuf, M_TEMP, 0);
nfsm_reply(NFSX_POSTOPATTR(info.nmi_v3));
nfsm_srvpostop_attr(nfsd, getret, &at, &info);
error = 0;
tl = nfsm_build(&info.nmi_mb, 2 * NFSX_UNSIGNED);
*tl++ = nfs_false;
*tl = nfs_true;
- free(rbuf, M_TEMP);
+ free(rbuf, M_TEMP, 0);
error = 0;
goto nfsmout;
}
*tl = nfs_true;
else
*tl = nfs_false;
- free(rbuf, M_TEMP);
+ free(rbuf, M_TEMP, 0);
nfsmout:
return(error);
}
error = getret;
if (error) {
vrele(vp);
- free((caddr_t)rbuf, M_TEMP);
+ free((caddr_t)rbuf, M_TEMP, 0);
nfsm_reply(NFSX_V3POSTOPATTR);
nfsm_srvpostop_attr(nfsd, getret, &at, &info);
error = 0;
tl += 2;
*tl++ = nfs_false;
*tl = nfs_true;
- free(rbuf, M_TEMP);
+ free(rbuf, M_TEMP, 0);
error = 0;
goto nfsmout;
}
*tl = nfs_true;
else
*tl = nfs_false;
- free(rbuf, M_TEMP);
+ free(rbuf, M_TEMP, 0);
nfsmout:
return(error);
}
-/* $OpenBSD: nfs_srvcache.c,v 1.23 2009/06/04 18:36:43 thib Exp $ */
+/* $OpenBSD: nfs_srvcache.c,v 1.24 2014/07/12 18:43:52 tedu Exp $ */
/* $NetBSD: nfs_srvcache.c,v 1.12 1996/02/18 11:53:49 fvdl Exp $ */
/*
LIST_REMOVE(rp, rc_hash);
TAILQ_REMOVE(&nfsrvlruhead, rp, rc_lru);
nfsrv_cleanentry(rp);
- free(rp, M_NFSD);
+ free(rp, M_NFSD, 0);
}
numnfsrvcache = 0;
}
-/* $OpenBSD: nfs_syscalls.c,v 1.96 2013/11/03 13:50:24 miod Exp $ */
+/* $OpenBSD: nfs_syscalls.c,v 1.97 2014/07/12 18:43:52 tedu Exp $ */
/* $NetBSD: nfs_syscalls.c,v 1.19 1996/02/18 11:53:52 fvdl Exp $ */
/*
done:
TAILQ_REMOVE(&nfsd_head, nfsd, nfsd_chain);
splx(s);
- free((caddr_t)nfsd, M_NFSD);
+ free((caddr_t)nfsd, M_NFSD, 0);
if (--nfs_numnfsd == 0)
nfsrv_init(1); /* Reinitialize everything */
return (error);
{
if (--(slp->ns_sref) == 0 && (slp->ns_flag & SLP_VALID) == 0) {
TAILQ_REMOVE(&nfssvc_sockhead, slp, ns_chain);
- free((caddr_t)slp, M_NFSSVC);
+ free((caddr_t)slp, M_NFSSVC, 0);
}
}
if (slp->ns_flag & SLP_VALID)
nfsrv_zapsock(slp);
TAILQ_REMOVE(&nfssvc_sockhead, slp, ns_chain);
- free((caddr_t)slp, M_NFSSVC);
+ free((caddr_t)slp, M_NFSSVC, 0);
}
nfsrv_cleancache(); /* And clear out server cache */
}
-/* $OpenBSD: nfs_vfsops.c,v 1.99 2013/12/01 16:40:56 krw Exp $ */
+/* $OpenBSD: nfs_vfsops.c,v 1.100 2014/07/12 18:43:52 tedu Exp $ */
/* $NetBSD: nfs_vfsops.c,v 1.46.4.1 1996/05/25 22:40:35 fvdl Exp $ */
/*
return (0);
bad:
nfs_disconnect(nmp);
- free((caddr_t)nmp, M_NFSMNT);
+ free((caddr_t)nmp, M_NFSMNT, 0);
m_freem(nam);
return (error);
}
nfs_disconnect(nmp);
m_freem(nmp->nm_nam);
timeout_del(&nmp->nm_rtimeout);
- free(nmp, M_NFSMNT);
+ free(nmp, M_NFSMNT, 0);
return (0);
}
-/* $OpenBSD: nfs_vnops.c,v 1.151 2014/07/08 17:19:26 deraadt Exp $ */
+/* $OpenBSD: nfs_vnops.c,v 1.152 2014/07/12 18:43:52 tedu Exp $ */
/* $NetBSD: nfs_vnops.c,v 1.62.4.1 1996/07/08 20:26:52 jtc Exp $ */
/*
}
} while (!error && !done && !eof && cnt--);
- free(data, M_TEMP);
+ free(data, M_TEMP, 0);
data = NULL;
uio->uio_offset = newoff;
bad:
vrele(sp->s_dvp);
crfree(sp->s_cred);
- free(sp, M_NFSREQ);
+ free(sp, M_NFSREQ, 0);
return (error);
}
-/* $OpenBSD: ntfs_ihash.c,v 1.14 2014/01/19 18:35:45 tedu Exp $ */
+/* $OpenBSD: ntfs_ihash.c,v 1.15 2014/07/12 18:43:52 tedu Exp $ */
/* $NetBSD: ntfs_ihash.c,v 1.1 2002/12/23 17:38:32 jdolecek Exp $ */
/*
nthashtbl = hashinit(desiredvnodes, M_NTFSNTHASH, M_WAITOK, &nthash);
if (ntfs_nthashtbl) {
- free(nthashtbl, M_NTFSNTHASH);
+ free(nthashtbl, M_NTFSNTHASH, 0);
return;
}
ntfs_nthashtbl = nthashtbl;
-/* $OpenBSD: ntfs_subr.c,v 1.37 2014/01/19 18:35:45 tedu Exp $ */
+/* $OpenBSD: ntfs_subr.c,v 1.38 2014/07/12 18:43:52 tedu Exp $ */
/* $NetBSD: ntfs_subr.c,v 1.4 2003/04/10 21:37:32 jdolecek Exp $ */
/*-
"name: %.*s, vcn: %llu\n", ip->i_number, type,
(unsigned int)namelen, name, vcn);
out:
- free(alpool, M_TEMP);
+ free(alpool, M_TEMP, 0);
return (error);
}
ntmp->ntm_ntnodes++;
out:
- free(mfrp, M_TEMP);
+ free(mfrp, M_TEMP, 0);
return (error);
}
}
vrele(ip->i_devvp);
- free(ip, M_NTFSNTNODE);
+ free(ip, M_NTFSNTNODE, 0);
}
/*
{
if (vap->va_flag & NTFS_AF_INRUN) {
if (vap->va_vruncn)
- free(vap->va_vruncn, M_NTFSRUN);
+ free(vap->va_vruncn, M_NTFSRUN, 0);
if (vap->va_vruncl)
- free(vap->va_vruncl, M_NTFSRUN);
+ free(vap->va_vruncl, M_NTFSRUN, 0);
} else {
if (vap->va_datap)
- free(vap->va_datap, M_NTFSRDATA);
+ free(vap->va_datap, M_NTFSRDATA, 0);
}
- free(vap, M_NTFSNTVATTR);
+ free(vap, M_NTFSNTVATTR, 0);
}
/*
DDPRINTF(", len: %llu", vap->va_datalen);
if (error)
- free(vap, M_NTFSNTVATTR);
+ free(vap, M_NTFSNTVATTR, 0);
else
*rvapp = vap;
DPRINTF("ntfs_frele: deallocating fnode\n");
LIST_REMOVE(fp,f_fnlist);
if (fp->f_flag & FN_AATTRNAME)
- free(fp->f_attrname, M_TEMP);
+ free(fp->f_attrname, M_TEMP, 0);
if (fp->f_dirblbuf)
- free(fp->f_dirblbuf, M_NTFSDIR);
- free(fp, M_NTFSFNODE);
+ free(fp->f_dirblbuf, M_NTFSDIR, 0);
+ free(fp, M_NTFSFNODE, 0);
ntfs_ntrele(ip);
}
/* free the buffer returned by ntfs_ntlookupattr() */
if (attrname) {
- free(attrname, M_TEMP);
+ free(attrname, M_TEMP, 0);
attrname = NULL;
}
tctx = lookup_ctx;
lookup_ctx = lookup_ctx->prev;
- free(tctx, M_TEMP);
+ free(tctx, M_TEMP, 0);
} else {
DPRINTF("ntfs_ntlookupfile: nowhere to dive :-(\n");
error = ENOENT;
if (vap)
ntfs_ntvattrrele(vap);
if (rdbuf)
- free(rdbuf, M_TEMP);
+ free(rdbuf, M_TEMP, 0);
if (attrname)
- free(attrname, M_TEMP);
+ free(attrname, M_TEMP, 0);
if (lookup_ctx) {
while(lookup_ctx) {
tctx = lookup_ctx;
lookup_ctx = lookup_ctx->prev;
- free(tctx, M_TEMP);
+ free(tctx, M_TEMP, 0);
}
}
ntfs_ntput(ip, p);
if (iavap)
ntfs_ntvattrrele(iavap);
if (bmp)
- free(bmp, M_TEMP);
+ free(bmp, M_TEMP, 0);
ntfs_ntput(ip, p);
return (error);
cn += NTFS_COMPUNIT_CL;
}
- free(uup, M_NTFSDECOMP);
- free(cup, M_NTFSDECOMP);
+ free(uup, M_NTFSDECOMP, 0);
+ free(cup, M_NTFSDECOMP, 0);
} else
error = ntfs_readattr_plain(ntmp, ip, attrnum, attrname,
roff, rsize, rdata, &init, uio);
ntfs_toupper_usecount--;
if (ntfs_toupper_usecount == 0) {
- free(ntfs_toupper_tab, M_NTFSRDATA);
+ free(ntfs_toupper_tab, M_NTFSRDATA, 0);
ntfs_toupper_tab = NULL;
}
#ifdef DIAGNOSTIC
-/* $OpenBSD: ntfs_vfsops.c,v 1.39 2014/07/08 17:19:26 deraadt Exp $ */
+/* $OpenBSD: ntfs_vfsops.c,v 1.40 2014/07/12 18:43:52 tedu Exp $ */
/* $NetBSD: ntfs_vfsops.c,v 1.7 2003/04/24 07:50:19 christos Exp $ */
/*-
if (ntmp != NULL) {
if (ntmp->ntm_ad != NULL)
- free(ntmp->ntm_ad, M_NTFSMNT);
- free(ntmp, M_NTFSMNT);
+ free(ntmp->ntm_ad, M_NTFSMNT, 0);
+ free(ntmp, M_NTFSMNT, 0);
mp->mnt_data = NULL;
}
DPRINTF("ntfs_unmount: freeing memory...\n");
mp->mnt_data = NULL;
mp->mnt_flag &= ~MNT_LOCAL;
- free(ntmp->ntm_ad, M_NTFSMNT);
- free(ntmp, M_NTFSMNT);
+ free(ntmp->ntm_ad, M_NTFSMNT, 0);
+ free(ntmp, M_NTFSMNT, 0);
return (error);
}
*cfreep = cfree;
out:
- free(tmp, M_TEMP);
+ free(tmp, M_TEMP, 0);
return(error);
}
-/* $OpenBSD: ntfs_vnops.c,v 1.35 2013/12/14 02:57:25 guenther Exp $ */
+/* $OpenBSD: ntfs_vnops.c,v 1.36 2014/07/12 18:43:52 tedu Exp $ */
/* $NetBSD: ntfs_vnops.c,v 1.6 2003/04/10 21:57:26 jdolecek Exp $ */
/*
*/
out:
if (fp->f_dirblbuf != NULL) {
- free(fp->f_dirblbuf, M_NTFSDIR);
+ free(fp->f_dirblbuf, M_NTFSDIR, 0);
fp->f_dirblbuf = NULL;
}
return (error);