From: tedu Date: Sat, 12 Jul 2014 18:44:01 +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=87310acfb95997ce2dd7b5840ce1fd187a895c40;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/ufs/ext2fs/ext2fs_inode.c b/sys/ufs/ext2fs/ext2fs_inode.c index 5e260310687..4722b30788e 100644 --- a/sys/ufs/ext2fs/ext2fs_inode.c +++ b/sys/ufs/ext2fs/ext2fs_inode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2fs_inode.c,v 1.51 2014/07/11 14:30:52 pelikan Exp $ */ +/* $OpenBSD: ext2fs_inode.c,v 1.52 2014/07/12 18:44:01 tedu Exp $ */ /* $NetBSD: ext2fs_inode.c,v 1.24 2001/06/19 12:59:18 wiz Exp $ */ /* @@ -519,7 +519,7 @@ ext2fs_indirtrunc(struct inode *ip, int32_t lbn, int32_t dbn, int32_t lastbn, in } if (copy != NULL) { - free(copy, M_TEMP); + free(copy, M_TEMP, 0); } else { bp->b_flags |= B_INVAL; brelse(bp); diff --git a/sys/ufs/ext2fs/ext2fs_lookup.c b/sys/ufs/ext2fs/ext2fs_lookup.c index 1c478a48854..af3f89059f8 100644 --- a/sys/ufs/ext2fs/ext2fs_lookup.c +++ b/sys/ufs/ext2fs/ext2fs_lookup.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2fs_lookup.c,v 1.34 2014/07/12 10:55:33 pelikan Exp $ */ +/* $OpenBSD: ext2fs_lookup.c,v 1.35 2014/07/12 18:44:01 tedu Exp $ */ /* $NetBSD: ext2fs_lookup.c,v 1.16 2000/08/03 20:29:26 thorpej Exp $ */ /* @@ -188,7 +188,7 @@ ext2fs_readdir(void *v) /* we need to correct uio_offset */ uio->uio_offset = off; } - free(dirbuf, M_TEMP); + free(dirbuf, M_TEMP, 0); *ap->a_eofflag = ext2fs_size(VTOI(ap->a_vp)) <= uio->uio_offset; return (error); } diff --git a/sys/ufs/ext2fs/ext2fs_vfsops.c b/sys/ufs/ext2fs/ext2fs_vfsops.c index 5fc43e38516..7bfe1f3c9d4 100644 --- a/sys/ufs/ext2fs/ext2fs_vfsops.c +++ b/sys/ufs/ext2fs/ext2fs_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2fs_vfsops.c,v 1.78 2014/07/12 13:23:59 pelikan Exp $ */ +/* $OpenBSD: ext2fs_vfsops.c,v 1.79 2014/07/12 18:44:01 tedu Exp $ */ /* $NetBSD: ext2fs_vfsops.c,v 1.1 1997/06/11 09:34:07 bouyer Exp $ */ /* @@ -132,7 +132,7 @@ ext2fs_mountroot(void) if ((error = ext2fs_mountfs(rootvp, mp, p)) != 0) { mp->mnt_vfc->vfc_refcount--; vfs_unbusy(mp); - free(mp, M_MOUNT); + free(mp, M_MOUNT, 0); vrele(rootvp); return (error); } @@ -416,7 +416,7 @@ e2fs_sbfill(struct vnode *devvp, struct m_ext2fs *fs, struct ext2fs *sb) error = bread(devvp, fsbtodb(fs, dblk), fs->e2fs_bsize, &bp); if (error) { - free(fs->e2fs_gd, M_UFSMNT); + free(fs->e2fs_gd, M_UFSMNT, 0); fs->e2fs_gd = NULL; brelse(bp); return (error); @@ -598,8 +598,8 @@ out: (void)VOP_CLOSE(devvp, ronly ? FREAD : FREAD|FWRITE, cred, p); VOP_UNLOCK(devvp, 0, p); if (ump) { - free(ump->um_e2fs, M_UFSMNT); - free(ump, M_UFSMNT); + free(ump->um_e2fs, M_UFSMNT, 0); + free(ump, M_UFSMNT, 0); mp->mnt_data = (qaddr_t)0; } return (error); @@ -635,9 +635,9 @@ ext2fs_unmount(struct mount *mp, int mntflags, struct proc *p) error = VOP_CLOSE(ump->um_devvp, fs->e2fs_ronly ? FREAD : FREAD|FWRITE, NOCRED, p); vput(ump->um_devvp); - free(fs->e2fs_gd, M_UFSMNT); - free(fs, M_UFSMNT); - free(ump, M_UFSMNT); + free(fs->e2fs_gd, M_UFSMNT, 0); + free(fs, M_UFSMNT, 0); + free(ump, M_UFSMNT, 0); mp->mnt_data = (qaddr_t)0; mp->mnt_flag &= ~MNT_LOCAL; return (error); diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c index cc34620e32b..28c8212971c 100644 --- a/sys/ufs/ffs/ffs_inode.c +++ b/sys/ufs/ffs/ffs_inode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs_inode.c,v 1.70 2014/07/08 17:19:26 deraadt Exp $ */ +/* $OpenBSD: ffs_inode.c,v 1.71 2014/07/12 18:44:01 tedu Exp $ */ /* $NetBSD: ffs_inode.c,v 1.10 1996/05/11 18:27:19 mycroft Exp $ */ /* @@ -561,7 +561,7 @@ ffs_indirtrunc(struct inode *ip, daddr_t lbn, daddr_t dbn, } } if (copy != NULL) { - free(copy, M_TEMP); + free(copy, M_TEMP, 0); } else { bp->b_flags |= B_INVAL; brelse(bp); diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index d29df5de4f7..3caf5b6ea5c 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs_softdep.c,v 1.127 2014/05/22 02:02:39 guenther Exp $ */ +/* $OpenBSD: ffs_softdep.c,v 1.128 2014/07/12 18:44:01 tedu Exp $ */ /* * Copyright 1998, 2000 Marshall Kirk McKusick. All Rights Reserved. @@ -2288,7 +2288,7 @@ check_inode_unwritten(struct inodedep *inodedep) if (inodedep->id_state & ONWORKLIST) WORKLIST_REMOVE(&inodedep->id_list); if (inodedep->id_savedino1 != NULL) { - free(inodedep->id_savedino1, M_INODEDEP); + free(inodedep->id_savedino1, M_INODEDEP, 0); inodedep->id_savedino1 = NULL; } if (free_inodedep(inodedep) == 0) { @@ -3826,7 +3826,7 @@ softdep_disk_write_complete(struct buf *bp) if (indirdep->ir_state & GOINGAWAY) panic("disk_write_complete: indirdep gone"); memcpy(bp->b_data, indirdep->ir_saveddata, bp->b_bcount); - free(indirdep->ir_saveddata, M_INDIRDEP); + free(indirdep->ir_saveddata, M_INDIRDEP, 0); indirdep->ir_saveddata = NULL; indirdep->ir_state &= ~UNDONE; indirdep->ir_state |= ATTACHED; @@ -4015,7 +4015,7 @@ handle_written_inodeblock(struct inodedep *inodedep, struct buf *bp) *dp1 = *inodedep->id_savedino1; else *dp2 = *inodedep->id_savedino2; - free(inodedep->id_savedino1, M_INODEDEP); + free(inodedep->id_savedino1, M_INODEDEP, 0); inodedep->id_savedino1 = NULL; if ((bp->b_flags & B_DELWRI) == 0) stat_inode_bitmap++; diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index ba4e887615d..40be455808e 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs_vfsops.c,v 1.140 2013/12/12 19:00:10 tedu Exp $ */ +/* $OpenBSD: ffs_vfsops.c,v 1.141 2014/07/12 18:44:01 tedu Exp $ */ /* $NetBSD: ffs_vfsops.c,v 1.19 1996/02/09 22:22:26 christos Exp $ */ /* @@ -139,7 +139,7 @@ ffs_mountroot(void) if ((error = ffs_mountfs(rootvp, mp, p)) != 0) { mp->mnt_vfc->vfc_refcount--; vfs_unbusy(mp); - free(mp, M_MOUNT); + free(mp, M_MOUNT, 0); vrele(swapdev_vp); vrele(rootvp); return (error); @@ -436,7 +436,7 @@ success: fs->fs_clean = ronly && (fs->fs_flags & FS_UNCLEAN) == 0 ? 1 : 0; if (ronly) - free(fs->fs_contigdirs, M_UFSMNT); + free(fs->fs_contigdirs, M_UFSMNT, 0); } if (!ronly) { if (mp->mnt_flag & MNT_SOFTDEP) @@ -809,7 +809,7 @@ ffs_mountfs(struct vnode *devvp, struct mount *mp, struct proc *p) size = (blks - i) * fs->fs_fsize; error = bread(devvp, fsbtodb(fs, fs->fs_csaddr + i), size, &bp); if (error) { - free(fs->fs_csp, M_UFSMNT); + free(fs->fs_csp, M_UFSMNT, 0); goto out; } memcpy(space, bp->b_data, size); @@ -882,8 +882,8 @@ ffs_mountfs(struct vnode *devvp, struct mount *mp, struct proc *p) if (ronly == 0) { if ((fs->fs_flags & FS_DOSOFTDEP) && (error = softdep_mount(devvp, mp, fs, cred)) != 0) { - free(fs->fs_csp, M_UFSMNT); - free(fs->fs_contigdirs, M_UFSMNT); + free(fs->fs_csp, M_UFSMNT, 0); + free(fs->fs_contigdirs, M_UFSMNT, 0); goto out; } fs->fs_fmod = 1; @@ -907,8 +907,8 @@ out: VOP_UNLOCK(devvp, 0, p); if (ump) { - free(ump->um_fs, M_UFSMNT); - free(ump, M_UFSMNT); + free(ump->um_fs, M_UFSMNT, 0); + free(ump, M_UFSMNT, 0); mp->mnt_data = (qaddr_t)0; } return (error); @@ -1017,7 +1017,7 @@ ffs_unmount(struct mount *mp, int mntflags, struct proc *p) fs->fs_clean = 0; return (error); } - free(fs->fs_contigdirs, M_UFSMNT); + free(fs->fs_contigdirs, M_UFSMNT, 0); } ump->um_devvp->v_specmountpoint = NULL; @@ -1026,9 +1026,9 @@ ffs_unmount(struct mount *mp, int mntflags, struct proc *p) error = VOP_CLOSE(ump->um_devvp, fs->fs_ronly ? FREAD : FREAD|FWRITE, NOCRED, p); vput(ump->um_devvp); - free(fs->fs_csp, M_UFSMNT); - free(fs, M_UFSMNT); - free(ump, M_UFSMNT); + free(fs->fs_csp, M_UFSMNT, 0); + free(fs, M_UFSMNT, 0); + free(ump, M_UFSMNT, 0); mp->mnt_data = (qaddr_t)0; mp->mnt_flag &= ~MNT_LOCAL; return (error); diff --git a/sys/ufs/mfs/mfs_vnops.c b/sys/ufs/mfs/mfs_vnops.c index b66a95f29d6..c4a3b07c2b1 100644 --- a/sys/ufs/mfs/mfs_vnops.c +++ b/sys/ufs/mfs/mfs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mfs_vnops.c,v 1.44 2013/01/15 11:20:55 jsing Exp $ */ +/* $OpenBSD: mfs_vnops.c,v 1.45 2014/07/12 18:44:01 tedu Exp $ */ /* $NetBSD: mfs_vnops.c,v 1.8 1996/03/17 02:16:32 christos Exp $ */ /* @@ -250,7 +250,7 @@ mfs_reclaim(void *v) struct vop_reclaim_args *ap = v; struct vnode *vp = ap->a_vp; - free(vp->v_data, M_MFSNODE); + free(vp->v_data, M_MFSNODE, 0); vp->v_data = NULL; return (0); } diff --git a/sys/ufs/ufs/ufs_dirhash.c b/sys/ufs/ufs/ufs_dirhash.c index 77f6e94dc59..62d2c49455b 100644 --- a/sys/ufs/ufs/ufs_dirhash.c +++ b/sys/ufs/ufs/ufs_dirhash.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ufs_dirhash.c,v 1.25 2013/12/12 19:15:32 tedu Exp $ */ +/* $OpenBSD: ufs_dirhash.c,v 1.26 2014/07/12 18:44:01 tedu Exp $ */ /* * Copyright (c) 2001, 2002 Ian Dowse. All rights reserved. * @@ -246,11 +246,11 @@ fail: for (i = 0; i < narrays; i++) if (dh->dh_hash[i] != NULL) DIRHASH_BLKFREE(dh->dh_hash[i]); - free(dh->dh_hash, M_DIRHASH); + free(dh->dh_hash, M_DIRHASH, 0); } if (dh->dh_blkfree != NULL) - free(dh->dh_blkfree, M_DIRHASH); - free(dh, M_DIRHASH); + free(dh->dh_blkfree, M_DIRHASH, 0); + free(dh, M_DIRHASH, 0); ip->i_dirhash = NULL; DIRHASHLIST_LOCK(); ufs_dirhashmem -= memreqd; @@ -282,13 +282,13 @@ ufsdirhash_free(struct inode *ip) if (dh->dh_hash != NULL) { for (i = 0; i < dh->dh_narrays; i++) DIRHASH_BLKFREE(dh->dh_hash[i]); - free(dh->dh_hash, M_DIRHASH); - free(dh->dh_blkfree, M_DIRHASH); + free(dh->dh_hash, M_DIRHASH, 0); + free(dh->dh_blkfree, M_DIRHASH, 0); mem += dh->dh_narrays * sizeof(*dh->dh_hash) + dh->dh_narrays * DH_NBLKOFF * sizeof(**dh->dh_hash) + dh->dh_nblk * sizeof(*dh->dh_blkfree); } - free(dh, M_DIRHASH); + free(dh, M_DIRHASH, 0); ip->i_dirhash = NULL; DIRHASHLIST_LOCK(); @@ -1042,8 +1042,8 @@ ufsdirhash_recycle(int wanted) DIRHASHLIST_UNLOCK(); for (i = 0; i < narrays; i++) DIRHASH_BLKFREE(hash[i]); - free(hash, M_DIRHASH); - free(blkfree, M_DIRHASH); + free(hash, M_DIRHASH, 0); + free(blkfree, M_DIRHASH, 0); /* Account for the returned memory, and repeat if necessary. */ DIRHASHLIST_LOCK(); diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 40d9ec225de..0afb4baefc8 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ufs_vnops.c,v 1.114 2014/07/08 17:19:26 deraadt Exp $ */ +/* $OpenBSD: ufs_vnops.c,v 1.115 2014/07/12 18:44:01 tedu Exp $ */ /* $NetBSD: ufs_vnops.c,v 1.18 1996/05/11 18:28:04 mycroft Exp $ */ /* @@ -1514,7 +1514,7 @@ ufs_readdir(void *v) if ((char *)dp + offsetof(struct direct, d_name) < edp && dp->d_reclen <= offsetof(struct direct, d_name)) error = EIO; - free(diskbuf, M_TEMP); + free(diskbuf, M_TEMP, 0); uio->uio_offset = off; *ap->a_eofflag = DIP(VTOI(ap->a_vp), size) <= off; diff --git a/sys/uvm/uvm_amap.c b/sys/uvm/uvm_amap.c index df147a42736..77ec30cde1b 100644 --- a/sys/uvm/uvm_amap.c +++ b/sys/uvm/uvm_amap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_amap.c,v 1.52 2014/07/11 16:35:40 jsg Exp $ */ +/* $OpenBSD: uvm_amap.c,v 1.53 2014/07/12 18:44:01 tedu Exp $ */ /* $NetBSD: uvm_amap.c,v 1.27 2000/11/25 06:27:59 chs Exp $ */ /* @@ -238,10 +238,10 @@ amap_free(struct vm_amap *amap) KASSERT(amap->am_ref == 0 && amap->am_nused == 0); KASSERT((amap->am_flags & AMAP_SWAPOFF) == 0); - free(amap->am_slots, M_UVMAMAP); + free(amap->am_slots, M_UVMAMAP, 0); #ifdef UVM_AMAP_PPREF if (amap->am_ppref && amap->am_ppref != PPREF_NONE) - free(amap->am_ppref, M_UVMAMAP); + free(amap->am_ppref, M_UVMAMAP, 0); #endif pool_put(&uvm_amap_pool, amap); @@ -333,7 +333,7 @@ amap_extend(struct vm_map_entry *entry, vsize_t addsize) M_WAITOK | M_CANFAIL); if (newppref == NULL) { /* give up if malloc fails */ - free(amap->am_ppref, M_UVMAMAP); + free(amap->am_ppref, M_UVMAMAP, 0); amap->am_ppref = PPREF_NONE; } } @@ -343,7 +343,7 @@ amap_extend(struct vm_map_entry *entry, vsize_t addsize) if (newsl == NULL) { #ifdef UVM_AMAP_PPREF if (newppref != NULL) { - free(newppref, M_UVMAMAP); + free(newppref, M_UVMAMAP, 0); } #endif return (ENOMEM); @@ -394,10 +394,10 @@ amap_extend(struct vm_map_entry *entry, vsize_t addsize) amap->am_maxslot = slotalloc; /* and free */ - free(oldsl, M_UVMAMAP); + free(oldsl, M_UVMAMAP, 0); #ifdef UVM_AMAP_PPREF if (oldppref && oldppref != PPREF_NONE) - free(oldppref, M_UVMAMAP); + free(oldppref, M_UVMAMAP, 0); #endif return (0); } diff --git a/sys/uvm/uvm_aobj.c b/sys/uvm/uvm_aobj.c index b8fedc79a13..c658c075b91 100644 --- a/sys/uvm/uvm_aobj.c +++ b/sys/uvm/uvm_aobj.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_aobj.c,v 1.66 2014/07/11 16:35:40 jsg Exp $ */ +/* $OpenBSD: uvm_aobj.c,v 1.67 2014/07/12 18:44:01 tedu Exp $ */ /* $NetBSD: uvm_aobj.c,v 1.39 2001/02/18 21:19:08 chs Exp $ */ /* @@ -379,7 +379,7 @@ uao_free(struct uvm_aobj *aobj) pool_put(&uao_swhash_elt_pool, elt); } } - free(aobj->u_swhash, M_UVMAOBJ); + free(aobj->u_swhash, M_UVMAOBJ, 0); } else { int i; @@ -393,7 +393,7 @@ uao_free(struct uvm_aobj *aobj) uvmexp.swpgonly--; } } - free(aobj->u_swslots, M_UVMAOBJ); + free(aobj->u_swslots, M_UVMAOBJ, 0); } /* finally free the aobj itself */ @@ -461,7 +461,7 @@ uao_shrink_hash(struct uvm_object *uobj, int pages) } } - free(aobj->u_swhash, M_UVMAOBJ); + free(aobj->u_swhash, M_UVMAOBJ, 0); aobj->u_swhash = new_swhash; aobj->u_pages = pages; @@ -498,7 +498,7 @@ uao_shrink_convert(struct uvm_object *uobj, int pages) } } - free(aobj->u_swhash, M_UVMAOBJ); + free(aobj->u_swhash, M_UVMAOBJ, 0); aobj->u_swslots = new_swslots; aobj->u_pages = pages; @@ -522,7 +522,7 @@ uao_shrink_array(struct uvm_object *uobj, int pages) for (i = 0; i < pages; i++) new_swslots[i] = aobj->u_swslots[i]; - free(aobj->u_swslots, M_UVMAOBJ); + free(aobj->u_swslots, M_UVMAOBJ, 0); aobj->u_swslots = new_swslots; aobj->u_pages = pages; @@ -575,7 +575,7 @@ uao_grow_array(struct uvm_object *uobj, int pages) for (i = 0; i < aobj->u_pages; i++) new_swslots[i] = aobj->u_swslots[i]; - free(aobj->u_swslots, M_UVMAOBJ); + free(aobj->u_swslots, M_UVMAOBJ, 0); aobj->u_swslots = new_swslots; aobj->u_pages = pages; @@ -618,7 +618,7 @@ uao_grow_hash(struct uvm_object *uobj, int pages) } } - free(aobj->u_swhash, M_UVMAOBJ); + free(aobj->u_swhash, M_UVMAOBJ, 0); aobj->u_swhash = new_swhash; aobj->u_pages = pages; @@ -654,7 +654,7 @@ uao_grow_convert(struct uvm_object *uobj, int pages) } } - free(old_swslots, M_UVMAOBJ); + free(old_swslots, M_UVMAOBJ, 0); aobj->u_pages = pages; return 0; diff --git a/sys/uvm/uvm_device.c b/sys/uvm/uvm_device.c index b605886d313..1fe2e5ef38a 100644 --- a/sys/uvm/uvm_device.c +++ b/sys/uvm/uvm_device.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_device.c,v 1.47 2014/07/11 16:35:40 jsg Exp $ */ +/* $OpenBSD: uvm_device.c,v 1.48 2014/07/12 18:44:01 tedu Exp $ */ /* $NetBSD: uvm_device.c,v 1.30 2000/11/25 06:27:59 chs Exp $ */ /* @@ -187,7 +187,7 @@ udv_attach(dev_t device, vm_prot_t accessprot, voff_t off, vsize_t size) */ if (lcv) { mtx_leave(&udv_lock); - free(udv, M_TEMP); + free(udv, M_TEMP, 0); continue; } @@ -254,7 +254,7 @@ again: if (udv->u_flags & UVM_DEVICE_WANTED) wakeup(udv); mtx_leave(&udv_lock); - free(udv, M_TEMP); + free(udv, M_TEMP, 0); } diff --git a/sys/uvm/uvm_map.c b/sys/uvm/uvm_map.c index 9f9049cb978..702b3bfe307 100644 --- a/sys/uvm/uvm_map.c +++ b/sys/uvm/uvm_map.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_map.c,v 1.170 2014/07/11 16:35:40 jsg Exp $ */ +/* $OpenBSD: uvm_map.c,v 1.171 2014/07/12 18:44:01 tedu Exp $ */ /* $NetBSD: uvm_map.c,v 1.86 2000/11/27 08:40:03 chs Exp $ */ /* @@ -3685,7 +3685,7 @@ uvm_map_deallocate(vm_map_t map) TRUE, FALSE); pmap_destroy(map->pmap); KASSERT(RB_EMPTY(&map->addr)); - free(map, M_VMMAP); + free(map, M_VMMAP, 0); uvm_unmap_detach(&dead, 0); } diff --git a/sys/uvm/uvm_mmap.c b/sys/uvm/uvm_mmap.c index a8cdb821721..d3d545f4e6e 100644 --- a/sys/uvm/uvm_mmap.c +++ b/sys/uvm/uvm_mmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_mmap.c,v 1.97 2014/07/08 11:38:48 deraadt Exp $ */ +/* $OpenBSD: uvm_mmap.c,v 1.98 2014/07/12 18:44:01 tedu Exp $ */ /* $NetBSD: uvm_mmap.c,v 1.49 2001/02/18 21:19:08 chs Exp $ */ /* @@ -211,7 +211,7 @@ sys_mincore(struct proc *p, void *v, register_t *retval) * storing the status byte for a page. */ if ((error = uvm_vslock(p, vec, npgs, VM_PROT_WRITE)) != 0) { - free(pgs, M_TEMP); + free(pgs, M_TEMP, 0); return (error); } @@ -292,7 +292,7 @@ sys_mincore(struct proc *p, void *v, register_t *retval) /* now the map is unlocked we can copyout without fear. */ if (error == 0) copyout(pgs, vec, npgs * sizeof(char)); - free(pgs, M_TEMP); + free(pgs, M_TEMP, 0); return (error); } diff --git a/sys/uvm/uvm_swap.c b/sys/uvm/uvm_swap.c index 9929b576f3a..f80cae56cea 100644 --- a/sys/uvm/uvm_swap.c +++ b/sys/uvm/uvm_swap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_swap.c,v 1.127 2014/05/08 20:08:50 kettenis Exp $ */ +/* $OpenBSD: uvm_swap.c,v 1.128 2014/07/12 18:44:01 tedu Exp $ */ /* $NetBSD: uvm_swap.c,v 1.40 2000/11/17 11:39:39 mrg Exp $ */ /* @@ -497,7 +497,7 @@ swaplist_insert(struct swapdev *sdp, struct swappri *newspp, int priority) LIST_INSERT_HEAD(&swap_priority, spp, spi_swappri); } else { /* we don't need a new priority structure, free it */ - free(newspp, M_VMSWAP); + free(newspp, M_VMSWAP, 0); } /* @@ -555,7 +555,7 @@ swaplist_trim(void) if (!TAILQ_EMPTY(&spp->spi_swapdev)) continue; LIST_REMOVE(spp, spi_swappri); - free(spp, M_VMSWAP); + free(spp, M_VMSWAP, 0); } } @@ -728,7 +728,7 @@ sys_swapctl(struct proc *p, void *v, register_t *retval) swaplist_trim(); } if (error) - free(spp, M_VMSWAP); + free(spp, M_VMSWAP, 0); break; case SWAP_ON: /* @@ -775,8 +775,8 @@ sys_swapctl(struct proc *p, void *v, register_t *retval) if (vp->v_type == VREG) { crfree(sdp->swd_cred); } - free(sdp->swd_path, M_VMSWAP); - free(sdp, M_VMSWAP); + free(sdp->swd_path, M_VMSWAP, 0); + free(sdp, M_VMSWAP, 0); break; } break; @@ -1052,7 +1052,7 @@ swap_off(struct proc *p, struct swapdev *sdp) extent_free(swapmap, sdp->swd_drumoffset, sdp->swd_drumsize, EX_WAITOK); extent_destroy(sdp->swd_ex); - free(sdp, M_VMSWAP); + free(sdp, M_VMSWAP, 0); return (0); } @@ -1909,9 +1909,9 @@ swapmount(void) } else #endif if (bdevvp(swap_dev, &vp)) { - free(sdp->swd_path, M_VMSWAP); - free(sdp, M_VMSWAP); - free(spp, M_VMSWAP); + free(sdp->swd_path, M_VMSWAP, 0); + free(sdp, M_VMSWAP, 0); + free(spp, M_VMSWAP, 0); return; } @@ -1934,8 +1934,8 @@ gotit: swaplist_find(vp, 1); swaplist_trim(); vput(sdp->swd_vp); - free(sdp->swd_path, M_VMSWAP); - free(sdp, M_VMSWAP); + free(sdp->swd_path, M_VMSWAP, 0); + free(sdp, M_VMSWAP, 0); return; } }