Index: coda/coda_vnops.c =================================================================== RCS file: /home/ncvs/src/sys/coda/coda_vnops.c,v retrieving revision 1.20 diff -u -r1.20 coda_vnops.c --- coda_vnops.c 1999/11/13 20:58:09 1.20 +++ coda_vnops.c 1999/11/13 23:29:58 @@ -131,7 +131,6 @@ { &vop_symlink_desc, coda_symlink }, /* symlink */ { &vop_readdir_desc, coda_readdir }, /* readdir */ { &vop_readlink_desc, coda_readlink }, /* readlink */ - { &vop_abortop_desc, coda_abortop }, /* abortop */ { &vop_inactive_desc, coda_inactive }, /* inactive */ { &vop_reclaim_desc, coda_reclaim }, /* reclaim */ { &vop_lock_desc, coda_lock }, /* lock */ @@ -745,30 +744,7 @@ return(error); } -/* - * CODA abort op, called after namei() when a CREATE/DELETE isn't actually - * done. If a buffer has been saved in anticipation of a coda_create or - * a coda_remove, delete it. - */ -/* ARGSUSED */ int -coda_abortop(v) - void *v; -{ -/* true args */ - struct vop_abortop_args /* { - struct vnode *a_dvp; - struct componentname *a_cnp; - } */ *ap = v; -/* upcall decl */ -/* locals */ - - if ((ap->a_cnp->cn_flags & (HASBUF | SAVESTART)) == HASBUF) - zfree(namei_zone, ap->a_cnp->cn_pnbuf); - return (0); -} - -int coda_readlink(v) void *v; { @@ -1208,14 +1184,6 @@ } #endif } - /* Have to free the previously saved name */ - /* - * This condition is stolen from ufs_makeinode. I have no idea - * why it's here, but what the hey... - */ - if ((cnp->cn_flags & SAVESTART) == 0) { - zfree(namei_zone, cnp->cn_pnbuf); - } return(error); } @@ -1276,9 +1244,6 @@ CODADEBUG(CODA_REMOVE, myprintf(("in remove result %d\n",error)); ) - if ((cnp->cn_flags & SAVESTART) == 0) { - zfree(namei_zone, cnp->cn_pnbuf); - } return(error); } @@ -1332,10 +1297,6 @@ CODADEBUG(CODA_LINK, myprintf(("in link result %d\n",error)); ) - /* Drop the name buffer if we don't need to SAVESTART */ - if ((cnp->cn_flags & SAVESTART) == 0) { - zfree(namei_zone, cnp->cn_pnbuf); - } return(error); } @@ -1502,14 +1463,6 @@ CODADEBUG(CODA_MKDIR, myprintf(("mkdir error %d\n",error));) } - /* Have to free the previously saved name */ - /* - * ufs_mkdir doesn't check for SAVESTART before freeing the - * pathname buffer, but ufs_create does. For the moment, I'll - * follow their lead, but this seems like it is probably - * incorrect. - */ - zfree(namei_zone, cnp->cn_pnbuf); return(error); } @@ -1559,9 +1512,6 @@ CODADEBUG(CODA_RMDIR, myprintf(("in rmdir result %d\n", error)); ) - if ((cnp->cn_flags & SAVESTART) == 0) { - zfree(namei_zone, cnp->cn_pnbuf); - } return(error); } Index: gnu/ext2fs/ext2_vnops.c =================================================================== RCS file: /home/ncvs/src/sys/gnu/ext2fs/ext2_vnops.c,v retrieving revision 1.49 diff -u -r1.49 ext2_vnops.c --- ext2_vnops.c 1999/11/13 20:58:10 1.49 +++ ext2_vnops.c 1999/11/13 22:36:38 @@ -329,22 +329,18 @@ panic("ufs_link: no name"); #endif if (tdvp->v_mount != vp->v_mount) { - VOP_ABORTOP(tdvp, cnp); error = EXDEV; goto out2; } if (tdvp != vp && (error = vn_lock(vp, LK_EXCLUSIVE, p))) { - VOP_ABORTOP(tdvp, cnp); goto out2; } ip = VTOI(vp); if ((nlink_t)ip->i_nlink >= LINK_MAX) { - VOP_ABORTOP(tdvp, cnp); error = EMLINK; goto out1; } if (ip->i_flags & (IMMUTABLE | APPEND)) { - VOP_ABORTOP(tdvp, cnp); error = EPERM; goto out1; } @@ -357,7 +353,6 @@ ip->i_nlink--; ip->i_flag |= IN_CHANGE; } - zfree(namei_zone, cnp->cn_pnbuf); out1: if (tdvp != vp) VOP_UNLOCK(vp, 0, p); @@ -405,14 +400,12 @@ (tvp && (fvp->v_mount != tvp->v_mount))) { error = EXDEV; abortit: - VOP_ABORTOP(tdvp, tcnp); /* XXX, why not in NFS? */ if (tdvp == tvp) vrele(tdvp); else vput(tdvp); if (tvp) vput(tvp); - VOP_ABORTOP(fdvp, fcnp); /* XXX, why not in NFS? */ vrele(fdvp); vrele(fvp); return (error); @@ -446,7 +439,6 @@ } /* Release destination completely. */ - VOP_ABORTOP(tdvp, tcnp); vput(tdvp); vput(tvp); @@ -873,7 +865,6 @@ #ifdef QUOTA if ((error = getinoquota(ip)) || (error = chkiq(ip, 1, ucp, 0))) { - zfree(namei_zone, cnp->cn_pnbuf); UFS_VFREE(tvp, ip->i_number, dmode); vput(tvp); return (error); @@ -885,7 +876,6 @@ #ifdef QUOTA if ((error = getinoquota(ip)) || (error = chkiq(ip, 1, cnp->cn_cred, 0))) { - zfree(namei_zone, cnp->cn_pnbuf); UFS_VFREE(tvp, ip->i_number, dmode); vput(tvp); return (error); @@ -956,7 +946,6 @@ } else *ap->a_vpp = tvp; out: - zfree(namei_zone, cnp->cn_pnbuf); return (error); #undef DIRBLKSIZ #define DIRBLKSIZ DEV_BSIZE @@ -1093,7 +1082,6 @@ error = UFS_VALLOC(dvp, mode, cnp->cn_cred, &tvp); if (error) { - zfree(namei_zone, cnp->cn_pnbuf); return (error); } ip = VTOI(tvp); @@ -1138,7 +1126,6 @@ #ifdef QUOTA if ((error = getinoquota(ip)) || (error = chkiq(ip, 1, ucp, 0))) { - zfree(namei_zone, cnp->cn_pnbuf); UFS_VFREE(tvp, ip->i_number, mode); vput(tvp); return (error); @@ -1150,7 +1137,6 @@ #ifdef QUOTA if ((error = getinoquota(ip)) || (error = chkiq(ip, 1, cnp->cn_cred, 0))) { - zfree(namei_zone, cnp->cn_pnbuf); UFS_VFREE(tvp, ip->i_number, mode); vput(tvp); return (error); @@ -1178,8 +1164,6 @@ if (error) goto bad; - if ((cnp->cn_flags & SAVESTART) == 0) - zfree(namei_zone, cnp->cn_pnbuf); *vpp = tvp; return (0); @@ -1188,7 +1172,6 @@ * Write error occurred trying to update the inode * or the directory so must deallocate the inode. */ - zfree(namei_zone, cnp->cn_pnbuf); ip->i_nlink = 0; ip->i_flag |= IN_CHANGE; vput(tvp); Index: isofs/cd9660/cd9660_vnops.c =================================================================== RCS file: /home/ncvs/src/sys/isofs/cd9660/cd9660_vnops.c,v retrieving revision 1.60 diff -u -r1.60 cd9660_vnops.c --- cd9660_vnops.c 1999/10/11 19:18:43 1.60 +++ cd9660_vnops.c 1999/11/13 23:31:30 @@ -71,7 +71,6 @@ static int iso_shipdir __P((struct isoreaddir *idp)); static int cd9660_readdir __P((struct vop_readdir_args *)); static int cd9660_readlink __P((struct vop_readlink_args *ap)); -static int cd9660_abortop __P((struct vop_abortop_args *)); static int cd9660_strategy __P((struct vop_strategy_args *)); static int cd9660_print __P((struct vop_print_args *)); static int cd9660_getpages __P((struct vop_getpages_args *)); @@ -708,22 +707,6 @@ } /* - * Ufs abort op, called after namei() when a CREATE/DELETE isn't actually - * done. If a buffer has been saved in anticipation of a CREATE, delete it. - */ -static int -cd9660_abortop(ap) - struct vop_abortop_args /* { - struct vnode *a_dvp; - struct componentname *a_cnp; - } */ *ap; -{ - if ((ap->a_cnp->cn_flags & (HASBUF | SAVESTART)) == HASBUF) - zfree(namei_zone, ap->a_cnp->cn_pnbuf); - return (0); -} - -/* * Calculate the logical to physical mapping if not done already, * then call the device strategy routine. */ @@ -851,7 +834,6 @@ vop_t **cd9660_vnodeop_p; static struct vnodeopv_entry_desc cd9660_vnodeop_entries[] = { { &vop_default_desc, (vop_t *) vop_defaultop }, - { &vop_abortop_desc, (vop_t *) cd9660_abortop }, { &vop_access_desc, (vop_t *) cd9660_access }, { &vop_bmap_desc, (vop_t *) cd9660_bmap }, { &vop_cachedlookup_desc, (vop_t *) cd9660_lookup }, Index: kern/uipc_usrreq.c =================================================================== RCS file: /home/ncvs/src/sys/kern/uipc_usrreq.c,v retrieving revision 1.51 diff -u -r1.51 uipc_usrreq.c --- uipc_usrreq.c 1999/10/11 15:19:11 1.51 +++ uipc_usrreq.c 1999/11/13 22:35:53 @@ -559,7 +559,7 @@ return (error); vp = nd.ni_vp; if (vp != NULL) { - VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd); + VOP_RELEASEND(nd.ni_dvp, &nd.ni_cnd); if (nd.ni_dvp == vp) vrele(nd.ni_dvp); else @@ -572,6 +572,7 @@ vattr.va_mode = (ACCESSPERMS & ~p->p_fd->fd_cmask); VOP_LEASE(nd.ni_dvp, p, p->p_ucred, LEASE_WRITE); error = VOP_CREATE(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vattr); + VOP_RELEASEND(nd.ni_dvp, &nd.ni_cnd); vput(nd.ni_dvp); if (error) return (error); Index: kern/vfs_default.c =================================================================== RCS file: /home/ncvs/src/sys/kern/vfs_default.c,v retrieving revision 1.24 diff -u -r1.24 vfs_default.c --- vfs_default.c 1999/11/07 15:09:49 1.24 +++ vfs_default.c 1999/11/13 23:32:27 @@ -63,7 +63,6 @@ vop_t **default_vnodeop_p; static struct vnodeopv_entry_desc default_vnodeop_entries[] = { { &vop_default_desc, (vop_t *) vop_eopnotsupp }, - { &vop_abortop_desc, (vop_t *) vop_null }, { &vop_advlock_desc, (vop_t *) vop_einval }, { &vop_bwrite_desc, (vop_t *) vop_stdbwrite }, { &vop_close_desc, (vop_t *) vop_null }, Index: kern/vfs_syscalls.c =================================================================== RCS file: /home/ncvs/src/sys/kern/vfs_syscalls.c,v retrieving revision 1.143 diff -u -r1.143 vfs_syscalls.c --- vfs_syscalls.c 1999/11/13 20:58:11 1.143 +++ vfs_syscalls.c 1999/11/13 23:46:27 @@ -1134,20 +1134,18 @@ } if (!error) { VOP_LEASE(nd.ni_dvp, p, p->p_ucred, LEASE_WRITE); - if (whiteout) { + if (whiteout) error = VOP_WHITEOUT(nd.ni_dvp, &nd.ni_cnd, CREATE); - if (error) - VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd); - vput(nd.ni_dvp); - } else { + else { error = VOP_MKNOD(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vattr); if (error == 0) vput(nd.ni_vp); - vput(nd.ni_dvp); } + VOP_RELEASEND(nd.ni_dvp, &nd.ni_cnd); + vput(nd.ni_dvp); } else { - VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd); + VOP_RELEASEND(nd.ni_dvp, &nd.ni_cnd); if (nd.ni_dvp == vp) vrele(nd.ni_dvp); else @@ -1186,7 +1184,7 @@ if ((error = namei(&nd)) != 0) return (error); if (nd.ni_vp != NULL) { - VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd); + VOP_RELEASEND(nd.ni_dvp, &nd.ni_cnd); if (nd.ni_dvp == nd.ni_vp) vrele(nd.ni_dvp); else @@ -1201,6 +1199,7 @@ error = VOP_MKNOD(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vattr); if (error == 0) vput(nd.ni_vp); + VOP_RELEASEND(nd.ni_dvp, &nd.ni_cnd); vput(nd.ni_dvp); return (error); } @@ -1238,7 +1237,6 @@ error = namei(&nd); if (!error) { if (nd.ni_vp != NULL) { - VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd); if (nd.ni_vp) vrele(nd.ni_vp); error = EEXIST; @@ -1248,6 +1246,7 @@ VOP_LEASE(vp, p, p->p_ucred, LEASE_WRITE); error = VOP_LINK(nd.ni_dvp, vp, &nd.ni_cnd); } + VOP_RELEASEND(nd.ni_dvp, &nd.ni_cnd); if (nd.ni_dvp == nd.ni_vp) vrele(nd.ni_dvp); else @@ -1290,7 +1289,7 @@ if ((error = namei(&nd)) != 0) goto out; if (nd.ni_vp) { - VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd); + VOP_RELEASEND(nd.ni_dvp, &nd.ni_cnd); if (nd.ni_dvp == nd.ni_vp) vrele(nd.ni_dvp); else @@ -1303,6 +1302,7 @@ vattr.va_mode = ACCESSPERMS &~ p->p_fd->fd_cmask; VOP_LEASE(nd.ni_dvp, p, p->p_ucred, LEASE_WRITE); error = VOP_SYMLINK(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vattr, path); + VOP_RELEASEND(nd.ni_dvp, &nd.ni_cnd); if (error == 0) vput(nd.ni_vp); vput(nd.ni_dvp); @@ -1334,7 +1334,7 @@ return (error); if (nd.ni_vp != NULLVP || !(nd.ni_cnd.cn_flags & ISWHITEOUT)) { - VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd); + VOP_RELEASEND(nd.ni_dvp, &nd.ni_cnd); if (nd.ni_dvp == nd.ni_vp) vrele(nd.ni_dvp); else @@ -1345,8 +1345,8 @@ } VOP_LEASE(nd.ni_dvp, p, p->p_ucred, LEASE_WRITE); - if ((error = VOP_WHITEOUT(nd.ni_dvp, &nd.ni_cnd, DELETE)) != 0) - VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd); + error = VOP_WHITEOUT(nd.ni_dvp, &nd.ni_cnd, DELETE); + VOP_RELEASEND(nd.ni_dvp, &nd.ni_cnd); vput(nd.ni_dvp); ASSERT_VOP_UNLOCKED(nd.ni_dvp, "undelete"); ASSERT_VOP_UNLOCKED(nd.ni_vp, "undelete"); @@ -1395,9 +1395,8 @@ if (!error) { VOP_LEASE(nd.ni_dvp, p, p->p_ucred, LEASE_WRITE); error = VOP_REMOVE(nd.ni_dvp, vp, &nd.ni_cnd); - } else { - VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd); } + VOP_RELEASEND(nd.ni_dvp, &nd.ni_cnd); if (nd.ni_dvp == vp) vrele(nd.ni_dvp); else @@ -2555,7 +2554,6 @@ /* Translate error code for rename("dir1", "dir2/."). */ if (error == EISDIR && fvp->v_type == VDIR) error = EINVAL; - VOP_ABORTOP(fromnd.ni_dvp, &fromnd.ni_cnd); vrele(fromnd.ni_dvp); vrele(fvp); goto out1; @@ -2595,14 +2593,13 @@ error = VOP_RENAME(fromnd.ni_dvp, fromnd.ni_vp, &fromnd.ni_cnd, tond.ni_dvp, tond.ni_vp, &tond.ni_cnd); } else { - VOP_ABORTOP(tond.ni_dvp, &tond.ni_cnd); + VOP_RELEASEND(tond.ni_dvp, &tond.ni_cnd); if (tdvp == tvp) vrele(tdvp); else vput(tdvp); if (tvp) vput(tvp); - VOP_ABORTOP(fromnd.ni_dvp, &fromnd.ni_cnd); vrele(fromnd.ni_dvp); vrele(fvp); } @@ -2611,11 +2608,10 @@ ASSERT_VOP_UNLOCKED(fromnd.ni_vp, "rename"); ASSERT_VOP_UNLOCKED(tond.ni_dvp, "rename"); ASSERT_VOP_UNLOCKED(tond.ni_vp, "rename"); - zfree(namei_zone, tond.ni_cnd.cn_pnbuf); out1: if (fromnd.ni_startdir) vrele(fromnd.ni_startdir); - zfree(namei_zone, fromnd.ni_cnd.cn_pnbuf); + VOP_RELEASEND(fromnd.ni_dvp, &fromnd.ni_cnd); if (error == -1) return (0); return (error); @@ -2650,7 +2646,7 @@ return (error); vp = nd.ni_vp; if (vp != NULL) { - VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd); + VOP_RELEASEND(nd.ni_dvp, &nd.ni_cnd); if (nd.ni_dvp == vp) vrele(nd.ni_dvp); else @@ -2663,6 +2659,7 @@ vattr.va_mode = (SCARG(uap, mode) & ACCESSPERMS) &~ p->p_fd->fd_cmask; VOP_LEASE(nd.ni_dvp, p, p->p_ucred, LEASE_WRITE); error = VOP_MKDIR(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vattr); + VOP_RELEASEND(nd.ni_dvp, &nd.ni_cnd); vput(nd.ni_dvp); if (!error) vput(nd.ni_vp); @@ -2717,9 +2714,8 @@ VOP_LEASE(nd.ni_dvp, p, p->p_ucred, LEASE_WRITE); VOP_LEASE(vp, p, p->p_ucred, LEASE_WRITE); error = VOP_RMDIR(nd.ni_dvp, nd.ni_vp, &nd.ni_cnd); - } else { - VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd); } + VOP_RELEASEND(nd.ni_dvp, &nd.ni_cnd); if (nd.ni_dvp == vp) vrele(nd.ni_dvp); else Index: kern/vfs_vnops.c =================================================================== RCS file: /home/ncvs/src/sys/kern/vfs_vnops.c,v retrieving revision 1.83 diff -u -r1.83 vfs_vnops.c --- vfs_vnops.c 1999/11/08 03:32:15 1.83 +++ vfs_vnops.c 1999/11/14 00:25:35 @@ -52,6 +52,7 @@ #include #include #include +#include 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, @@ -100,6 +101,7 @@ VOP_LEASE(ndp->ni_dvp, p, cred, LEASE_WRITE); error = VOP_CREATE(ndp->ni_dvp, &ndp->ni_vp, &ndp->ni_cnd, vap); + VOP_RELEASEND(ndp->ni_dvp, &ndp->ni_cnd); vput(ndp->ni_dvp); if (error) return (error); @@ -108,7 +110,7 @@ fmode &= ~O_TRUNC; vp = ndp->ni_vp; } else { - VOP_ABORTOP(ndp->ni_dvp, &ndp->ni_cnd); + VOP_RELEASEND(ndp->ni_dvp, &ndp->ni_cnd); if (ndp->ni_dvp == ndp->ni_vp) vrele(ndp->ni_dvp); else Index: kern/vnode_if.sh =================================================================== RCS file: /home/ncvs/src/sys/kern/vnode_if.sh,v retrieving revision 1.20 diff -u -r1.20 vnode_if.sh --- vnode_if.sh 1999/09/26 18:31:51 1.20 +++ vnode_if.sh 1999/11/13 23:28:09 @@ -71,6 +71,11 @@ * Created from @(#)vnode_if.sh 8.1 (Berkeley) 6/10/93 */ +#define VOP_RELEASEND(vp, cnp) do { \\ + (void)(vp); /* Do side effects of (vp) */ \\ + zfree(namei_zone, (cnp)->cn_pnbuf); \\ +} while (0) + extern struct vnodeop_desc vop_default_desc; END_OF_LEADING_COMMENT ; @@ -157,6 +162,9 @@ } else { die "No IN/OUT direction for \"$ln\"."; } + # Strip extra 'NOFREE' specs I use in vnode_if.src to track + # which cnp's will not be freed. + $ln =~ s/NOFREE\s+//; if ($ln =~ s/^WILLRELE\s+//) { $rele = 'WILLRELE'; } else { Index: kern/vnode_if.src =================================================================== RCS file: /home/ncvs/src/sys/kern/vnode_if.src,v retrieving revision 1.25 diff -u -r1.25 vnode_if.src --- vnode_if.src 1999/11/13 20:58:11 1.25 +++ vnode_if.src 1999/11/13 23:29:03 @@ -65,6 +65,8 @@ # on the flags and operation fields in the (cnp) structure. Note # especially that *vpp may equal dvp and both may be locked. # +# XXX - note that handling of struct componentname hasn't been updated for +# freeing reflexively. vop_lookup { IN struct vnode *dvp; INOUT struct vnode **vpp; @@ -77,6 +79,8 @@ # # This must be an exact copy of lookup. See kern/vfs_cache.c for details. # +# XXX - note that handling of struct componentname hasn't been updated for +# freeing reflexively. vop_cachedlookup { IN struct vnode *dvp; INOUT struct vnode **vpp; @@ -331,14 +335,6 @@ IN struct vnode *vp; INOUT struct uio *uio; IN struct ucred *cred; -}; - -# -#% abortop dvp = = = -# -vop_abortop { - IN struct vnode *dvp; - IN struct componentname *cnp; }; # Index: miscfs/devfs/devfs_vnops.c =================================================================== RCS file: /home/ncvs/src/sys/miscfs/devfs/devfs_vnops.c,v retrieving revision 1.84 diff -u -r1.84 devfs_vnops.c --- devfs_vnops.c 1999/11/13 20:58:12 1.84 +++ devfs_vnops.c 1999/11/13 22:36:47 @@ -681,7 +681,6 @@ */ if ((error = devfs_vntodn(dvp, &tdp)) != 0) { abortit: - VOP_ABORTOP(dvp, cnp); return (error); } if ((error = devfs_vntodn(vp, &tp)) != 0) goto abortit; @@ -791,7 +790,6 @@ || (vp->v_tag != tdvp->v_tag) ) { error = EXDEV; abortit: - VOP_ABORTOP(tdvp, cnp); goto out; } @@ -905,14 +903,12 @@ || ((fp->type == DEV_DIR) && (fp->dvm != tdp->dvm ))) { error = EXDEV; abortit: - VOP_ABORTOP(tdvp, tcnp); if (tdvp == tvp) /* eh? */ vrele(tdvp); else vput(tdvp); if (tvp) vput(tvp); - VOP_ABORTOP(fdvp, fcnp); /* XXX, why not in NFS? */ vrele(fdvp); vrele(fvp); return (error); @@ -982,12 +978,10 @@ } /* Release destination completely. */ - VOP_ABORTOP(tdvp, tcnp); vput(tdvp); vput(tvp); /* Delete source. */ - VOP_ABORTOP(fdvp, fcnp); /*XXX*/ vrele(fdvp); vrele(fvp); dev_free_name(fnp); @@ -1235,8 +1229,6 @@ } */ { DBPRINT(("abortop\n")); - if ((ap->a_cnp->cn_flags & (HASBUF | SAVESTART)) == HASBUF) - zfree(namei_zone, ap->a_cnp->cn_pnbuf); return 0; } #endif /* notyet */ Index: miscfs/fifofs/fifo_vnops.c =================================================================== RCS file: /home/ncvs/src/sys/miscfs/fifofs/fifo_vnops.c,v retrieving revision 1.44 diff -u -r1.44 fifo_vnops.c --- fifo_vnops.c 1999/08/28 00:46:47 1.44 +++ fifo_vnops.c 1999/11/13 23:48:14 @@ -79,7 +79,6 @@ vop_t **fifo_vnodeop_p; static struct vnodeopv_entry_desc fifo_vnodeop_entries[] = { { &vop_default_desc, (vop_t *) vop_defaultop }, - { &vop_abortop_desc, (vop_t *) fifo_badop }, { &vop_access_desc, (vop_t *) vop_ebadf }, { &vop_advlock_desc, (vop_t *) fifo_advlock }, { &vop_bmap_desc, (vop_t *) fifo_bmap }, Index: miscfs/procfs/procfs_vnops.c =================================================================== RCS file: /home/ncvs/src/sys/miscfs/procfs/procfs_vnops.c,v retrieving revision 1.73 diff -u -r1.73 procfs_vnops.c --- procfs_vnops.c 1999/11/07 07:52:02 1.73 +++ procfs_vnops.c 1999/11/13 23:51:45 @@ -59,7 +59,6 @@ #include #include -static int procfs_abortop __P((struct vop_abortop_args *)); static int procfs_access __P((struct vop_access_args *)); static int procfs_badop __P((void)); static int procfs_bmap __P((struct vop_bmap_args *)); @@ -390,25 +389,6 @@ } /* - * _abortop is called when operations such as - * rename and create fail. this entry is responsible - * for undoing any side-effects caused by the lookup. - * this will always include freeing the pathname buffer. - */ -static int -procfs_abortop(ap) - struct vop_abortop_args /* { - struct vnode *a_dvp; - struct componentname *a_cnp; - } */ *ap; -{ - - if ((ap->a_cnp->cn_flags & (HASBUF | SAVESTART)) == HASBUF) - zfree(namei_zone, ap->a_cnp->cn_pnbuf); - return (0); -} - -/* * generic entry point for unsupported operations */ static int @@ -995,7 +975,6 @@ vop_t **procfs_vnodeop_p; static struct vnodeopv_entry_desc procfs_vnodeop_entries[] = { { &vop_default_desc, (vop_t *) vop_defaultop }, - { &vop_abortop_desc, (vop_t *) procfs_abortop }, { &vop_access_desc, (vop_t *) procfs_access }, { &vop_advlock_desc, (vop_t *) procfs_badop }, { &vop_bmap_desc, (vop_t *) procfs_bmap }, Index: miscfs/union/union_subr.c =================================================================== RCS file: /home/ncvs/src/sys/miscfs/union/union_subr.c,v retrieving revision 1.42 diff -u -r1.42 union_subr.c --- union_subr.c 1999/10/03 12:18:24 1.42 +++ union_subr.c 1999/11/14 00:28:07 @@ -846,8 +846,6 @@ * by namei, some of the work done by lookup and some of * the work done by VOP_LOOKUP when given a CREATE flag. * Conclusion: Horrible. - * - * The pathname buffer will be FREEed by VOP_MKDIR. */ cn->cn_namelen = pathlen; cn->cn_pnbuf = zalloc(namei_zone); @@ -874,8 +872,6 @@ */ if ((error = relookup(dvp, vpp, cn)) != 0) { - zfree(namei_zone, cn->cn_pnbuf); - cn->cn_pnbuf = NULL; vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY, cnp->cn_proc); return(error); } @@ -921,7 +917,7 @@ return (error); if (*vpp) { - VOP_ABORTOP(dvp, &cn); + VOP_RELEASEND(dvp, &cn); if (dvp == *vpp) vrele(*vpp); else @@ -946,6 +942,7 @@ VOP_LEASE(dvp, p, cn.cn_cred, LEASE_WRITE); error = VOP_MKDIR(dvp, vpp, &cn, &va); + VOP_RELEASEND(dvp, &cn); /*vput(dvp);*/ return (error); } @@ -976,7 +973,7 @@ return (error); if (wvp) { - VOP_ABORTOP(dvp, &cn); + VOP_RELEASEND(dvp, &cn); if (wvp == dvp) vrele(wvp); else @@ -988,8 +985,7 @@ VOP_LEASE(dvp, p, p->p_ucred, LEASE_WRITE); error = VOP_WHITEOUT(dvp, &cn, CREATE); - if (error) - VOP_ABORTOP(dvp, &cn); + VOP_RELEASEND(dvp, &cn); return (error); } @@ -1059,7 +1055,7 @@ */ if (vp) { vput(un->un_dirvp); - VOP_ABORTOP(un->un_dirvp, &cn); + VOP_RELEASEND(un->un_dirvp, &cn); if (vp == un->un_dirvp) vrele(vp); else @@ -1082,6 +1078,7 @@ vap->va_mode = cmode; VOP_LEASE(un->un_dirvp, p, cred, LEASE_WRITE); error = VOP_CREATE(un->un_dirvp, &vp, &cn, vap); + VOP_RELEASEND(un->un_dirvp, &cn); vput(un->un_dirvp); if (error) return (error); Index: miscfs/union/union_vnops.c =================================================================== RCS file: /home/ncvs/src/sys/miscfs/union/union_vnops.c,v retrieving revision 1.68 diff -u -r1.68 union_vnops.c --- union_vnops.c 1999/11/13 20:58:14 1.68 +++ union_vnops.c 1999/11/13 23:56:39 @@ -69,7 +69,6 @@ SYSCTL_INT(_vfs, OID_AUTO, uniondebug, CTLFLAG_RD, &uniondebug, 0, ""); #endif -static int union_abortop __P((struct vop_abortop_args *ap)); static int union_access __P((struct vop_access_args *ap)); static int union_advlock __P((struct vop_advlock_args *ap)); static int union_bmap __P((struct vop_bmap_args *ap)); @@ -704,7 +703,6 @@ int error = EROFS; if ((dvp = union_lock_upper(dun, cnp->cn_proc)) != NULL) { - struct vnode *vp; error = VOP_MKNOD(dvp, ap->a_vpp, cnp, ap->a_vap); union_unlock_upper(dvp, cnp->cn_proc); } @@ -1685,43 +1683,6 @@ } /* - * union_abortop: - * - * dvp is locked on entry and left locked on return - * - */ - -static int -union_abortop(ap) - struct vop_abortop_args /* { - struct vnode *a_dvp; - struct componentname *a_cnp; - } */ *ap; -{ - struct componentname *cnp = ap->a_cnp; - struct proc *p = cnp->cn_proc; - struct union_node *un = VTOUNION(ap->a_dvp); - int islocked = VOP_ISLOCKED(ap->a_dvp); - struct vnode *vp; - int error; - - if (islocked) { - vp = union_lock_other(un, p); - } else { - vp = OTHERVP(ap->a_dvp); - } - KASSERT(vp != NULL, ("union_abortop: backing vnode missing!")); - - ap->a_dvp = vp; - error = VCALL(vp, VOFFSET(vop_abortop), ap); - - if (islocked) - union_unlock_other(vp, p); - - return (error); -} - -/* * union_inactive: * * Called with the vnode locked. We are expected to unlock the vnode. @@ -1977,7 +1938,6 @@ vop_t **union_vnodeop_p; static struct vnodeopv_entry_desc union_vnodeop_entries[] = { { &vop_default_desc, (vop_t *) vop_defaultop }, - { &vop_abortop_desc, (vop_t *) union_abortop }, { &vop_access_desc, (vop_t *) union_access }, { &vop_advlock_desc, (vop_t *) union_advlock }, { &vop_bmap_desc, (vop_t *) union_bmap }, Index: msdosfs/msdosfs_vnops.c =================================================================== RCS file: /home/ncvs/src/sys/msdosfs/msdosfs_vnops.c,v retrieving revision 1.90 diff -u -r1.90 msdosfs_vnops.c --- msdosfs_vnops.c 1999/09/20 23:27:57 1.90 +++ msdosfs_vnops.c 1999/11/13 23:57:07 @@ -93,7 +93,6 @@ static int msdosfs_rmdir __P((struct vop_rmdir_args *)); static int msdosfs_symlink __P((struct vop_symlink_args *)); static int msdosfs_readdir __P((struct vop_readdir_args *)); -static int msdosfs_abortop __P((struct vop_abortop_args *)); static int msdosfs_bmap __P((struct vop_bmap_args *)); static int msdosfs_strategy __P((struct vop_strategy_args *)); static int msdosfs_print __P((struct vop_print_args *)); @@ -185,13 +184,10 @@ error = createde(&ndirent, pdep, &dep, cnp); if (error) goto bad; - if ((cnp->cn_flags & SAVESTART) == 0) - zfree(namei_zone, cnp->cn_pnbuf); *ap->a_vpp = DETOV(dep); return (0); bad: - zfree(namei_zone, cnp->cn_pnbuf); return (error); } @@ -215,7 +211,6 @@ break; default: - zfree(namei_zone, ap->a_cnp->cn_pnbuf); return (EINVAL); } /* NOTREACHED */ @@ -906,7 +901,6 @@ struct componentname *a_cnp; } */ *ap; { - VOP_ABORTOP(ap->a_tdvp, ap->a_cnp); return (EOPNOTSUPP); } @@ -1015,14 +1009,12 @@ (tvp && (fvp->v_mount != tvp->v_mount))) { error = EXDEV; abortit: - VOP_ABORTOP(tdvp, tcnp); if (tdvp == tvp) vrele(tdvp); else vput(tdvp); if (tvp) vput(tvp); - VOP_ABORTOP(fdvp, fcnp); vrele(fdvp); vrele(fvp); return (error); @@ -1428,7 +1420,6 @@ bad: clusterfree(pmp, newcluster, NULL); bad2: - zfree(namei_zone, cnp->cn_pnbuf); return (error); } @@ -1504,8 +1495,6 @@ char *a_target; } */ *ap; { - zfree(namei_zone, ap->a_cnp->cn_pnbuf); - /* VOP_ABORTOP(ap->a_dvp, ap->a_cnp); ??? */ return (EOPNOTSUPP); } @@ -1776,18 +1765,6 @@ return (error); } -static int -msdosfs_abortop(ap) - struct vop_abortop_args /* { - struct vnode *a_dvp; - struct componentname *a_cnp; - } */ *ap; -{ - if ((ap->a_cnp->cn_flags & (HASBUF | SAVESTART)) == HASBUF) - zfree(namei_zone, ap->a_cnp->cn_pnbuf); - return (0); -} - /* * vp - address of vnode file the file * bn - which cluster we are interested in mapping to a filesystem block number. @@ -1950,7 +1927,6 @@ vop_t **msdosfs_vnodeop_p; static struct vnodeopv_entry_desc msdosfs_vnodeop_entries[] = { { &vop_default_desc, (vop_t *) vop_defaultop }, - { &vop_abortop_desc, (vop_t *) msdosfs_abortop }, { &vop_access_desc, (vop_t *) msdosfs_access }, { &vop_bmap_desc, (vop_t *) msdosfs_bmap }, { &vop_cachedlookup_desc, (vop_t *) msdosfs_lookup }, Index: nfs/nfs_node.c =================================================================== RCS file: /home/ncvs/src/sys/nfs/nfs_node.c,v retrieving revision 1.32 diff -u -r1.32 nfs_node.c --- nfs_node.c 1999/08/28 00:49:57 1.32 +++ nfs_node.c 1999/11/13 22:35:53 @@ -398,8 +398,5 @@ struct componentname *a_cnp; } */ *ap; { - - if ((ap->a_cnp->cn_flags & (HASBUF | SAVESTART)) == HASBUF) - zfree(namei_zone, ap->a_cnp->cn_pnbuf); return (0); } Index: nfs/nfs_serv.c =================================================================== RCS file: /home/ncvs/src/sys/nfs/nfs_serv.c,v retrieving revision 1.88 diff -u -r1.88 nfs_serv.c --- nfs_serv.c 1999/11/13 20:58:15 1.88 +++ nfs_serv.c 1999/11/13 22:46:39 @@ -61,13 +61,6 @@ * and note that nfsm_*() macros can terminate a procedure on certain * errors. * - * VOP_ABORTOP() only frees the path component if HASBUF is set and - * SAVESTART is *not* set. - * - * Various VOP_*() routines tend to free the path component if an - * error occurs. If no error occurs, the VOP_*() routines only free - * the path component if SAVESTART is NOT set. - * * lookup() and namei() * may return garbage in various structural fields/return elements * if an error is returned, and may garbage up nd.ni_dvp even if no @@ -592,6 +585,10 @@ */ vrele(ndp->ni_startdir); ndp->ni_startdir = NULL; + /* XXX We have no vnode that we are certain we can call + VOP_RELEASEND on here. nd.ni_vp could potentially be a + different filesystem from what nd.ni_dvp would have + been. I think. */ zfree(namei_zone, nd.ni_cnd.cn_pnbuf); nd.ni_cnd.cn_flags &= ~HASBUF; @@ -626,6 +623,7 @@ nfsmout: if (dirp) vrele(dirp); + /* XXX We do not have any dvp for VOP_RELEASEND() (see above) */ if (nd.ni_cnd.cn_flags & HASBUF) zfree(namei_zone, nd.ni_cnd.cn_pnbuf); if (ndp->ni_startdir) @@ -1661,6 +1659,7 @@ nqsrv_getl(nd.ni_dvp, ND_WRITE); error = VOP_CREATE(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, vap); if (error) { + VOP_RELEASEND(nd.ni_dvp, &nd.ni_cnd); nd.ni_cnd.cn_flags &= ~HASBUF; } else { nfsrv_object_create(nd.ni_vp); @@ -1693,6 +1692,7 @@ error = VOP_MKNOD(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, vap); if (error) { + VOP_RELEASEND(nd.ni_dvp, &nd.ni_cnd); nd.ni_cnd.cn_flags &= ~HASBUF; goto nfsmreply0; } @@ -1789,13 +1789,8 @@ if (dirp) vrele(dirp); if (nd.ni_cnd.cn_flags & HASBUF) { - /* - * Since SAVESTART is set, we own the buffer and need to - * zfree it ourselves. - */ - if (nd.ni_dvp) - VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd); - zfree(namei_zone, nd.ni_cnd.cn_pnbuf); + KASSERT(nd.ni_dvp, ("Missing dvp (XXX Can this happen?")); + VOP_RELEASEND(nd.ni_dvp, &nd.ni_cnd); } if (nd.ni_dvp) { if (nd.ni_dvp == nd.ni_vp) @@ -1893,8 +1888,10 @@ nd.ni_startdir = NULL; nqsrv_getl(nd.ni_dvp, ND_WRITE); error = VOP_CREATE(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, vap); - if (error) + if (error) { + VOP_RELEASEND(nd.ni_dvp, &nd.ni_cnd); nd.ni_cnd.cn_flags &= ~HASBUF; + } } else { if (vtyp != VFIFO && (error = suser_xxx(cred, 0, 0))) goto out; @@ -1902,6 +1899,7 @@ error = VOP_MKNOD(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, vap); if (error) { + VOP_RELEASEND(nd.ni_dvp, &nd.ni_cnd); nd.ni_cnd.cn_flags &= ~HASBUF; goto out; } @@ -1937,14 +1935,8 @@ nd.ni_startdir = NULL; } if (nd.ni_cnd.cn_flags & HASBUF) { - /* - * Since SAVESTART is set, we own the buffer and need to - * zfree it ourselves. - */ - if (nd.ni_dvp) - VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd); + VOP_RELEASEND(nd.ni_dvp, &nd.ni_cnd); nd.ni_cnd.cn_flags &= ~HASBUF; - zfree(namei_zone, nd.ni_cnd.cn_pnbuf); } if (nd.ni_dvp) { if (nd.ni_dvp == nd.ni_vp) @@ -1981,15 +1973,8 @@ vrele(dirp); if (nd.ni_startdir) vrele(nd.ni_startdir); - if (nd.ni_cnd.cn_flags & HASBUF) { - /* - * Since SAVESTART is set, we own the buffer and need to - * zfree it ourselves. - */ - if (nd.ni_dvp) - VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd); - zfree(namei_zone, nd.ni_cnd.cn_pnbuf); - } + if (nd.ni_cnd.cn_flags & HASBUF) + VOP_RELEASEND(nd.ni_dvp, &nd.ni_cnd); if (nd.ni_dvp) { if (nd.ni_dvp == nd.ni_vp) vrele(nd.ni_dvp); @@ -2067,6 +2052,7 @@ nqsrv_getl(nd.ni_dvp, ND_WRITE); nqsrv_getl(nd.ni_vp, ND_WRITE); error = VOP_REMOVE(nd.ni_dvp, nd.ni_vp, &nd.ni_cnd); + VOP_RELEASEND(nd.ni_dvp, &nd.ni_cnd); nd.ni_cnd.cn_flags &= ~HASBUF; } } @@ -2082,12 +2068,7 @@ } nfsmout: if (nd.ni_cnd.cn_flags & HASBUF) { - /* - * Since SAVESTART is not set, this is sufficient to free - * the component buffer. It's actually a NOP since we - * do not save the name, but what the hey. - */ - VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd); + VOP_RELEASEND(nd.ni_dvp, &nd.ni_cnd); } if (nd.ni_dvp) { if (nd.ni_dvp == nd.ni_vp) @@ -2302,15 +2283,8 @@ vrele(tdirp); if (tond.ni_startdir) vrele(tond.ni_startdir); - if (tond.ni_cnd.cn_flags & HASBUF) { - /* - * The VOP_ABORTOP is probably a NOP. Since we have set - * SAVESTART, we need to zfree the buffer ourselves. - */ - if (tond.ni_dvp) - VOP_ABORTOP(tond.ni_dvp, &tond.ni_cnd); - zfree(namei_zone, tond.ni_cnd.cn_pnbuf); - } + if (tond.ni_cnd.cn_flags & HASBUF) + VOP_RELEASEND(tond.ni_dvp, &tond.ni_cnd); if (tond.ni_dvp) { if (tond.ni_dvp == tond.ni_vp) vrele(tond.ni_dvp); @@ -2327,11 +2301,8 @@ vrele(fdirp); if (fromnd.ni_startdir) vrele(fromnd.ni_startdir); - if (fromnd.ni_cnd.cn_flags & HASBUF) { - if (fromnd.ni_dvp) - VOP_ABORTOP(fromnd.ni_dvp, &fromnd.ni_cnd); - zfree(namei_zone, fromnd.ni_cnd.cn_pnbuf); - } + if (fromnd.ni_cnd.cn_flags & HASBUF) + VOP_RELEASEND(fromnd.ni_dvp, &fromnd.ni_cnd); if (fromnd.ni_dvp) vrele(fromnd.ni_dvp); if (fromnd.ni_vp) @@ -2418,14 +2389,10 @@ error = EXDEV; out: if (!error) { - /* - * Do the link op. Since SAVESTART is not set, the - * underlying path component is freed whether an error - * is returned or not. - */ nqsrv_getl(vp, ND_WRITE); nqsrv_getl(xp, ND_WRITE); error = VOP_LINK(nd.ni_dvp, vp, &nd.ni_cnd); + VOP_RELEASEND(nd.ni_dvp, &nd.ni_cnd); nd.ni_cnd.cn_flags &= ~HASBUF; } /* fall through */ @@ -2444,14 +2411,8 @@ /* fall through */ nfsmout: - if (nd.ni_cnd.cn_flags & HASBUF) { - /* - * Since we are not using SAVESTART, - * VOP_ABORTOP is sufficient to free the path component - */ - VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd); - /* zfree(namei_zone, nd.ni_cnd.cn_pnbuf); */ - } + if (nd.ni_cnd.cn_flags & HASBUF) + VOP_RELEASEND(nd.ni_dvp, &nd.ni_cnd); if (dirp) vrele(dirp); if (vp) @@ -2552,9 +2513,10 @@ */ nqsrv_getl(nd.ni_dvp, ND_WRITE); error = VOP_SYMLINK(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, vap, pathcp); - if (error) + if (error) { + VOP_RELEASEND(nd.ni_dvp, &nd.ni_cnd); nd.ni_cnd.cn_flags &= ~HASBUF; - else { + } else { vput(nd.ni_vp); nd.ni_vp = NULL; } @@ -2624,15 +2586,8 @@ /* fall through */ nfsmout: - if (nd.ni_cnd.cn_flags & HASBUF) { - /* - * Since SAVESTART is set, we own the buffer and need to - * zfree it ourselves. - */ - if (nd.ni_dvp) - VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd); - zfree(namei_zone, nd.ni_cnd.cn_pnbuf); - } + if (nd.ni_cnd.cn_flags & HASBUF) + VOP_RELEASEND(nd.ni_dvp, &nd.ni_cnd); if (nd.ni_dvp) { if (nd.ni_dvp == nd.ni_vp) vrele(nd.ni_dvp); @@ -2725,11 +2680,7 @@ vap->va_type = VDIR; if (nd.ni_vp != NULL) { - /* - * Freeup path component. Since SAVESTART was not set, - * VOP_ABORTOP() will handle it. - */ - VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd); + VOP_RELEASEND(nd.ni_dvp, &nd.ni_cnd); nd.ni_cnd.cn_flags &= ~HASBUF; error = EEXIST; goto out; @@ -2742,6 +2693,7 @@ */ nqsrv_getl(nd.ni_dvp, ND_WRITE); error = VOP_MKDIR(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, vap); + VOP_RELEASEND(nd.ni_dvp, &nd.ni_cnd); nd.ni_cnd.cn_flags &= ~HASBUF; vpexcl = 1; @@ -2777,12 +2729,8 @@ if (dirp) vrele(dirp); if (nd.ni_dvp) { - /* - * Since SAVESTART is not set, VOP_ABORTOP will always free - * the path component. - */ if (nd.ni_cnd.cn_flags & HASBUF) - VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd); + VOP_RELEASEND(nd.ni_dvp, &nd.ni_cnd); if (nd.ni_dvp == nd.ni_vp && vpexcl) vrele(nd.ni_dvp); else @@ -2877,9 +2825,8 @@ nqsrv_getl(nd.ni_dvp, ND_WRITE); nqsrv_getl(vp, ND_WRITE); error = VOP_RMDIR(nd.ni_dvp, nd.ni_vp, &nd.ni_cnd); - } else { - VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd); } + VOP_RELEASEND(nd.ni_dvp, &nd.ni_cnd); nd.ni_cnd.cn_flags &= ~HASBUF; if (dirp) @@ -2892,12 +2839,8 @@ /* fall through */ nfsmout: - /* - * Since SAVESTART is not set, a VOP_ABORTOP is sufficient to - * deal with the pathname component. - */ if (nd.ni_cnd.cn_flags & HASBUF) - VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd); + VOP_RELEASEND(nd.ni_dvp, &nd.ni_cnd); if (dirp) vrele(dirp); if (nd.ni_dvp) { Index: nfs/nfs_vnops.c =================================================================== RCS file: /home/ncvs/src/sys/nfs/nfs_vnops.c,v retrieving revision 1.144 diff -u -r1.144 nfs_vnops.c --- nfs_vnops.c 1999/11/13 20:58:16 1.144 +++ nfs_vnops.c 1999/11/13 23:59:14 @@ -138,7 +138,6 @@ vop_t **nfsv2_vnodeop_p; static struct vnodeopv_entry_desc nfsv2_vnodeop_entries[] = { { &vop_default_desc, (vop_t *) vop_defaultop }, - { &vop_abortop_desc, (vop_t *) nfs_abortop }, { &vop_access_desc, (vop_t *) nfs_access }, { &vop_advlock_desc, (vop_t *) nfs_advlock }, { &vop_bmap_desc, (vop_t *) nfs_bmap }, @@ -1249,11 +1248,9 @@ else if (vap->va_type == VFIFO || vap->va_type == VSOCK) rdev = nfs_xdrneg1; else { - VOP_ABORTOP(dvp, cnp); return (EOPNOTSUPP); } if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred, cnp->cn_proc)) != 0) { - VOP_ABORTOP(dvp, cnp); return (error); } nfsstats.rpccnt[NFSPROC_MKNOD]++; @@ -1304,7 +1301,6 @@ cache_enter(dvp, newvp, cnp); *vpp = newvp; } - zfree(namei_zone, cnp->cn_pnbuf); VTONFS(dvp)->n_flag |= NMODIFIED; if (!wccflag) VTONFS(dvp)->n_attrstamp = 0; @@ -1369,7 +1365,6 @@ return (nfs_mknodrpc(dvp, ap->a_vpp, cnp, vap)); if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred, cnp->cn_proc)) != 0) { - VOP_ABORTOP(dvp, cnp); return (error); } if (vap->va_vaflags & VA_EXCLUSIVE) @@ -1436,8 +1431,6 @@ cache_enter(dvp, newvp, cnp); *ap->a_vpp = newvp; } - if (error || (cnp->cn_flags & SAVESTART) == 0) - zfree(namei_zone, cnp->cn_pnbuf); VTONFS(dvp)->n_flag |= NMODIFIED; if (!wccflag) VTONFS(dvp)->n_attrstamp = 0; @@ -1509,7 +1502,6 @@ error = 0; } else if (!np->n_sillyrename) error = nfs_sillyrename(dvp, vp, cnp); - zfree(namei_zone, cnp->cn_pnbuf); np->n_attrstamp = 0; return (error); } @@ -1629,14 +1621,12 @@ } out: - VOP_ABORTOP(tdvp, tcnp); if (tdvp == tvp) vrele(tdvp); else vput(tdvp); if (tvp) vput(tvp); - VOP_ABORTOP(fdvp, fcnp); vrele(fdvp); vrele(fvp); /* @@ -1728,7 +1718,6 @@ int v3; if (vp->v_mount != tdvp->v_mount) { - VOP_ABORTOP(tdvp, cnp); return (EXDEV); } @@ -1752,7 +1741,6 @@ nfsm_wcc_data(tdvp, wccflag); } nfsm_reqdone; - zfree(namei_zone, cnp->cn_pnbuf); VTONFS(tdvp)->n_flag |= NMODIFIED; if (!attrflag) VTONFS(vp)->n_attrstamp = 0; @@ -1830,12 +1818,6 @@ */ if (error == EEXIST) error = 0; - /* - * cnp's buffer expected to be freed if SAVESTART not set or - * if an error was returned. - */ - if (error || (cnp->cn_flags & SAVESTART) == 0) - zfree(namei_zone, cnp->cn_pnbuf); return (error); } @@ -1869,7 +1851,6 @@ int v3 = NFS_ISV3(dvp); if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred, cnp->cn_proc)) != 0) { - VOP_ABORTOP(dvp, cnp); return (error); } len = cnp->cn_namelen; @@ -1920,8 +1901,6 @@ vrele(newvp); } else *ap->a_vpp = newvp; - if (error || (cnp->cn_flags & SAVESTART) == 0) - zfree(namei_zone, cnp->cn_pnbuf); return (error); } @@ -1958,7 +1937,6 @@ if (v3) nfsm_wcc_data(dvp, wccflag); nfsm_reqdone; - zfree(namei_zone, cnp->cn_pnbuf); VTONFS(dvp)->n_flag |= NMODIFIED; if (!wccflag) VTONFS(dvp)->n_attrstamp = 0; Index: nfs/nfsnode.h =================================================================== RCS file: /home/ncvs/src/sys/nfs/nfsnode.h,v retrieving revision 1.29 diff -u -r1.29 nfsnode.h --- nfsnode.h 1999/08/28 00:50:03 1.29 +++ nfsnode.h 1999/11/13 23:57:55 @@ -168,7 +168,6 @@ int nfs_putpages __P((struct vop_putpages_args *)); int nfs_write __P((struct vop_write_args *)); int nqnfs_vop_lease_check __P((struct vop_lease_args *)); -int nfs_abortop __P((struct vop_abortop_args *)); int nfs_inactive __P((struct vop_inactive_args *)); int nfs_reclaim __P((struct vop_reclaim_args *)); Index: nwfs/nwfs_vnops.c =================================================================== RCS file: /home/ncvs/src/sys/nwfs/nwfs_vnops.c,v retrieving revision 1.3 diff -u -r1.3 nwfs_vnops.c --- nwfs_vnops.c 1999/10/14 09:35:37 1.3 +++ nwfs_vnops.c 1999/11/14 00:03:57 @@ -77,7 +77,6 @@ static int nwfs_rmdir __P((struct vop_rmdir_args *)); static int nwfs_symlink __P((struct vop_symlink_args *)); static int nwfs_readdir __P((struct vop_readdir_args *)); -static int nwfs_abortop __P((struct vop_abortop_args *)); static int nwfs_bmap __P((struct vop_bmap_args *)); static int nwfs_strategy __P((struct vop_strategy_args *)); static int nwfs_print __P((struct vop_print_args *)); @@ -87,7 +86,6 @@ vop_t **nwfs_vnodeop_p; static struct vnodeopv_entry_desc nwfs_vnodeop_entries[] = { { &vop_default_desc, (vop_t *) vop_defaultop }, - { &vop_abortop_desc, (vop_t *) nwfs_abortop }, { &vop_access_desc, (vop_t *) nwfs_access }, { &vop_bmap_desc, (vop_t *) nwfs_bmap }, { &vop_open_desc, (vop_t *) nwfs_open }, @@ -447,7 +445,6 @@ if (vap->va_type == VSOCK) return (EOPNOTSUPP); if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred, cnp->cn_proc))) { - VOP_ABORTOP(dvp, cnp); return (error); } fmode = AR_READ | AR_WRITE; @@ -470,7 +467,6 @@ if (cnp->cn_flags & MAKEENTRY) cache_enter(dvp, vp, cnp); } - zfree(namei_zone, cnp->cn_pnbuf); return (error); } @@ -504,7 +500,6 @@ cnp->cn_namelen,cnp->cn_nameptr,cnp->cn_proc,cnp->cn_cred); if (error == 0x899c) error = EACCES; } - zfree(namei_zone, cnp->cn_pnbuf); return (error); } @@ -598,9 +593,7 @@ /* * nwfs hard link create call - * Netware filesystems don't know what links are. But since we already called - * nwfs_lookup() with create and lockparent, the parent is locked so we - * have to free it before we return the error. + * Netware filesystems don't know what links are. */ static int nwfs_link(ap) @@ -610,8 +603,6 @@ struct componentname *a_cnp; } */ *ap; { -/* VOP_ABORTOP(ap->a_tdvp, ap->a_cnp);*/ - zfree(namei_zone, ap->a_cnp->cn_pnbuf); return EOPNOTSUPP; } @@ -629,8 +620,6 @@ char *a_target; } */ *ap; { - zfree(namei_zone, ap->a_cnp->cn_pnbuf); - /* VOP_ABORTOP(ap->a_dvp, ap->a_cnp); ??? */ return (EOPNOTSUPP); } @@ -666,11 +655,9 @@ char *name=cnp->cn_nameptr; if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred, cnp->cn_proc))) { - VOP_ABORTOP(dvp, cnp); return (error); } if ((name[0] == '.') && ((len == 1) || ((len == 2) && (name[1] == '.')))) { - VOP_ABORTOP(dvp, cnp); return EEXIST; } if (ncp_open_create_file_or_subdir(VTONWFS(dvp),dvp, cnp->cn_namelen, @@ -690,7 +677,6 @@ *ap->a_vpp = newvp; } } - zfree(namei_zone, cnp->cn_pnbuf); return (error); } @@ -718,7 +704,6 @@ error = ncp_DeleteNSEntry(nmp, dnp->n_fid.f_id, cnp->cn_namelen, cnp->cn_nameptr,cnp->cn_proc,cnp->cn_cred); if (error == NWE_DIR_NOT_EMPTY) error = ENOTEMPTY; - zfree(namei_zone, cnp->cn_pnbuf); dnp->n_flag |= NMODIFIED; nwfs_attr_cacheremove(dvp); cache_purge(dvp); @@ -856,23 +841,6 @@ *ap->a_runp = 0; if (ap->a_runb != NULL) *ap->a_runb = 0; - return (0); -} -/* - * nwfs abort op, called after namei() when a CREATE/DELETE isn't actually - * done. Currently nothing to do. - */ -/* ARGSUSED */ -int -nwfs_abortop(ap) - struct vop_abortop_args /* { - struct vnode *a_dvp; - struct componentname *a_cnp; - } */ *ap; -{ - - if ((ap->a_cnp->cn_flags & (HASBUF | SAVESTART)) == HASBUF) - zfree(namei_zone, ap->a_cnp->cn_pnbuf); return (0); } Index: ufs/ufs/ufs_vnops.c =================================================================== RCS file: /home/ncvs/src/sys/ufs/ufs/ufs_vnops.c,v retrieving revision 1.127 diff -u -r1.127 ufs_vnops.c --- ufs_vnops.c 1999/11/13 20:58:17 1.127 +++ ufs_vnops.c 1999/11/14 00:06:28 @@ -71,7 +71,6 @@ #include #include -static int ufs_abortop __P((struct vop_abortop_args *)); static int ufs_access __P((struct vop_access_args *)); static int ufs_advlock __P((struct vop_advlock_args *)); static int ufs_chmod __P((struct vnode *, int, struct ucred *, struct proc *)); @@ -736,22 +735,18 @@ panic("ufs_link: no name"); #endif if (tdvp->v_mount != vp->v_mount) { - VOP_ABORTOP(tdvp, cnp); error = EXDEV; goto out2; } if (tdvp != vp && (error = vn_lock(vp, LK_EXCLUSIVE, p))) { - VOP_ABORTOP(tdvp, cnp); goto out2; } ip = VTOI(vp); if ((nlink_t)ip->i_nlink >= LINK_MAX) { - VOP_ABORTOP(tdvp, cnp); error = EMLINK; goto out1; } if (ip->i_flags & (IMMUTABLE | APPEND)) { - VOP_ABORTOP(tdvp, cnp); error = EPERM; goto out1; } @@ -771,7 +766,6 @@ ip->i_nlink--; ip->i_flag |= IN_CHANGE; } - zfree(namei_zone, cnp->cn_pnbuf); out1: if (tdvp != vp) VOP_UNLOCK(vp, 0, p); @@ -833,10 +827,6 @@ default: panic("ufs_whiteout: unknown op"); } - if (cnp->cn_flags & HASBUF) { - zfree(namei_zone, cnp->cn_pnbuf); - cnp->cn_flags &= ~HASBUF; - } return (error); } @@ -899,14 +889,12 @@ (tvp && (fvp->v_mount != tvp->v_mount))) { error = EXDEV; abortit: - VOP_ABORTOP(tdvp, tcnp); if (tdvp == tvp) vrele(tdvp); else vput(tdvp); if (tvp) vput(tvp); - VOP_ABORTOP(fdvp, fcnp); vrele(fdvp); vrele(fvp); return (error); @@ -940,7 +928,6 @@ } /* Release destination completely. */ - VOP_ABORTOP(tdvp, tcnp); vput(tdvp); vput(tvp); @@ -1349,7 +1336,6 @@ #ifdef QUOTA if ((error = getinoquota(ip)) || (error = chkiq(ip, 1, ucp, 0))) { - zfree(namei_zone, cnp->cn_pnbuf); UFS_VFREE(tvp, ip->i_number, dmode); vput(tvp); return (error); @@ -1361,7 +1347,6 @@ #ifdef QUOTA if ((error = getinoquota(ip)) || (error = chkiq(ip, 1, cnp->cn_cred, 0))) { - zfree(namei_zone, cnp->cn_pnbuf); UFS_VFREE(tvp, ip->i_number, dmode); vput(tvp); return (error); @@ -1465,7 +1450,6 @@ vput(tvp); } out: - zfree(namei_zone, cnp->cn_pnbuf); return (error); } @@ -1733,23 +1717,6 @@ } /* - * Ufs abort op, called after namei() when a CREATE/DELETE isn't actually - * done. If a buffer has been saved in anticipation of a CREATE, delete it. - */ -/* ARGSUSED */ -int -ufs_abortop(ap) - struct vop_abortop_args /* { - struct vnode *a_dvp; - struct componentname *a_cnp; - } */ *ap; -{ - if ((ap->a_cnp->cn_flags & (HASBUF | SAVESTART)) == HASBUF) - zfree(namei_zone, ap->a_cnp->cn_pnbuf); - return (0); -} - -/* * Calculate the logical to physical mapping if not done already, * then call the device strategy routine. * @@ -2210,7 +2177,6 @@ { &vop_read_desc, (vop_t *) ufs_missingop }, { &vop_reallocblks_desc, (vop_t *) ufs_missingop }, { &vop_write_desc, (vop_t *) ufs_missingop }, - { &vop_abortop_desc, (vop_t *) ufs_abortop }, { &vop_access_desc, (vop_t *) ufs_access }, { &vop_advlock_desc, (vop_t *) ufs_advlock }, { &vop_bmap_desc, (vop_t *) ufs_bmap },