diff options
author | dillon <dillon@FreeBSD.org> | 2001-10-02 04:26:58 +0000 |
---|---|---|
committer | dillon <dillon@FreeBSD.org> | 2001-10-02 04:26:58 +0000 |
commit | c998ec6a9738d2083a994efe8176151faf1be61e (patch) | |
tree | 4243f037aef8de735b6b609ae11301d5f95a0506 /sys/ufs | |
parent | e40ec60b40dcee9665a85eeef2efaaec232211e6 (diff) | |
download | FreeBSD-src-c998ec6a9738d2083a994efe8176151faf1be61e.zip FreeBSD-src-c998ec6a9738d2083a994efe8176151faf1be61e.tar.gz |
Backout the last commit. The problem is actually much worse then I
first thought and may require serious work to the VOP_RENAME() api itself.
Basically, by the time the VOP_RENAME() function is called, it's already
too late.
Diffstat (limited to 'sys/ufs')
-rw-r--r-- | sys/ufs/ufs/ufs_vnops.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index c0981c3..b7d0c28 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -936,7 +936,6 @@ ufs_rename(ap) struct direct newdir; int doingdirectory = 0, oldparent = 0, newparent = 0; int error = 0, ioflag; - int in_rename_flag = 0; #ifdef DIAGNOSTIC if ((tcnp->cn_flags & HASBUF) == 0 || @@ -1050,8 +1049,6 @@ abortit: goto abortit; } ip->i_flag |= IN_RENAME; - /* note: only the routine that sets IN_RENAME can clear it */ - in_rename_flag = 1; oldparent = dp->i_number; doingdirectory = 1; } @@ -1296,8 +1293,7 @@ abortit: cache_purge(fdvp); } error = ufs_dirremove(fdvp, xp, fcnp->cn_flags, 0); - if (in_rename_flag) - xp->i_flag &= ~IN_RENAME; + xp->i_flag &= ~IN_RENAME; } VN_KNOTE(fvp, NOTE_RENAME); if (dp) @@ -1312,14 +1308,13 @@ bad: vput(ITOV(xp)); vput(ITOV(dp)); out: - if (doingdirectory && in_rename_flag) + if (doingdirectory) ip->i_flag &= ~IN_RENAME; if (vn_lock(fvp, LK_EXCLUSIVE, td) == 0) { ip->i_effnlink--; ip->i_nlink--; ip->i_flag |= IN_CHANGE; - if (in_rename_flag) - ip->i_flag &= ~IN_RENAME; /* XXX huh? Why again? */ + ip->i_flag &= ~IN_RENAME; if (DOINGSOFTDEP(fvp)) softdep_change_linkcnt(ip); vput(fvp); |