Performance improvment to minimize delayed write output of files

that have been deleted.
Submitted by:	Peter M. Chen <pmchen@eecs.umich.edu>
This commit is contained in:
dyson 1997-08-21 01:42:47 +00:00
parent 072e0e8455
commit 3e92715f78

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)ufs_vnops.c 8.27 (Berkeley) 5/27/95
* $Id: ufs_vnops.c,v 1.51 1997/06/02 06:24:51 julian Exp $
* $Id: ufs_vnops.c,v 1.52 1997/07/13 16:26:40 bde Exp $
*/
#include "opt_quota.h"
@ -692,6 +692,12 @@ ufs_remove(ap)
ip->i_flag |= IN_CHANGE;
}
out:
if ((ip->i_nlink == 0) &&
((vp->v_object == NULL) && (vp->v_usecount == 1)) ||
(vp->v_usecount <= 2)) {
VOP_TRUNCATE(vp, (off_t)0, 0, NOCRED, NULL);
}
if (dvp == vp)
vrele(vp);
else