summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_physio.c
diff options
context:
space:
mode:
authormatthew <matthew@openbsd.org>2010-09-22 01:18:57 +0000
committermatthew <matthew@openbsd.org>2010-09-22 01:18:57 +0000
commit90f6ca673a707630ca0769f9d113ee3ee72328ff (patch)
tree6d67bdfb670a42dd49023de0b81a93631337b370 /sys/kern/kern_physio.c
parentremove a leftover debug printf (diff)
downloadwireguard-openbsd-90f6ca673a707630ca0769f9d113ee3ee72328ff.tar.xz
wireguard-openbsd-90f6ca673a707630ca0769f9d113ee3ee72328ff.zip
All users of physio(9) now pass NULL as the buf pointer argument, so
no point in keeping it around. "i like this" thib@ (a while back); ok krw@ and oga@; reminder to update the man page and tweaks jmc@
Diffstat (limited to 'sys/kern/kern_physio.c')
-rw-r--r--sys/kern/kern_physio.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/sys/kern/kern_physio.c b/sys/kern/kern_physio.c
index 546b18fd27e..8653c19298f 100644
--- a/sys/kern/kern_physio.c
+++ b/sys/kern/kern_physio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_physio.c,v 1.31 2010/07/01 21:27:39 art Exp $ */
+/* $OpenBSD: kern_physio.c,v 1.32 2010/09/22 01:18:57 matthew Exp $ */
/* $NetBSD: kern_physio.c,v 1.28 1997/05/19 10:43:28 pk Exp $ */
/*-
@@ -68,19 +68,19 @@ void putphysbuf(struct buf *bp);
* Comments in brackets are from Leffler, et al.'s pseudo-code implementation.
*/
int
-physio(void (*strategy)(struct buf *), struct buf *bp, dev_t dev, int flags,
+physio(void (*strategy)(struct buf *), dev_t dev, int flags,
void (*minphys)(struct buf *), struct uio *uio)
{
struct iovec *iovp;
struct proc *p = curproc;
- int error, done, i, nobuf, s, todo;
+ int error, done, i, s, todo;
+ struct buf *bp;
error = 0;
flags &= B_READ | B_WRITE;
- /* Make sure we have a buffer, creating one if necessary. */
- if ((nobuf = (bp == NULL)) != 0)
- bp = getphysbuf();
+ /* Create a buffer. */
+ bp = getphysbuf();
/* [raise the processor priority level to splbio;] */
s = splbio();
@@ -242,18 +242,7 @@ done:
*/
s = splbio();
bp->b_flags &= ~(B_BUSY | B_PHYS | B_RAW);
- if (nobuf)
- putphysbuf(bp);
- else {
- /*
- * [if another process is waiting for the raw I/O buffer,
- * wake up processes waiting to do physical I/O]
- */
- if (bp->b_flags & B_WANTED) {
- bp->b_flags &= ~B_WANTED;
- wakeup(bp);
- }
- }
+ putphysbuf(bp);
splx(s);
return (error);