- 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. It wasn't even properly used in the CREATE or DELETE cases.
This commit is contained in:
parent
ca1e4c2fe0
commit
e6d7b24c6e
@ -146,7 +146,6 @@ ufs_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 or lockparent flag */
|
||||
int namlen, error;
|
||||
struct vnode **vpp = ap->a_vpp;
|
||||
struct componentname *cnp = ap->a_cnp;
|
||||
@ -165,8 +164,6 @@ ufs_lookup(ap)
|
||||
|
||||
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.
|
||||
*
|
||||
@ -474,9 +471,6 @@ ufs_lookup(ap)
|
||||
/*
|
||||
* 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)) {
|
||||
/*
|
||||
@ -525,7 +519,7 @@ ufs_lookup(ap)
|
||||
* 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)))
|
||||
return (error);
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user