From: tedu Date: Sat, 12 Jul 2014 18:43:52 +0000 (+0000) Subject: add a size argument to free. will be used soon, but for now default to 0. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=825c4e6a0f6be10484b7f5057f9576c7da691a31;p=openbsd add a size argument to free. will be used soon, but for now default to 0. after discussions with beck deraadt kettenis. --- diff --git a/sys/miscfs/fifofs/fifo_vnops.c b/sys/miscfs/fifofs/fifo_vnops.c index c6995b89379..d083f71d0bf 100644 --- a/sys/miscfs/fifofs/fifo_vnops.c +++ b/sys/miscfs/fifofs/fifo_vnops.c @@ -1,4 +1,4 @@ -/* $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 $ */ /* @@ -128,14 +128,14 @@ fifo_open(void *v) 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); } @@ -143,7 +143,7 @@ fifo_open(void *v) 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); } @@ -351,7 +351,7 @@ fifo_close(void *v) 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); @@ -369,7 +369,7 @@ fifo_reclaim(void *v) soclose(fip->fi_readsock); soclose(fip->fi_writesock); - free(fip, M_VNODE); + free(fip, M_VNODE, 0); vp->v_fifoinfo = NULL; return (0); diff --git a/sys/miscfs/fuse/fuse_device.c b/sys/miscfs/fuse/fuse_device.c index 5df831229d0..567985f6777 100644 --- a/sys/miscfs/fuse/fuse_device.c +++ b/sys/miscfs/fuse/fuse_device.c @@ -1,4 +1,4 @@ -/* $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 * @@ -148,7 +148,7 @@ fuse_destroy(dev_t dev, struct fuse_d *fd) { LIST_REMOVE(fd, fd_list); fuse_device_cleanup(dev, NULL); - free(fd, M_DEVBUF); + free(fd, M_DEVBUF, 0); } /* @@ -339,7 +339,7 @@ fuseioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) #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++; @@ -374,7 +374,7 @@ fuseioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) 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); } diff --git a/sys/miscfs/fuse/fuse_vfsops.c b/sys/miscfs/fuse/fuse_vfsops.c index f35296f69b3..0ecb4002da2 100644 --- a/sys/miscfs/fuse/fuse_vfsops.c +++ b/sys/miscfs/fuse/fuse_vfsops.c @@ -1,4 +1,4 @@ -/* $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 * @@ -163,7 +163,7 @@ fusefs_unmount(struct mount *mp, int mntflags, struct proc *p) fuse_device_cleanup(fmp->dev, NULL); fuse_device_set_fmp(fmp, 0); - free(fmp, M_FUSEFS); + free(fmp, M_FUSEFS, 0); return (error); } diff --git a/sys/miscfs/fuse/fuse_vnops.c b/sys/miscfs/fuse/fuse_vnops.c index 1b6612fe3bf..6d6c20d5c5e 100644 --- a/sys/miscfs/fuse/fuse_vnops.c +++ b/sys/miscfs/fuse/fuse_vnops.c @@ -1,4 +1,4 @@ -/* $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 * @@ -825,7 +825,7 @@ fusefs_reclaim(void *v) ufs_ihashrem(&ip->ufs_ino); cache_purge(vp); - free(ip, M_FUSEFS); + free(ip, M_FUSEFS, 0); vp->v_data = NULL; return (0); } diff --git a/sys/miscfs/fuse/fusebuf.c b/sys/miscfs/fuse/fusebuf.c index 790d9b4862f..8d00f26f7d9 100644 --- a/sys/miscfs/fuse/fusebuf.c +++ b/sys/miscfs/fuse/fusebuf.c @@ -1,4 +1,4 @@ -/* $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 * @@ -70,7 +70,7 @@ void 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); } } diff --git a/sys/miscfs/procfs/procfs_cmdline.c b/sys/miscfs/procfs/procfs_cmdline.c index 3fc4d784bc0..ccfed62ebc3 100644 --- a/sys/miscfs/procfs/procfs_cmdline.c +++ b/sys/miscfs/procfs/procfs_cmdline.c @@ -1,4 +1,4 @@ -/* $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 $ */ /* @@ -85,7 +85,7 @@ procfs_docmdline(struct proc *curp, struct proc *p, struct pfsnode *pfs, struct else error = uiomove(arg, len - uio->uio_offset, uio); - free(arg, M_TEMP); + free(arg, M_TEMP, 0); return (error); } @@ -100,7 +100,7 @@ procfs_docmdline(struct proc *curp, struct proc *p, struct pfsnode *pfs, struct */ /* 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; @@ -181,6 +181,6 @@ procfs_docmdline(struct proc *curp, struct proc *p, struct pfsnode *pfs, struct bad: uvmspace_free(vm); - free(arg, M_TEMP); + free(arg, M_TEMP, 0); return (error); } diff --git a/sys/miscfs/procfs/procfs_status.c b/sys/miscfs/procfs/procfs_status.c index a077558f7fe..3596141ee8d 100644 --- a/sys/miscfs/procfs/procfs_status.c +++ b/sys/miscfs/procfs/procfs_status.c @@ -1,4 +1,4 @@ -/* $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 $ */ /* @@ -167,6 +167,6 @@ procfs_dostatus(struct proc *curp, struct proc *p, struct pfsnode *pfs, struct u error = uiomove(ps + uio->uio_offset, len, uio); } - free(ps, M_TEMP); + free(ps, M_TEMP, 0); return (error); } diff --git a/sys/miscfs/procfs/procfs_subr.c b/sys/miscfs/procfs/procfs_subr.c index d69e534bbb8..b6b616cf144 100644 --- a/sys/miscfs/procfs/procfs_subr.c +++ b/sys/miscfs/procfs/procfs_subr.c @@ -1,4 +1,4 @@ -/* $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 $ */ /* @@ -184,7 +184,7 @@ procfs_freevp(struct vnode *vp) 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); } diff --git a/sys/miscfs/procfs/procfs_vfsops.c b/sys/miscfs/procfs/procfs_vfsops.c index ec082c66a21..adeb9b1edeb 100644 --- a/sys/miscfs/procfs/procfs_vfsops.c +++ b/sys/miscfs/procfs/procfs_vfsops.c @@ -1,4 +1,4 @@ -/* $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 $ */ /* @@ -134,7 +134,7 @@ procfs_unmount(struct mount *mp, int mntflags, struct proc *p) 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); diff --git a/sys/nfs/nfs_aiod.c b/sys/nfs/nfs_aiod.c index ada3669560e..0f002b666e9 100644 --- a/sys/nfs/nfs_aiod.c +++ b/sys/nfs/nfs_aiod.c @@ -1,4 +1,4 @@ -/* $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. @@ -147,7 +147,7 @@ loop: /* Loop around until SIGKILL */ 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. */ diff --git a/sys/nfs/nfs_kq.c b/sys/nfs/nfs_kq.c index e42dae30f25..aac0be74626 100644 --- a/sys/nfs/nfs_kq.c +++ b/sys/nfs/nfs_kq.c @@ -1,4 +1,4 @@ -/* $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 $ */ /*- @@ -203,7 +203,7 @@ filt_nfsdetach(struct knote *kn) } else { /* last user, g/c */ SLIST_REMOVE(&kevlist, ke, kevq, kev_link); - free(ke, M_KEVENT); + free(ke, M_KEVENT, 0); } break; } diff --git a/sys/nfs/nfs_node.c b/sys/nfs/nfs_node.c index 9c7efe60679..7f86e51fac8 100644 --- a/sys/nfs/nfs_node.c +++ b/sys/nfs/nfs_node.c @@ -1,4 +1,4 @@ -/* $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 $ */ /* @@ -199,7 +199,7 @@ nfs_inactive(void *v) 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); diff --git a/sys/nfs/nfs_serv.c b/sys/nfs/nfs_serv.c index 84b8201d03e..3704086d4ee 100644 --- a/sys/nfs/nfs_serv.c +++ b/sys/nfs/nfs_serv.c @@ -1,4 +1,4 @@ -/* $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 $ */ /* @@ -633,7 +633,7 @@ nfsrv_read(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, 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; @@ -798,7 +798,7 @@ nfsrv_write(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, 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); @@ -1727,7 +1727,7 @@ nfsrv_symlink(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, } out: if (pathcp) - free(pathcp, M_TEMP); + free(pathcp, M_TEMP, 0); if (dirp) { diraft_ret = VOP_GETATTR(dirp, &diraft, cred, procp); vrele(dirp); @@ -1758,7 +1758,7 @@ nfsmout: if (nd.ni_vp) vrele(nd.ni_vp); if (pathcp) - free(pathcp, M_TEMP); + free(pathcp, M_TEMP, 0); return (error); } @@ -2102,7 +2102,7 @@ again: 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; @@ -2128,7 +2128,7 @@ again: 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; } @@ -2206,7 +2206,7 @@ again: *tl = nfs_true; else *tl = nfs_false; - free(rbuf, M_TEMP); + free(rbuf, M_TEMP, 0); nfsmout: return(error); } @@ -2301,7 +2301,7 @@ again: 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; @@ -2324,7 +2324,7 @@ again: tl += 2; *tl++ = nfs_false; *tl = nfs_true; - free(rbuf, M_TEMP); + free(rbuf, M_TEMP, 0); error = 0; goto nfsmout; } @@ -2448,7 +2448,7 @@ invalid: *tl = nfs_true; else *tl = nfs_false; - free(rbuf, M_TEMP); + free(rbuf, M_TEMP, 0); nfsmout: return(error); } diff --git a/sys/nfs/nfs_srvcache.c b/sys/nfs/nfs_srvcache.c index c8d336b2479..ebda87e6479 100644 --- a/sys/nfs/nfs_srvcache.c +++ b/sys/nfs/nfs_srvcache.c @@ -1,4 +1,4 @@ -/* $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 $ */ /* @@ -262,7 +262,7 @@ nfsrv_cleancache(void) 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; } diff --git a/sys/nfs/nfs_syscalls.c b/sys/nfs/nfs_syscalls.c index af87e03e058..84c3216f535 100644 --- a/sys/nfs/nfs_syscalls.c +++ b/sys/nfs/nfs_syscalls.c @@ -1,4 +1,4 @@ -/* $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 $ */ /* @@ -456,7 +456,7 @@ loop: 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); @@ -506,7 +506,7 @@ nfsrv_slpderef(struct nfssvc_sock *slp) { 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); } } @@ -530,7 +530,7 @@ nfsrv_init(int terminating) 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 */ } diff --git a/sys/nfs/nfs_vfsops.c b/sys/nfs/nfs_vfsops.c index a9d441a552f..f955f17a60c 100644 --- a/sys/nfs/nfs_vfsops.c +++ b/sys/nfs/nfs_vfsops.c @@ -1,4 +1,4 @@ -/* $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 $ */ /* @@ -678,7 +678,7 @@ mountnfs(struct nfs_args *argp, struct mount *mp, struct mbuf *nam, return (0); bad: nfs_disconnect(nmp); - free((caddr_t)nmp, M_NFSMNT); + free((caddr_t)nmp, M_NFSMNT, 0); m_freem(nam); return (error); } @@ -703,7 +703,7 @@ nfs_unmount(struct mount *mp, int mntflags, struct proc *p) nfs_disconnect(nmp); m_freem(nmp->nm_nam); timeout_del(&nmp->nm_rtimeout); - free(nmp, M_NFSMNT); + free(nmp, M_NFSMNT, 0); return (0); } diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c index fc708ae0f2c..35593451ccf 100644 --- a/sys/nfs/nfs_vnops.c +++ b/sys/nfs/nfs_vnops.c @@ -1,4 +1,4 @@ -/* $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 $ */ /* @@ -2040,7 +2040,7 @@ nfs_readdir(void *v) } } while (!error && !done && !eof && cnt--); - free(data, M_TEMP); + free(data, M_TEMP, 0); data = NULL; uio->uio_offset = newoff; @@ -2538,7 +2538,7 @@ nfs_sillyrename(struct vnode *dvp, struct vnode *vp, struct componentname *cnp) bad: vrele(sp->s_dvp); crfree(sp->s_cred); - free(sp, M_NFSREQ); + free(sp, M_NFSREQ, 0); return (error); } diff --git a/sys/ntfs/ntfs_ihash.c b/sys/ntfs/ntfs_ihash.c index ecf3064087a..3c53d6a6501 100644 --- a/sys/ntfs/ntfs_ihash.c +++ b/sys/ntfs/ntfs_ihash.c @@ -1,4 +1,4 @@ -/* $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 $ */ /* @@ -68,7 +68,7 @@ ntfs_nthashinit(void) nthashtbl = hashinit(desiredvnodes, M_NTFSNTHASH, M_WAITOK, &nthash); if (ntfs_nthashtbl) { - free(nthashtbl, M_NTFSNTHASH); + free(nthashtbl, M_NTFSNTHASH, 0); return; } ntfs_nthashtbl = nthashtbl; diff --git a/sys/ntfs/ntfs_subr.c b/sys/ntfs/ntfs_subr.c index 31bb58534cb..963ed7f4735 100644 --- a/sys/ntfs/ntfs_subr.c +++ b/sys/ntfs/ntfs_subr.c @@ -1,4 +1,4 @@ -/* $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 $ */ /*- @@ -241,7 +241,7 @@ ntfs_ntvattrget(struct ntfsmount *ntmp, struct ntnode *ip, u_int32_t type, "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); } @@ -354,7 +354,7 @@ ntfs_loadntnode(struct ntfsmount *ntmp, struct ntnode *ip) ntmp->ntm_ntnodes++; out: - free(mfrp, M_TEMP); + free(mfrp, M_TEMP, 0); return (error); } @@ -476,7 +476,7 @@ ntfs_ntput(struct ntnode *ip, struct proc *p) } vrele(ip->i_devvp); - free(ip, M_NTFSNTNODE); + free(ip, M_NTFSNTNODE, 0); } /* @@ -515,14 +515,14 @@ ntfs_freentvattr(struct ntvattr *vap) { 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); } /* @@ -582,7 +582,7 @@ ntfs_attrtontvattr(struct ntfsmount *ntmp, struct ntvattr **rvapp, DDPRINTF(", len: %llu", vap->va_datalen); if (error) - free(vap, M_NTFSNTVATTR); + free(vap, M_NTFSNTVATTR, 0); else *rvapp = vap; @@ -762,10 +762,10 @@ ntfs_frele(struct fnode *fp) 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); } @@ -955,7 +955,7 @@ ntfs_ntlookupfile(struct ntfsmount *ntmp, struct vnode *vp, /* free the buffer returned by ntfs_ntlookupattr() */ if (attrname) { - free(attrname, M_TEMP); + free(attrname, M_TEMP, 0); attrname = NULL; } @@ -1048,7 +1048,7 @@ ntfs_ntlookupfile(struct ntfsmount *ntmp, struct vnode *vp, 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; @@ -1072,14 +1072,14 @@ fail: 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); @@ -1272,7 +1272,7 @@ fail: if (iavap) ntfs_ntvattrrele(iavap); if (bmp) - free(bmp, M_TEMP); + free(bmp, M_TEMP, 0); ntfs_ntput(ip, p); return (error); @@ -1744,8 +1744,8 @@ ntfs_readattr(struct ntfsmount *ntmp, struct ntnode *ip, u_int32_t attrnum, 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); @@ -1927,7 +1927,7 @@ ntfs_toupper_unuse(struct proc *p) 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 diff --git a/sys/ntfs/ntfs_vfsops.c b/sys/ntfs/ntfs_vfsops.c index e128580677f..11d2da2976c 100644 --- a/sys/ntfs/ntfs_vfsops.c +++ b/sys/ntfs/ntfs_vfsops.c @@ -1,4 +1,4 @@ -/* $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 $ */ /*- @@ -457,8 +457,8 @@ out: 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; } @@ -536,8 +536,8 @@ ntfs_unmount(struct mount *mp, int mntflags, struct proc *p) 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); } @@ -595,7 +595,7 @@ ntfs_calccfree(struct ntfsmount *ntmp, cn_t *cfreep) *cfreep = cfree; out: - free(tmp, M_TEMP); + free(tmp, M_TEMP, 0); return(error); } diff --git a/sys/ntfs/ntfs_vnops.c b/sys/ntfs/ntfs_vnops.c index 2da5a8043ae..b8277cfdb0a 100644 --- a/sys/ntfs/ntfs_vnops.c +++ b/sys/ntfs/ntfs_vnops.c @@ -1,4 +1,4 @@ -/* $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 $ */ /* @@ -576,7 +576,7 @@ ntfs_readdir(void *v) */ 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);