The softdep code sometimes use vfs_vget .. vput. For removals, these

would result in a vop_inactive call for the vnode each time, resulting
in vinvalbuf->fsync. The original softdep code avoided the fsync
in vinvalbuf by not calling it if there were no dirty blocks. This
was changed in NetBSD. Also, flush_inodedeps was changed to mark
the inode as modified so that it would do an inode update and flush the
last one. This combination basically caused a sync write for each removed
file in an rm -rf (showing up delayed from the syncer a lot of the time).

If called from vinvalbuf (FSYNC_RECLAIM), and there were no dirty blocks
or pages to begin with, still do everything as normal, so that possible dirty
blocks in transit to disk are properly waited for, etc, but don't pass
UPDATE_WAIT to VOP_UPDATE, since there is no need for it in that case.
This commit is contained in:
fvdl 2001-12-27 01:44:59 +00:00
parent 2b5fe12a98
commit c9218f8686

View File

@ -1,4 +1,4 @@
/* $NetBSD: ffs_vnops.c,v 1.46 2001/11/08 04:52:31 chs Exp $ */
/* $NetBSD: ffs_vnops.c,v 1.47 2001/12/27 01:44:59 fvdl Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1993
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ffs_vnops.c,v 1.46 2001/11/08 04:52:31 chs Exp $");
__KERNEL_RCSID(0, "$NetBSD: ffs_vnops.c,v 1.47 2001/12/27 01:44:59 fvdl Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -332,13 +332,16 @@ ffs_full_fsync(v)
} */ *ap = v;
struct vnode *vp = ap->a_vp;
struct buf *bp, *nbp;
int s, error, passes, skipmeta;
int s, error, passes, skipmeta, inodedeps_only, waitfor;
if (vp->v_type == VBLK &&
vp->v_specmountpoint != NULL &&
(vp->v_specmountpoint->mnt_flag & MNT_SOFTDEP))
softdep_fsync_mountdev(vp);
inodedeps_only = DOINGSOFTDEP(vp) && (ap->a_flags & FSYNC_RECLAIM)
&& vp->v_uobj.uo_npages == NULL && LIST_EMPTY(&vp->v_dirtyblkhd);
/*
* Flush all dirty data associated with a vnode.
*/
@ -430,8 +433,12 @@ loop:
}
}
splx(s);
return (VOP_UPDATE(vp, NULL, NULL,
(ap->a_flags & FSYNC_WAIT) ? UPDATE_WAIT : 0));
if (inodedeps_only)
waitfor = 0;
else
waitfor = (ap->a_flags & FSYNC_WAIT) ? UPDATE_WAIT : 0;
return (VOP_UPDATE(vp, NULL, NULL, waitfor));
}
/*