summaryrefslogtreecommitdiff
path: root/sys/ufs
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2004-05-14 04:00:35 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2004-05-14 04:00:35 +0000
commitfca2cf71cc88b832f5e93f0288867997cb0d35d4 (patch)
treeb3b384460ab9208645ad0e2923d26d70668c0916 /sys/ufs
parente517eaa484ed1d99ebecdc738e49a7d3d93aec3c (diff)
use pool for namei pathbuf. testing ok millert@ tdeval@
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ext2fs/ext2fs_vnops.c12
-rw-r--r--sys/ufs/ufs/ufs_extattr.c9
-rw-r--r--sys/ufs/ufs/ufs_vnops.c19
3 files changed, 21 insertions, 19 deletions
diff --git a/sys/ufs/ext2fs/ext2fs_vnops.c b/sys/ufs/ext2fs/ext2fs_vnops.c
index 3643daa378d..db8f6fc7553 100644
--- a/sys/ufs/ext2fs/ext2fs_vnops.c
+++ b/sys/ufs/ext2fs/ext2fs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ext2fs_vnops.c,v 1.33 2004/03/02 05:52:24 tedu Exp $ */
+/* $OpenBSD: ext2fs_vnops.c,v 1.34 2004/05/14 04:00:34 tedu Exp $ */
/* $NetBSD: ext2fs_vnops.c,v 1.1 1997/06/11 09:34:09 bouyer Exp $ */
/*
@@ -537,7 +537,7 @@ ext2fs_link(v)
ip->i_e2fs_nlink--;
ip->i_flag |= IN_CHANGE;
}
- FREE(cnp->cn_pnbuf, M_NAMEI);
+ pool_put(&namei_pool, cnp->cn_pnbuf);
out1:
if (dvp != vp)
VOP_UNLOCK(vp, 0, p);
@@ -1066,7 +1066,7 @@ bad:
} else
*ap->a_vpp = tvp;
out:
- FREE(cnp->cn_pnbuf, M_NAMEI);
+ pool_put(&namei_pool, cnp->cn_pnbuf);
vput(dvp);
return (error);
}
@@ -1258,7 +1258,7 @@ ext2fs_makeinode(mode, dvp, vpp, cnp)
if ((error = ext2fs_inode_alloc(pdir, mode, cnp->cn_cred, &tvp))
!= 0) {
- free(cnp->cn_pnbuf, M_NAMEI);
+ pool_put(&namei_pool, cnp->cn_pnbuf);
vput(dvp);
return (error);
}
@@ -1283,7 +1283,7 @@ ext2fs_makeinode(mode, dvp, vpp, cnp)
if (error != 0)
goto bad;
if ((cnp->cn_flags & SAVESTART) == 0)
- FREE(cnp->cn_pnbuf, M_NAMEI);
+ pool_put(&namei_pool, cnp->cn_pnbuf);
vput(dvp);
*vpp = tvp;
return (0);
@@ -1293,7 +1293,7 @@ bad:
* Write error occurred trying to update the inode
* or the directory so must deallocate the inode.
*/
- free(cnp->cn_pnbuf, M_NAMEI);
+ pool_put(&namei_pool, cnp->cn_pnbuf);
vput(dvp);
ip->i_e2fs_nlink = 0;
ip->i_flag |= IN_CHANGE;
diff --git a/sys/ufs/ufs/ufs_extattr.c b/sys/ufs/ufs/ufs_extattr.c
index c16615ef9ad..a36910d9a6d 100644
--- a/sys/ufs/ufs/ufs_extattr.c
+++ b/sys/ufs/ufs/ufs_extattr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ufs_extattr.c,v 1.4 2003/08/15 20:32:21 tedu Exp $ */
+/* $OpenBSD: ufs_extattr.c,v 1.5 2004/05/14 04:00:34 tedu Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001, 2002 Robert N. M. Watson
* Copyright (c) 2002 Networks Associates Technology, Inc.
@@ -48,6 +48,7 @@
#include <sys/kernel.h>
#include <sys/namei.h>
#include <sys/malloc.h>
+#include <sys/pool.h>
#include <sys/fcntl.h>
#include <sys/proc.h>
#include <sys/vnode.h>
@@ -276,7 +277,7 @@ ufs_extattr_lookup(struct vnode *start_dvp, int lockparent, char *dirname,
cnp.cn_flags |= LOCKPARENT;
cnp.cn_proc = p;
cnp.cn_cred = p->p_ucred;
- MALLOC(cnp.cn_pnbuf, char *, MAXPATHLEN, M_NAMEI, M_WAITOK);
+ cnp.cn_pnbuf = pool_get(&namei_pool, PR_WAITOK);
cnp.cn_nameptr = cnp.cn_pnbuf;
error = copystr(dirname, cnp.cn_pnbuf, MAXPATHLEN,
@@ -285,7 +286,7 @@ ufs_extattr_lookup(struct vnode *start_dvp, int lockparent, char *dirname,
if (lockparent == UE_GETDIR_LOCKPARENT_DONT) {
VOP_UNLOCK(start_dvp, 0, p);
}
- FREE(cnp.cn_pnbuf, M_NAMEI);
+ pool_put(&namei_pool, cnp.cn_pnbuf);
printf("ufs_extattr_lookup: copystr failed\n");
return (error);
}
@@ -295,7 +296,7 @@ ufs_extattr_lookup(struct vnode *start_dvp, int lockparent, char *dirname,
vargs.a_vpp = &target_vp;
vargs.a_cnp = &cnp;
error = ufs_lookup(&vargs);
- FREE(cnp.cn_pnbuf, M_NAMEI);
+ pool_put(&namei_pool, cnp.cn_pnbuf);
if (error) {
/*
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c
index c350bdc1dd4..70b22d04c5f 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.54 2003/12/28 17:20:16 tedu Exp $ */
+/* $OpenBSD: ufs_vnops.c,v 1.55 2004/05/14 04:00:34 tedu Exp $ */
/* $NetBSD: ufs_vnops.c,v 1.18 1996/05/11 18:28:04 mycroft Exp $ */
/*
@@ -50,6 +50,7 @@
#include <sys/mount.h>
#include <sys/vnode.h>
#include <sys/malloc.h>
+#include <sys/pool.h>
#include <sys/dirent.h>
#include <sys/lockf.h>
#include <sys/event.h>
@@ -725,7 +726,7 @@ ufs_link(v)
if (DOINGSOFTDEP(vp))
softdep_change_linkcnt(ip);
}
- FREE(cnp->cn_pnbuf, M_NAMEI);
+ pool_put(&namei_pool, cnp->cn_pnbuf);
VN_KNOTE(vp, NOTE_LINK);
VN_KNOTE(dvp, NOTE_WRITE);
out1:
@@ -791,7 +792,7 @@ ufs_whiteout(v)
/* NOTREACHED */
}
if (cnp->cn_flags & HASBUF) {
- FREE(cnp->cn_pnbuf, M_NAMEI);
+ pool_put(&namei_pool, cnp->cn_pnbuf);
cnp->cn_flags &= ~HASBUF;
}
return (error);
@@ -1281,7 +1282,7 @@ ufs_mkdir(v)
if ((error = getinoquota(ip)) ||
(error = ufs_quota_alloc_inode(ip, cnp->cn_cred))) {
- free(cnp->cn_pnbuf, M_NAMEI);
+ pool_put(&namei_pool, cnp->cn_pnbuf);
UFS_INODE_FREE(ip, ip->i_number, dmode);
vput(tvp);
vput(dvp);
@@ -1387,7 +1388,7 @@ bad:
vput(tvp);
}
out:
- FREE(cnp->cn_pnbuf, M_NAMEI);
+ pool_put(&namei_pool, cnp->cn_pnbuf);
vput(dvp);
return (error);
@@ -2094,7 +2095,7 @@ ufs_makeinode(mode, dvp, vpp, cnp)
mode |= IFREG;
if ((error = UFS_INODE_ALLOC(pdir, mode, cnp->cn_cred, &tvp)) != 0) {
- free(cnp->cn_pnbuf, M_NAMEI);
+ pool_put(&namei_pool, cnp->cn_pnbuf);
vput(dvp);
return (error);
}
@@ -2104,7 +2105,7 @@ ufs_makeinode(mode, dvp, vpp, cnp)
if ((error = getinoquota(ip)) ||
(error = ufs_quota_alloc_inode(ip, cnp->cn_cred))) {
- free(cnp->cn_pnbuf, M_NAMEI);
+ pool_put(&namei_pool, cnp->cn_pnbuf);
UFS_INODE_FREE(ip, ip->i_number, mode);
vput(tvp);
vput(dvp);
@@ -2137,7 +2138,7 @@ ufs_makeinode(mode, dvp, vpp, cnp)
goto bad;
if ((cnp->cn_flags & SAVESTART) == 0)
- FREE(cnp->cn_pnbuf, M_NAMEI);
+ pool_put(&namei_pool, cnp->cn_pnbuf);
vput(dvp);
*vpp = tvp;
return (0);
@@ -2147,7 +2148,7 @@ bad:
* Write error occurred trying to update the inode
* or the directory so must deallocate the inode.
*/
- free(cnp->cn_pnbuf, M_NAMEI);
+ pool_put(&namei_pool, cnp->cn_pnbuf);
vput(dvp);
ip->i_effnlink = 0;
ip->i_ffs_nlink = 0;