after discussions with beck deraadt kettenis.
-/* $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 $ */
/*
}
if (copy != NULL) {
- free(copy, M_TEMP);
+ free(copy, M_TEMP, 0);
} else {
bp->b_flags |= B_INVAL;
brelse(bp);
-/* $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 $ */
/*
/* 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);
}
-/* $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 $ */
/*
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);
}
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);
(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);
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);
-/* $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 $ */
/*
}
}
if (copy != NULL) {
- free(copy, M_TEMP);
+ free(copy, M_TEMP, 0);
} else {
bp->b_flags |= B_INVAL;
brelse(bp);
-/* $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.
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) {
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;
*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++;
-/* $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 $ */
/*
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);
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)
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);
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;
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);
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;
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);
-/* $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 $ */
/*
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);
}
-/* $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.
*
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;
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();
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();
-/* $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 $ */
/*
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;
-/* $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 $ */
/*
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);
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;
}
}
if (newsl == NULL) {
#ifdef UVM_AMAP_PPREF
if (newppref != NULL) {
- free(newppref, M_UVMAMAP);
+ free(newppref, M_UVMAMAP, 0);
}
#endif
return (ENOMEM);
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);
}
-/* $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 $ */
/*
pool_put(&uao_swhash_elt_pool, elt);
}
}
- free(aobj->u_swhash, M_UVMAOBJ);
+ free(aobj->u_swhash, M_UVMAOBJ, 0);
} else {
int i;
uvmexp.swpgonly--;
}
}
- free(aobj->u_swslots, M_UVMAOBJ);
+ free(aobj->u_swslots, M_UVMAOBJ, 0);
}
/* finally free the aobj itself */
}
}
- free(aobj->u_swhash, M_UVMAOBJ);
+ free(aobj->u_swhash, M_UVMAOBJ, 0);
aobj->u_swhash = new_swhash;
aobj->u_pages = pages;
}
}
- free(aobj->u_swhash, M_UVMAOBJ);
+ free(aobj->u_swhash, M_UVMAOBJ, 0);
aobj->u_swslots = new_swslots;
aobj->u_pages = 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;
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;
}
}
- free(aobj->u_swhash, M_UVMAOBJ);
+ free(aobj->u_swhash, M_UVMAOBJ, 0);
aobj->u_swhash = new_swhash;
aobj->u_pages = pages;
}
}
- free(old_swslots, M_UVMAOBJ);
+ free(old_swslots, M_UVMAOBJ, 0);
aobj->u_pages = pages;
return 0;
-/* $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 $ */
/*
*/
if (lcv) {
mtx_leave(&udv_lock);
- free(udv, M_TEMP);
+ free(udv, M_TEMP, 0);
continue;
}
if (udv->u_flags & UVM_DEVICE_WANTED)
wakeup(udv);
mtx_leave(&udv_lock);
- free(udv, M_TEMP);
+ free(udv, M_TEMP, 0);
}
-/* $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 $ */
/*
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);
}
-/* $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 $ */
/*
* 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);
}
/* 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);
}
-/* $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 $ */
/*
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);
}
/*
if (!TAILQ_EMPTY(&spp->spi_swapdev))
continue;
LIST_REMOVE(spp, spi_swappri);
- free(spp, M_VMSWAP);
+ free(spp, M_VMSWAP, 0);
}
}
swaplist_trim();
}
if (error)
- free(spp, M_VMSWAP);
+ free(spp, M_VMSWAP, 0);
break;
case SWAP_ON:
/*
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;
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);
}
} 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;
}
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;
}
}