diff options
author | eivind <eivind@FreeBSD.org> | 1999-12-15 23:02:35 +0000 |
---|---|---|
committer | eivind <eivind@FreeBSD.org> | 1999-12-15 23:02:35 +0000 |
commit | 87724eb67358c0993676ad3dfe9091e192a653f4 (patch) | |
tree | c4e987197c199433e822f5a66858564ad5ccd4dd /sys/kern/vfs_vnops.c | |
parent | 529bc073c0dba1aaccc98818ee299b79a111afab (diff) | |
download | FreeBSD-src-87724eb67358c0993676ad3dfe9091e192a653f4.zip FreeBSD-src-87724eb67358c0993676ad3dfe9091e192a653f4.tar.gz |
Introduce NDFREE (and remove VOP_ABORTOP)
Diffstat (limited to 'sys/kern/vfs_vnops.c')
-rw-r--r-- | sys/kern/vfs_vnops.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index ebe3497..7013308 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -52,6 +52,7 @@ #include <sys/filio.h> #include <sys/ttycom.h> #include <sys/conf.h> +#include <vm/vm_zone.h> static int vn_closefile __P((struct file *fp, struct proc *p)); static int vn_ioctl __P((struct file *fp, u_long com, caddr_t data, @@ -70,6 +71,9 @@ struct fileops vnops = /* * Common code for vnode open operations. * Check permissions, and call the VOP_OPEN or VOP_CREATE routine. + * + * Note that this do NOT free nameidata for the successful case, + * due to the NDINIT being done elsewhere. */ int vn_open(ndp, fmode, cmode) @@ -100,15 +104,17 @@ vn_open(ndp, fmode, cmode) VOP_LEASE(ndp->ni_dvp, p, cred, LEASE_WRITE); error = VOP_CREATE(ndp->ni_dvp, &ndp->ni_vp, &ndp->ni_cnd, vap); - vput(ndp->ni_dvp); - if (error) + if (error) { + NDFREE(ndp, NDF_ONLY_PNBUF); + vput(ndp->ni_dvp); return (error); + } + vput(ndp->ni_dvp); ASSERT_VOP_UNLOCKED(ndp->ni_dvp, "create"); ASSERT_VOP_LOCKED(ndp->ni_vp, "create"); fmode &= ~O_TRUNC; vp = ndp->ni_vp; } else { - VOP_ABORTOP(ndp->ni_dvp, &ndp->ni_cnd); if (ndp->ni_dvp == ndp->ni_vp) vrele(ndp->ni_dvp); else @@ -183,6 +189,7 @@ vn_open(ndp, fmode, cmode) vp->v_writecount++; return (0); bad: + NDFREE(ndp, NDF_ONLY_PNBUF); vput(vp); return (error); } |