summaryrefslogtreecommitdiffstats
path: root/sys/coda
diff options
context:
space:
mode:
authoreivind <eivind@FreeBSD.org>1999-12-15 23:02:35 +0000
committereivind <eivind@FreeBSD.org>1999-12-15 23:02:35 +0000
commit87724eb67358c0993676ad3dfe9091e192a653f4 (patch)
treec4e987197c199433e822f5a66858564ad5ccd4dd /sys/coda
parent529bc073c0dba1aaccc98818ee299b79a111afab (diff)
downloadFreeBSD-src-87724eb67358c0993676ad3dfe9091e192a653f4.zip
FreeBSD-src-87724eb67358c0993676ad3dfe9091e192a653f4.tar.gz
Introduce NDFREE (and remove VOP_ABORTOP)
Diffstat (limited to 'sys/coda')
-rw-r--r--sys/coda/coda_vfsops.c5
-rw-r--r--sys/coda/coda_vnops.c54
2 files changed, 7 insertions, 52 deletions
diff --git a/sys/coda/coda_vfsops.c b/sys/coda/coda_vfsops.c
index 615289c..04cf95b 100644
--- a/sys/coda/coda_vfsops.c
+++ b/sys/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/coda/coda_vnops.c b/sys/coda/coda_vnops.c
index 1ef09bc..761ebcc 100644
--- a/sys/coda/coda_vnops.c
+++ b/sys/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);
}
OpenPOWER on IntegriCloud