summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorConstantine Sapuntzakis <csapuntz@cvs.openbsd.org>2001-02-24 23:50:01 +0000
committerConstantine Sapuntzakis <csapuntz@cvs.openbsd.org>2001-02-24 23:50:01 +0000
commit6bcc04760b82bbee884739d344e553fc6a1bd009 (patch)
tree4619c16e2b23e0e0683d67e930030d45ecc6477d /sys
parent31c4b578b780a748398efb11ee2ed4c18d2b506b (diff)
Move splbio's around so that they cover the data structures they need to
and don't cover the ones they don't
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/vfs_sync.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/sys/kern/vfs_sync.c b/sys/kern/vfs_sync.c
index 723a3035559..cb88a051466 100644
--- a/sys/kern/vfs_sync.c
+++ b/sys/kern/vfs_sync.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_sync.c,v 1.15 2001/02/24 19:07:09 csapuntz Exp $ */
+/* $OpenBSD: vfs_sync.c,v 1.16 2001/02/24 23:50:00 csapuntz Exp $ */
/*
* Portions of this code are:
@@ -124,15 +124,14 @@ vn_syncer_add_to_worklist(vp, delay)
{
int s, slot;
- s = splbio();
-
- if (vp->v_bioflag & VBIOONSYNCLIST)
- LIST_REMOVE(vp, v_synclist);
-
if (delay > syncer_maxdelay - 2)
delay = syncer_maxdelay - 2;
slot = (syncer_delayno + delay) & syncer_mask;
+ s = splbio();
+ if (vp->v_bioflag & VBIOONSYNCLIST)
+ LIST_REMOVE(vp, v_synclist);
+
LIST_INSERT_HEAD(&syncer_workitem_pending[slot], vp, v_synclist);
vp->v_bioflag |= VBIOONSYNCLIST;
splx(s);
@@ -159,13 +158,13 @@ sched_sync(p)
/*
* Push files whose dirty time has expired.
*/
- s = splbio();
slp = &syncer_workitem_pending[syncer_delayno];
syncer_delayno += 1;
if (syncer_delayno == syncer_maxdelay)
syncer_delayno = 0;
- splx(s);
+ s = splbio();
while ((vp = LIST_FIRST(slp)) != NULL) {
+ splx(s);
if (VOP_ISLOCKED(vp) == 0) {
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p);
(void) VOP_FSYNC(vp, p->p_ucred, MNT_LAZY, p);
@@ -190,9 +189,10 @@ sched_sync(p)
*/
vn_syncer_add_to_worklist(vp, syncdelay);
}
- splx(s);
}
+ splx(s);
+
#ifdef FFS_SOFTUPDATES
/*
* Do soft update processing.