1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-20 15:43:16 +00:00

- Remove wantparent, it is no longer necessary. An assert in vfs_lookup.c

prevents any callers from doing a DELETE or RENAME without locking
   the parent.
This commit is contained in:
Jeff Roberson 2005-03-29 13:04:00 +00:00
parent 5c5e51fd9a
commit fcc9c112cf
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=144298

View File

@ -90,7 +90,6 @@ msdosfs_lookup(ap)
struct componentname *cnp = ap->a_cnp; struct componentname *cnp = ap->a_cnp;
daddr_t bn; daddr_t bn;
int error; int error;
int wantparent;
int slotcount; int slotcount;
int slotoffset = 0; int slotoffset = 0;
int frcn; int frcn;
@ -122,7 +121,6 @@ msdosfs_lookup(ap)
dp = VTODE(vdp); dp = VTODE(vdp);
pmp = dp->de_pmp; pmp = dp->de_pmp;
*vpp = NULL; *vpp = NULL;
wantparent = flags & (LOCKPARENT | WANTPARENT);
#ifdef MSDOSFS_DEBUG #ifdef MSDOSFS_DEBUG
printf("msdosfs_lookup(): vdp %p, dp %p, Attr %02x\n", printf("msdosfs_lookup(): vdp %p, dp %p, Attr %02x\n",
vdp, dp, dp->de_Attributes); vdp, dp, dp->de_Attributes);
@ -436,9 +434,6 @@ msdosfs_lookup(ap)
/* /*
* If deleting, and at end of pathname, return * If deleting, and at end of pathname, return
* parameters which can be used to remove file. * 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)) { if (nameiop == DELETE && (flags & ISLASTCN)) {
/* /*
@ -476,8 +471,7 @@ msdosfs_lookup(ap)
* Must get inode of directory entry to verify it's a * Must get inode of directory entry to verify it's a
* regular file, or empty directory. * regular file, or empty directory.
*/ */
if (nameiop == RENAME && wantparent && if (nameiop == RENAME && (flags & ISLASTCN)) {
(flags & ISLASTCN)) {
if (blkoff == MSDOSFSROOT_OFS) if (blkoff == MSDOSFSROOT_OFS)
return EROFS; /* really? XXX */ return EROFS; /* really? XXX */