summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2001-08-27 06:09:56 +0000
committerpeter <peter@FreeBSD.org>2001-08-27 06:09:56 +0000
commit4b437abe7829ed9af8a9434c256082b546c84682 (patch)
treea8cac4344907af5683b1c88f1f7e46973765b594 /sys/kern
parent4d1f4f0e8abb7b90a7320815340366eb1491a971 (diff)
downloadFreeBSD-src-4b437abe7829ed9af8a9434c256082b546c84682.zip
FreeBSD-src-4b437abe7829ed9af8a9434c256082b546c84682.tar.gz
If a file has been completely unlinked, stop automatically syncing the
file. ffs will discard any pending dirty pages when it is closed, so we may as well not waste time trying to clean them. This doesn't stop other things from writing it out, eg: pageout, fsync(2) etc.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/vfs_subr.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index b421902..b38bc16 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -2378,6 +2378,9 @@ loop:
if (vp->v_flag & VXLOCK) /* XXX: what if MNT_WAIT? */
continue;
+ if (vp->v_flag & VNOSYNC) /* unlinked, skip it */
+ continue;
+
if (flags != MNT_WAIT) {
if (VOP_GETVOBJECT(vp, &obj) != 0 ||
(obj->flags & OBJ_MIGHTBEDIRTY) == 0)
OpenPOWER on IntegriCloud