Remove redundant check for vp == dvp (done in VFS before calling).
This commit is contained in:
parent
d105c05896
commit
8a40593f4d
@ -1,4 +1,4 @@
|
||||
/* $Id: msdosfs_vnops.c,v 1.40 1997/02/26 14:23:16 bde Exp $ */
|
||||
/* $Id: msdosfs_vnops.c,v 1.41 1997/04/10 14:56:49 bde Exp $ */
|
||||
/* $NetBSD: msdosfs_vnops.c,v 1.20 1994/08/21 18:44:13 ws Exp $ */
|
||||
|
||||
/*-
|
||||
@ -1423,15 +1423,6 @@ msdosfs_rmdir(ap)
|
||||
ddep = VTODE(ap->a_dvp); /* parent dir of dir to delete */
|
||||
dep = VTODE(ap->a_vp);/* directory to delete */
|
||||
|
||||
/*
|
||||
* Don't let "rmdir ." go thru.
|
||||
*/
|
||||
if (ddep == dep) {
|
||||
vrele(ap->a_vp);
|
||||
vput(ap->a_vp);
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Be sure the directory being deleted is empty.
|
||||
*/
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Id: msdosfs_vnops.c,v 1.40 1997/02/26 14:23:16 bde Exp $ */
|
||||
/* $Id: msdosfs_vnops.c,v 1.41 1997/04/10 14:56:49 bde Exp $ */
|
||||
/* $NetBSD: msdosfs_vnops.c,v 1.20 1994/08/21 18:44:13 ws Exp $ */
|
||||
|
||||
/*-
|
||||
@ -1423,15 +1423,6 @@ msdosfs_rmdir(ap)
|
||||
ddep = VTODE(ap->a_dvp); /* parent dir of dir to delete */
|
||||
dep = VTODE(ap->a_vp);/* directory to delete */
|
||||
|
||||
/*
|
||||
* Don't let "rmdir ." go thru.
|
||||
*/
|
||||
if (ddep == dep) {
|
||||
vrele(ap->a_vp);
|
||||
vput(ap->a_vp);
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Be sure the directory being deleted is empty.
|
||||
*/
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs_vnops.c 8.16 (Berkeley) 5/27/95
|
||||
* $Id: nfs_vnops.c,v 1.47 1997/05/04 09:17:36 phk Exp $
|
||||
* $Id: nfs_vnops.c,v 1.48 1997/05/09 13:18:42 dfr Exp $
|
||||
*/
|
||||
|
||||
|
||||
@ -1990,12 +1990,6 @@ nfs_rmdir(ap)
|
||||
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
|
||||
int v3 = NFS_ISV3(dvp);
|
||||
|
||||
if (dvp == vp) {
|
||||
vput(dvp);
|
||||
vrele(dvp);
|
||||
FREE(cnp->cn_pnbuf, M_NAMEI);
|
||||
return (EINVAL);
|
||||
}
|
||||
nfsstats.rpccnt[NFSPROC_RMDIR]++;
|
||||
nfsm_reqhead(dvp, NFSPROC_RMDIR,
|
||||
NFSX_FH(v3) + NFSX_UNSIGNED + nfsm_rndup(cnp->cn_namelen));
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs_vnops.c 8.16 (Berkeley) 5/27/95
|
||||
* $Id: nfs_vnops.c,v 1.47 1997/05/04 09:17:36 phk Exp $
|
||||
* $Id: nfs_vnops.c,v 1.48 1997/05/09 13:18:42 dfr Exp $
|
||||
*/
|
||||
|
||||
|
||||
@ -1990,12 +1990,6 @@ nfs_rmdir(ap)
|
||||
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
|
||||
int v3 = NFS_ISV3(dvp);
|
||||
|
||||
if (dvp == vp) {
|
||||
vput(dvp);
|
||||
vrele(dvp);
|
||||
FREE(cnp->cn_pnbuf, M_NAMEI);
|
||||
return (EINVAL);
|
||||
}
|
||||
nfsstats.rpccnt[NFSPROC_RMDIR]++;
|
||||
nfsm_reqhead(dvp, NFSPROC_RMDIR,
|
||||
NFSX_FH(v3) + NFSX_UNSIGNED + nfsm_rndup(cnp->cn_namelen));
|
||||
|
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)ufs_vnops.c 8.27 (Berkeley) 5/27/95
|
||||
* $Id: ufs_vnops.c,v 1.48 1997/03/22 06:53:45 bde Exp $
|
||||
* $Id: ufs_vnops.c,v 1.49 1997/03/31 12:02:53 peter Exp $
|
||||
*/
|
||||
|
||||
#include "opt_quota.h"
|
||||
@ -1485,14 +1485,7 @@ ufs_rmdir(ap)
|
||||
|
||||
ip = VTOI(vp);
|
||||
dp = VTOI(dvp);
|
||||
/*
|
||||
* No rmdir "." please.
|
||||
*/
|
||||
if (dp == ip) {
|
||||
vrele(dvp);
|
||||
vput(vp);
|
||||
return (EINVAL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Verify the directory is empty (and valid).
|
||||
* (Rmdir ".." won't be valid since
|
||||
|
Loading…
Reference in New Issue
Block a user