summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorBob Beck <beck@cvs.openbsd.org>2014-07-14 08:11:35 +0000
committerBob Beck <beck@cvs.openbsd.org>2014-07-14 08:11:35 +0000
commit9c7a32f7bb1122bc6c4c1827b63fe26fa7c503fb (patch)
tree0583c3d370641f39c04b643e4c388a53c5d008b0 /sys
parentafda1f50262607e949ebcbea1e8a310d6a0abc60 (diff)
revert free checks in here. this seems to be a bit too agressive at the
moment and now is not the time. hitting these in here causes chaos. We need to do these, but at a better time than right after a hackathon and before release. ok guenther@
Diffstat (limited to 'sys')
-rw-r--r--sys/ufs/ffs/ffs_inode.c4
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c12
-rw-r--r--sys/ufs/ufs/ufs_dirhash.c19
3 files changed, 17 insertions, 18 deletions
diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c
index ae33ed56b3a..3a9efef099a 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.72 2014/07/13 23:33:26 tedu Exp $ */
+/* $OpenBSD: ffs_inode.c,v 1.73 2014/07/14 08:11:34 beck 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, fs->fs_bsize);
+ free(copy, M_TEMP, 0);
} else {
bp->b_flags |= B_INVAL;
brelse(bp);
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index 8ad885b89d5..15e3a6a9230 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.142 2014/07/13 23:33:26 tedu Exp $ */
+/* $OpenBSD: ffs_vfsops.c,v 1.143 2014/07/14 08:11:34 beck 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, sizeof(*mp));
+ free(mp, M_MOUNT, 0);
vrele(swapdev_vp);
vrele(rootvp);
return (error);
@@ -907,8 +907,8 @@ out:
VOP_UNLOCK(devvp, 0, p);
if (ump) {
- free(ump->um_fs, M_UFSMNT, sizeof(*ump->um_fs));
- free(ump, M_UFSMNT, sizeof(*ump));
+ free(ump->um_fs, M_UFSMNT, 0);
+ free(ump, M_UFSMNT, 0);
mp->mnt_data = NULL;
}
return (error);
@@ -1027,8 +1027,8 @@ ffs_unmount(struct mount *mp, int mntflags, struct proc *p)
NOCRED, p);
vput(ump->um_devvp);
free(fs->fs_csp, M_UFSMNT, 0);
- free(fs, M_UFSMNT, sizeof(*fs));
- free(ump, M_UFSMNT, sizeof(*ump));
+ 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/ufs/ufs_dirhash.c b/sys/ufs/ufs/ufs_dirhash.c
index 86ebe4950da..41c13341a33 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.28 2014/07/13 23:33:26 tedu Exp $ */
+/* $OpenBSD: ufs_dirhash.c,v 1.29 2014/07/14 08:11:34 beck Exp $ */
/*
* Copyright (c) 2001, 2002 Ian Dowse. All rights reserved.
*
@@ -246,12 +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, narrays * sizeof(dh->dh_hash[0]));
+ free(dh->dh_hash, M_DIRHASH, 0);
}
if (dh->dh_blkfree != NULL)
- free(dh->dh_blkfree, M_DIRHASH,
- nblocks * sizeof(dh->dh_blkfree[0]));
- free(dh, M_DIRHASH, sizeof(*dh));
+ free(dh->dh_blkfree, M_DIRHASH, 0);
+ free(dh, M_DIRHASH, 0);
ip->i_dirhash = NULL;
DIRHASHLIST_LOCK();
ufs_dirhashmem -= memreqd;
@@ -283,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, dh->dh_narrays * sizeof(*dh->dh_hash));
- free(dh->dh_blkfree, M_DIRHASH, dh->dh_nblk * sizeof(*dh->dh_blkfree));
+ 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, sizeof(*dh));
+ free(dh, M_DIRHASH, 0);
ip->i_dirhash = NULL;
DIRHASHLIST_LOCK();
@@ -1043,8 +1042,8 @@ ufsdirhash_recycle(int wanted)
DIRHASHLIST_UNLOCK();
for (i = 0; i < narrays; i++)
DIRHASH_BLKFREE(hash[i]);
- free(hash, M_DIRHASH, narrays * sizeof(*dh->dh_hash));
- free(blkfree, M_DIRHASH, dh->dh_nblk * sizeof(*dh->dh_blkfree));
+ free(hash, M_DIRHASH, 0);
+ free(blkfree, M_DIRHASH, 0);
/* Account for the returned memory, and repeat if necessary. */
DIRHASHLIST_LOCK();