summaryrefslogtreecommitdiffstats
path: root/sys/gnu
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2005-03-29 13:09:42 +0000
committerjeff <jeff@FreeBSD.org>2005-03-29 13:09:42 +0000
commitca1e4c2fe08ddca6d8bb843c635cb05b2ccf61ae (patch)
tree92eb84a2d2d9af54ef213ce03aa350828627dfe2 /sys/gnu
parent7d8081dca491f34620fcb86e26b6a1e24275de75 (diff)
downloadFreeBSD-src-ca1e4c2fe08ddca6d8bb843c635cb05b2ccf61ae.zip
FreeBSD-src-ca1e4c2fe08ddca6d8bb843c635cb05b2ccf61ae.tar.gz
- Remove wantparent, it is no longer necessary. An assert in vfs_lookup.c
prevents any callers from doing a modifying op without LOCKPARENT or WANTPARENT.
Diffstat (limited to 'sys/gnu')
-rw-r--r--sys/gnu/ext2fs/ext2_lookup.c9
-rw-r--r--sys/gnu/fs/ext2fs/ext2_lookup.c9
2 files changed, 2 insertions, 16 deletions
diff --git a/sys/gnu/ext2fs/ext2_lookup.c b/sys/gnu/ext2fs/ext2_lookup.c
index ec39d02..2b3481a 100644
--- a/sys/gnu/ext2fs/ext2_lookup.c
+++ b/sys/gnu/ext2fs/ext2_lookup.c
@@ -312,7 +312,6 @@ ext2_lookup(ap)
struct vnode *tdp; /* returned by VFS_VGET */
doff_t enduseful; /* pointer past last used dir slot */
u_long bmask; /* block offset mask */
- int wantparent; /* 1 => wantparent flag */
int namlen, error;
struct vnode **vpp = ap->a_vpp;
struct componentname *cnp = ap->a_cnp;
@@ -328,8 +327,6 @@ ext2_lookup(ap)
*vpp = NULL;
vdp = ap->a_dvp;
dp = VTOI(vdp);
- wantparent = flags & (LOCKPARENT|WANTPARENT);
-
/*
* We now have a segment name to search for, and a directory to search.
*/
@@ -572,9 +569,6 @@ found:
/*
* If deleting, and at end of pathname, return
* parameters which can be used to remove file.
- * If the wantparent flag isn't set, we return only
- * the directory (in ndp->ni_dvp), otherwise we go
- * on and lock the inode, being careful with ".".
*/
if (nameiop == DELETE && (flags & ISLASTCN)) {
/*
@@ -623,8 +617,7 @@ found:
* Must get inode of directory entry to verify it's a
* regular file, or empty directory.
*/
- if (nameiop == RENAME && wantparent &&
- (flags & ISLASTCN)) {
+ if (nameiop == RENAME && (flags & ISLASTCN)) {
if ((error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_thread)) != 0)
return (error);
/*
diff --git a/sys/gnu/fs/ext2fs/ext2_lookup.c b/sys/gnu/fs/ext2fs/ext2_lookup.c
index ec39d02..2b3481a 100644
--- a/sys/gnu/fs/ext2fs/ext2_lookup.c
+++ b/sys/gnu/fs/ext2fs/ext2_lookup.c
@@ -312,7 +312,6 @@ ext2_lookup(ap)
struct vnode *tdp; /* returned by VFS_VGET */
doff_t enduseful; /* pointer past last used dir slot */
u_long bmask; /* block offset mask */
- int wantparent; /* 1 => wantparent flag */
int namlen, error;
struct vnode **vpp = ap->a_vpp;
struct componentname *cnp = ap->a_cnp;
@@ -328,8 +327,6 @@ ext2_lookup(ap)
*vpp = NULL;
vdp = ap->a_dvp;
dp = VTOI(vdp);
- wantparent = flags & (LOCKPARENT|WANTPARENT);
-
/*
* We now have a segment name to search for, and a directory to search.
*/
@@ -572,9 +569,6 @@ found:
/*
* If deleting, and at end of pathname, return
* parameters which can be used to remove file.
- * If the wantparent flag isn't set, we return only
- * the directory (in ndp->ni_dvp), otherwise we go
- * on and lock the inode, being careful with ".".
*/
if (nameiop == DELETE && (flags & ISLASTCN)) {
/*
@@ -623,8 +617,7 @@ found:
* Must get inode of directory entry to verify it's a
* regular file, or empty directory.
*/
- if (nameiop == RENAME && wantparent &&
- (flags & ISLASTCN)) {
+ if (nameiop == RENAME && (flags & ISLASTCN)) {
if ((error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_thread)) != 0)
return (error);
/*
OpenPOWER on IntegriCloud