summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/cd9660/cd9660_vfsops.c3
-rw-r--r--sys/fs/cd9660/cd9660_vnops.c18
-rw-r--r--sys/fs/coda/coda_vfsops.c5
-rw-r--r--sys/fs/coda/coda_vnops.c54
-rw-r--r--sys/fs/fifofs/fifo_vnops.c1
-rw-r--r--sys/fs/hpfs/hpfs_vnops.c19
-rw-r--r--sys/fs/msdosfs/msdosfs_vfsops.c2
-rw-r--r--sys/fs/msdosfs/msdosfs_vnops.c26
-rw-r--r--sys/fs/ntfs/ntfs_vfsops.c3
-rw-r--r--sys/fs/nullfs/null_vfsops.c2
-rw-r--r--sys/fs/nwfs/nwfs_vnops.c34
-rw-r--r--sys/fs/procfs/procfs_vnops.c21
-rw-r--r--sys/fs/umapfs/umap_vfsops.c2
-rw-r--r--sys/fs/unionfs/union_subr.c33
-rw-r--r--sys/fs/unionfs/union_vfsops.c2
-rw-r--r--sys/fs/unionfs/union_vnops.c39
16 files changed, 45 insertions, 219 deletions
diff --git a/sys/fs/cd9660/cd9660_vfsops.c b/sys/fs/cd9660/cd9660_vfsops.c
index 8702879..3ecdb06 100644
--- a/sys/fs/cd9660/cd9660_vfsops.c
+++ b/sys/fs/cd9660/cd9660_vfsops.c
@@ -54,6 +54,8 @@
#include <sys/stat.h>
#include <sys/syslog.h>
+#include <vm/vm_zone.h>
+
#include <isofs/cd9660/iso.h>
#include <isofs/cd9660/iso_rrip.h>
#include <isofs/cd9660/cd9660_node.h>
@@ -209,6 +211,7 @@ cd9660_mount(mp, path, data, ndp, p)
NDINIT(ndp, LOOKUP, FOLLOW, UIO_USERSPACE, args.fspec, p);
if ((error = namei(ndp)))
return (error);
+ NDFREE(ndp, NDF_ONLY_PNBUF);
devvp = ndp->ni_vp;
if (!vn_isdisk(devvp)) {
diff --git a/sys/fs/cd9660/cd9660_vnops.c b/sys/fs/cd9660/cd9660_vnops.c
index 2f93731..65ad938 100644
--- a/sys/fs/cd9660/cd9660_vnops.c
+++ b/sys/fs/cd9660/cd9660_vnops.c
@@ -73,7 +73,6 @@ static int iso_uiodir __P((struct isoreaddir *idp, struct dirent *dp,
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 *));
@@ -737,22 +736,6 @@ cd9660_readlink(ap)
}
/*
- * 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.
*/
@@ -880,7 +863,6 @@ cd9660_putpages(ap)
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 },
diff --git a/sys/fs/coda/coda_vfsops.c b/sys/fs/coda/coda_vfsops.c
index 615289c..04cf95b 100644
--- a/sys/fs/coda/coda_vfsops.c
+++ b/sys/fs/coda/coda_vfsops.c
@@ -56,6 +56,8 @@
#include <sys/mount.h>
#include <sys/select.h>
+#include <vm/vm_zone.h>
+
#include <coda/coda.h>
#include <coda/cnode.h>
#include <coda/coda_vfsops.h>
@@ -134,7 +136,6 @@ coda_mount(vfsp, path, data, ndp, p)
}
/* Validate mount device. Similar to getmdev(). */
-
NDINIT(ndp, LOOKUP, FOLLOW, UIO_USERSPACE, data, p);
error = namei(ndp);
dvp = ndp->ni_vp;
@@ -146,10 +147,12 @@ coda_mount(vfsp, path, data, ndp, p)
if (dvp->v_type != VCHR) {
MARK_INT_FAIL(CODA_MOUNT_STATS);
vrele(dvp);
+ NDFREE(ndp, NDF_ONLY_PNBUF);
return(ENXIO);
}
dev = dvp->v_rdev;
vrele(dvp);
+ NDFREE(ndp, NDF_ONLY_PNBUF);
/*
* See if the device table matches our expectations.
diff --git a/sys/fs/coda/coda_vnops.c b/sys/fs/coda/coda_vnops.c
index 1ef09bc..761ebcc 100644
--- a/sys/fs/coda/coda_vnops.c
+++ b/sys/fs/coda/coda_vnops.c
@@ -131,7 +131,6 @@ struct vnodeopv_entry_desc coda_vnodeop_entries[] = {
{ &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 */
@@ -563,6 +562,7 @@ coda_ioctl(v)
*/
if (tvp->v_op != coda_vnodeop_p) {
vrele(tvp);
+ NDFREE(&ndp, NDF_ONLY_PNBUF);
MARK_INT_FAIL(CODA_IOCTL_STATS);
CODADEBUG(CODA_IOCTL,
myprintf(("coda_ioctl error: %s not a coda object\n",
@@ -571,7 +571,7 @@ coda_ioctl(v)
}
if (iap->vi.in_size > VC_MAXDATASIZE) {
- vrele(tvp);
+ NDFREE(&ndp, 0);
return(EINVAL);
}
error = venus_ioctl(vtomi(tvp), &((VTOC(tvp))->c_fid), com, flag, data, cred, p);
@@ -582,6 +582,7 @@ coda_ioctl(v)
CODADEBUG(CODA_IOCTL, myprintf(("Ioctl returns %d \n", error)); )
vrele(tvp);
+ NDFREE(&ndp, NDF_ONLY_PNBUF);
return(error);
}
@@ -745,29 +746,6 @@ coda_access(v)
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 +1186,6 @@ coda_create(v)
}
#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 +1246,6 @@ coda_remove(v)
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 +1299,6 @@ coda_link(v)
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 +1465,6 @@ coda_mkdir(v)
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 +1514,6 @@ coda_rmdir(v)
CODADEBUG(CODA_RMDIR, myprintf(("in rmdir result %d\n", error)); )
- if ((cnp->cn_flags & SAVESTART) == 0) {
- zfree(namei_zone, cnp->cn_pnbuf);
- }
return(error);
}
diff --git a/sys/fs/fifofs/fifo_vnops.c b/sys/fs/fifofs/fifo_vnops.c
index 4a8199a..b64f957 100644
--- a/sys/fs/fifofs/fifo_vnops.c
+++ b/sys/fs/fifofs/fifo_vnops.c
@@ -79,7 +79,6 @@ static int fifo_advlock __P((struct vop_advlock_args *));
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 },
diff --git a/sys/fs/hpfs/hpfs_vnops.c b/sys/fs/hpfs/hpfs_vnops.c
index acc2949..e8cb76a 100644
--- a/sys/fs/hpfs/hpfs_vnops.c
+++ b/sys/fs/hpfs/hpfs_vnops.c
@@ -1318,28 +1318,9 @@ hpfs_create(ap)
error = hpfs_makefnode (ap->a_dvp, ap->a_vpp, ap->a_cnp, ap->a_vap);
- if ((ap->a_cnp->cn_flags & (HASBUF | SAVESTART)) == HASBUF)
- zfree(namei_zone, ap->a_cnp->cn_pnbuf);
-
return (error);
}
-static int
-hpfs_abortop(ap)
- struct vop_abortop_args /* {
- struct vnode *a_dvp;
- struct componentname *a_cnp;
- } */ *ap;
-{
- dprintf(("hpfs_abortop(0x%x, %s, %ld): \n", VTOHP(ap->a_dvp)->h_no,
- ap->a_cnp->cn_nameptr, ap->a_cnp->cn_namelen));
-
- if ((ap->a_cnp->cn_flags & (HASBUF | SAVESTART)) == HASBUF)
- zfree(namei_zone, ap->a_cnp->cn_pnbuf);
-
- return (0);
-}
-
/*
* Return POSIX pathconf information applicable to NTFS filesystem
*/
diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c
index 5005de3..3fd65ec 100644
--- a/sys/fs/msdosfs/msdosfs_vfsops.c
+++ b/sys/fs/msdosfs/msdosfs_vfsops.c
@@ -60,6 +60,7 @@
#include <sys/fcntl.h>
#include <sys/malloc.h>
#include <sys/stat.h> /* defines ALLPERMS */
+#include <vm/vm_zone.h>
#include <msdosfs/bpb.h>
#include <msdosfs/bootsect.h>
@@ -288,6 +289,7 @@ msdosfs_mount(mp, path, data, ndp, p)
if (error)
return (error);
devvp = ndp->ni_vp;
+ NDFREE(ndp, NDF_ONLY_PNBUF);
if (!vn_isdisk(devvp)) {
vrele(devvp);
diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c
index 05139a7..3ef8e74 100644
--- a/sys/fs/msdosfs/msdosfs_vnops.c
+++ b/sys/fs/msdosfs/msdosfs_vnops.c
@@ -93,7 +93,6 @@ static int msdosfs_mkdir __P((struct vop_mkdir_args *));
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 @@ msdosfs_create(ap)
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 @@ msdosfs_mknod(ap)
break;
default:
- zfree(namei_zone, ap->a_cnp->cn_pnbuf);
return (EINVAL);
}
/* NOTREACHED */
@@ -906,7 +901,6 @@ msdosfs_link(ap)
struct componentname *a_cnp;
} */ *ap;
{
- VOP_ABORTOP(ap->a_tdvp, ap->a_cnp);
return (EOPNOTSUPP);
}
@@ -1015,14 +1009,12 @@ msdosfs_rename(ap)
(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);
@@ -1420,15 +1412,12 @@ msdosfs_mkdir(ap)
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:
clusterfree(pmp, newcluster, NULL);
bad2:
- zfree(namei_zone, cnp->cn_pnbuf);
return (error);
}
@@ -1504,8 +1493,6 @@ msdosfs_symlink(ap)
char *a_target;
} */ *ap;
{
- zfree(namei_zone, ap->a_cnp->cn_pnbuf);
- /* VOP_ABORTOP(ap->a_dvp, ap->a_cnp); ??? */
return (EOPNOTSUPP);
}
@@ -1776,18 +1763,6 @@ out:
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 +1925,6 @@ msdosfs_putpages(ap)
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 },
diff --git a/sys/fs/ntfs/ntfs_vfsops.c b/sys/fs/ntfs/ntfs_vfsops.c
index 9ad0775..6bc0555 100644
--- a/sys/fs/ntfs/ntfs_vfsops.c
+++ b/sys/fs/ntfs/ntfs_vfsops.c
@@ -53,6 +53,7 @@
#include <vm/vm_page.h>
#include <vm/vm_object.h>
#include <vm/vm_extern.h>
+#include <vm/vm_zone.h>
#if defined(__NetBSD__)
#include <miscfs/specfs/specdev.h>
@@ -316,7 +317,7 @@ ntfs_mount (
/* can't get devvp!*/
goto error_1;
}
-
+ NDFREE(ndp, NDF_ONLY_PNBUF);
devvp = ndp->ni_vp;
#if defined(__FreeBSD__)
diff --git a/sys/fs/nullfs/null_vfsops.c b/sys/fs/nullfs/null_vfsops.c
index e48a516..1bdc083 100644
--- a/sys/fs/nullfs/null_vfsops.c
+++ b/sys/fs/nullfs/null_vfsops.c
@@ -53,6 +53,7 @@
#include <sys/mount.h>
#include <sys/namei.h>
#include <miscfs/nullfs/null.h>
+#include <vm/vm_zone.h>
static MALLOC_DEFINE(M_NULLFSMNT, "NULLFS mount", "NULLFS mount structure");
@@ -137,6 +138,7 @@ nullfs_mount(mp, path, data, ndp, p)
if (error)
return (error);
+ NDFREE(ndp, NDF_ONLY_PNBUF);
/*
* Sanity check on lower vnode
diff --git a/sys/fs/nwfs/nwfs_vnops.c b/sys/fs/nwfs/nwfs_vnops.c
index 29d7a82..22df1b3 100644
--- a/sys/fs/nwfs/nwfs_vnops.c
+++ b/sys/fs/nwfs/nwfs_vnops.c
@@ -77,7 +77,6 @@ static int nwfs_mkdir __P((struct vop_mkdir_args *));
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 @@ static int nwfs_pathconf __P((struct vop_pathconf_args *ap));
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 },
@@ -453,7 +451,6 @@ nwfs_create(ap)
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;
@@ -476,7 +473,6 @@ nwfs_create(ap)
if (cnp->cn_flags & MAKEENTRY)
cache_enter(dvp, vp, cnp);
}
- zfree(namei_zone, cnp->cn_pnbuf);
return (error);
}
@@ -510,7 +506,6 @@ nwfs_remove(ap)
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);
}
@@ -604,9 +599,7 @@ out:
/*
* 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)
@@ -616,8 +609,6 @@ nwfs_link(ap)
struct componentname *a_cnp;
} */ *ap;
{
-/* VOP_ABORTOP(ap->a_tdvp, ap->a_cnp);*/
- zfree(namei_zone, ap->a_cnp->cn_pnbuf);
return EOPNOTSUPP;
}
@@ -635,8 +626,6 @@ nwfs_symlink(ap)
char *a_target;
} */ *ap;
{
- zfree(namei_zone, ap->a_cnp->cn_pnbuf);
- /* VOP_ABORTOP(ap->a_dvp, ap->a_cnp); ??? */
return (EOPNOTSUPP);
}
@@ -672,11 +661,9 @@ nwfs_mkdir(ap)
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,
@@ -696,7 +683,6 @@ nwfs_mkdir(ap)
*ap->a_vpp = newvp;
}
}
- zfree(namei_zone, cnp->cn_pnbuf);
return (error);
}
@@ -724,7 +710,6 @@ nwfs_rmdir(ap)
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);
@@ -864,23 +849,6 @@ nwfs_bmap(ap)
*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);
-}
int
nwfs_nget(struct mount *mp, ncpfid fid, struct nw_entry_info *fap,
diff --git a/sys/fs/procfs/procfs_vnops.c b/sys/fs/procfs/procfs_vnops.c
index 17075db..d7de7ce 100644
--- a/sys/fs/procfs/procfs_vnops.c
+++ b/sys/fs/procfs/procfs_vnops.c
@@ -60,7 +60,6 @@
#include <miscfs/procfs/procfs.h>
#include <sys/pioctl.h>
-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 *));
@@ -391,25 +390,6 @@ procfs_print(ap)
}
/*
- * _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
@@ -997,7 +977,6 @@ atopid(b, len)
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 },
diff --git a/sys/fs/umapfs/umap_vfsops.c b/sys/fs/umapfs/umap_vfsops.c
index afa44f0..48894fe 100644
--- a/sys/fs/umapfs/umap_vfsops.c
+++ b/sys/fs/umapfs/umap_vfsops.c
@@ -52,6 +52,7 @@
#include <sys/namei.h>
#include <sys/malloc.h>
#include <miscfs/umapfs/umap.h>
+#include <vm/vm_zone.h>
static MALLOC_DEFINE(M_UMAPFSMNT, "UMAP mount", "UMAP mount structure");
@@ -129,6 +130,7 @@ umapfs_mount(mp, path, data, ndp, p)
error = namei(ndp);
if (error)
return (error);
+ NDFREE(ndp, NDF_ONLY_PNBUF);
/*
* Sanity check on lower vnode
diff --git a/sys/fs/unionfs/union_subr.c b/sys/fs/unionfs/union_subr.c
index d7caf10..6b88bef 100644
--- a/sys/fs/unionfs/union_subr.c
+++ b/sys/fs/unionfs/union_subr.c
@@ -846,8 +846,6 @@ union_relookup(um, dvp, vpp, cnp, cn, path, pathlen)
* 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 @@ union_relookup(um, dvp, vpp, cnp, cn, path, pathlen)
*/
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,10 @@ union_mkshadow(um, dvp, cnp, vpp)
return (error);
if (*vpp) {
- VOP_ABORTOP(dvp, &cn);
+ if (cn.cn_flags & HASBUF) {
+ zfree(namei_zone, cn.cn_pnbuf);
+ cn.cn_flags &= ~HASBUF;
+ }
if (dvp == *vpp)
vrele(*vpp);
else
@@ -946,6 +945,10 @@ union_mkshadow(um, dvp, cnp, vpp)
VOP_LEASE(dvp, p, cn.cn_cred, LEASE_WRITE);
error = VOP_MKDIR(dvp, vpp, &cn, &va);
+ if (cn.cn_flags & HASBUF) {
+ zfree(namei_zone, cn.cn_pnbuf);
+ cn.cn_flags &= ~HASBUF;
+ }
/*vput(dvp);*/
return (error);
}
@@ -976,7 +979,10 @@ union_mkwhiteout(um, dvp, cnp, path)
return (error);
if (wvp) {
- VOP_ABORTOP(dvp, &cn);
+ if (cn.cn_flags & HASBUF) {
+ zfree(namei_zone, cn.cn_pnbuf);
+ cn.cn_flags &= ~HASBUF;
+ }
if (wvp == dvp)
vrele(wvp);
else
@@ -988,8 +994,10 @@ union_mkwhiteout(um, dvp, cnp, path)
VOP_LEASE(dvp, p, p->p_ucred, LEASE_WRITE);
error = VOP_WHITEOUT(dvp, &cn, CREATE);
- if (error)
- VOP_ABORTOP(dvp, &cn);
+ if (cn.cn_flags & HASBUF) {
+ zfree(namei_zone, cn.cn_pnbuf);
+ cn.cn_flags &= ~HASBUF;
+ }
return (error);
}
@@ -1059,7 +1067,10 @@ union_vn_create(vpp, un, p)
*/
if (vp) {
vput(un->un_dirvp);
- VOP_ABORTOP(un->un_dirvp, &cn);
+ if (cn.cn_flags & HASBUF) {
+ zfree(namei_zone, cn.cn_pnbuf);
+ cn.cn_flags &= ~HASBUF;
+ }
if (vp == un->un_dirvp)
vrele(vp);
else
@@ -1082,6 +1093,10 @@ union_vn_create(vpp, un, p)
vap->va_mode = cmode;
VOP_LEASE(un->un_dirvp, p, cred, LEASE_WRITE);
error = VOP_CREATE(un->un_dirvp, &vp, &cn, vap);
+ if (cn.cn_flags & HASBUF) {
+ zfree(namei_zone, cn.cn_pnbuf);
+ cn.cn_flags &= ~HASBUF;
+ }
vput(un->un_dirvp);
if (error)
return (error);
diff --git a/sys/fs/unionfs/union_vfsops.c b/sys/fs/unionfs/union_vfsops.c
index ccd9a13..f5782fa 100644
--- a/sys/fs/unionfs/union_vfsops.c
+++ b/sys/fs/unionfs/union_vfsops.c
@@ -52,6 +52,7 @@
#include <sys/malloc.h>
#include <sys/filedesc.h>
#include <miscfs/union/union.h>
+#include <vm/vm_zone.h>
static MALLOC_DEFINE(M_UNIONFSMNT, "UNION mount", "UNION mount structure");
@@ -144,6 +145,7 @@ union_mount(mp, path, data, ndp, p)
if (error)
goto bad;
+ NDFREE(ndp, NDF_ONLY_PNBUF);
upperrootvp = ndp->ni_vp;
vrele(ndp->ni_dvp);
ndp->ni_dvp = NULL;
diff --git a/sys/fs/unionfs/union_vnops.c b/sys/fs/unionfs/union_vnops.c
index 5ab1036..03d41a0 100644
--- a/sys/fs/unionfs/union_vnops.c
+++ b/sys/fs/unionfs/union_vnops.c
@@ -67,7 +67,6 @@ SYSCTL_INT(_vfs, OID_AUTO, uniondebug, CTLFLAG_RW, &uniondebug, 0, "");
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));
@@ -1682,43 +1681,6 @@ union_readlink(ap)
}
/*
- * 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, NULL);
- 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.
@@ -1974,7 +1936,6 @@ union_strategy(ap)
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 },
OpenPOWER on IntegriCloud