diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 1999-12-05 07:19:29 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 1999-12-05 07:19:29 +0000 |
commit | 798886eb3aa5b52d46215efe171dc51d79ad5a3d (patch) | |
tree | f1a5ddb1eabad789851ad592153c96e3db854a25 | |
parent | 7a7533949be8afece16db4a033c5abdd58988626 (diff) |
Add a new vnode flag "VONSYNCLIST" that indicates if the vnode is on the
syncers work list.
From NetBSD.
-rw-r--r-- | sys/kern/vfs_sync.c | 10 | ||||
-rw-r--r-- | sys/sys/vnode.h | 3 |
2 files changed, 8 insertions, 5 deletions
diff --git a/sys/kern/vfs_sync.c b/sys/kern/vfs_sync.c index 7f4c7a579ff..a226b26238a 100644 --- a/sys/kern/vfs_sync.c +++ b/sys/kern/vfs_sync.c @@ -1,5 +1,4 @@ -/* $OpenBSD: vfs_sync.c,v 1.9 1999/12/05 06:56:35 art Exp $ */ - +/* $OpenBSD: vfs_sync.c,v 1.10 1999/12/05 07:19:28 art Exp $ */ /* * Portions of this code are: @@ -129,10 +128,15 @@ vn_syncer_add_to_worklist(vp, delay) int s, slot; s = splbio(); + + if (vp->v_flag & VONSYNCLIST) + LIST_REMOVE(vp, v_synclist); + if (delay > syncer_maxdelay) delay = syncer_maxdelay; slot = (syncer_delayno + delay) % syncer_last; LIST_INSERT_HEAD(&syncer_workitem_pending[slot], vp, v_synclist); + vp->v_flag |= VONSYNCLIST; splx(s); } @@ -177,7 +181,6 @@ sched_sync(p) /* * Move ourselves to the back of the sync list. */ - LIST_REMOVE(vp, v_synclist); vn_syncer_add_to_worklist(vp, syncdelay); } } @@ -330,7 +333,6 @@ sync_fsync(v) /* * Move ourselves to the back of the sync list. */ - LIST_REMOVE(syncvp, v_synclist); vn_syncer_add_to_worklist(syncvp, syncdelay); /* diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index 6ade92117cf..cda2fbaa68c 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vnode.h,v 1.21 1999/08/08 00:34:38 niklas Exp $ */ +/* $OpenBSD: vnode.h,v 1.22 1999/12/05 07:19:28 art Exp $ */ /* $NetBSD: vnode.h,v 1.38 1996/02/29 20:59:05 cgd Exp $ */ /* @@ -147,6 +147,7 @@ struct vnode { #define VDIROP 0x1000 /* LFS: vnode is involved in a directory op */ #define VONFREELIST 0x2000 /* Vnode is on a free list */ #define VLOCKSWORK 0x4000 /* FS supports locking discipline */ +#define VONSYNCLIST 0x8000 /* Vnode is on syncer worklist */ /* * Vnode attributes. A field value of VNOVAL represents a field whose value |