Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern Require the bdirty() be called at splbio() and with...
details: https://anonhg.NetBSD.org/src/rev/c523c3578076
branches: trunk
changeset: 542765:c523c3578076
user: pk <pk%NetBSD.org@localhost>
date: Thu Feb 06 09:46:46 2003 +0000
description:
Require the bdirty() be called at splbio() and with the buffer interlock held.
This is essentially just a helper routine called from biodone() through
ffs softdep's I/O completion, to re-queue the buffer.
diffstat:
sys/kern/vfs_bio.c | 14 +++++---------
1 files changed, 5 insertions(+), 9 deletions(-)
diffs (51 lines):
diff -r 12db1959fc4e -r c523c3578076 sys/kern/vfs_bio.c
--- a/sys/kern/vfs_bio.c Thu Feb 06 04:51:51 2003 +0000
+++ b/sys/kern/vfs_bio.c Thu Feb 06 09:46:46 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_bio.c,v 1.87 2003/02/05 21:38:42 pk Exp $ */
+/* $NetBSD: vfs_bio.c,v 1.88 2003/02/06 09:46:46 pk Exp $ */
/*-
* Copyright (c) 1994 Christopher G. Demetriou
@@ -51,7 +51,7 @@
#include "opt_softdep.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_bio.c,v 1.87 2003/02/05 21:38:42 pk Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_bio.c,v 1.88 2003/02/06 09:46:46 pk Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -476,6 +476,8 @@
/*
* Same as first half of bdwrite, mark buffer dirty, but do not release it.
+ * Call at splbio() and with the buffer interlock locked.
+ * Note: called only from biodone() through ffs softdep's bioops.io_complete()
*/
void
bdirty(bp)
@@ -483,12 +485,9 @@
{
struct lwp *l = (curlwp != NULL ? curlwp : &lwp0); /* XXX */
struct proc *p = l->l_proc;
- int s;
KASSERT(ISSET(bp->b_flags, B_BUSY));
-
- s = splbio();
- simple_lock(&bp->b_interlock);
+ LOCK_ASSERT(simple_lock_held(&bp->b_interlock));
CLR(bp->b_flags, B_AGE);
@@ -497,9 +496,6 @@
p->p_stats->p_ru.ru_oublock++;
reassignbuf(bp, bp->b_vp);
}
-
- simple_unlock(&bp->b_interlock);
- splx(s);
}
/*
Home |
Main Index |
Thread Index |
Old Index