summaryrefslogtreecommitdiff
path: root/sys/dev/mscp
diff options
context:
space:
mode:
authorad <ad@NetBSD.org>2007-07-29 12:15:35 +0000
committerad <ad@NetBSD.org>2007-07-29 12:15:35 +0000
commit66fefd117bcf82d547bfa88ca68a5b43f17a7103 (patch)
tree6344a9f4cbb126386fe0895fb71a9fab75c81aa6 /sys/dev/mscp
parent480f8d26c5a97f0c8620ae2e36349bfc462ca19c (diff)
It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting B_ERROR, set b_error instead. b_error is 'owned' by whoever completes the I/O request.
Diffstat (limited to 'sys/dev/mscp')
-rw-r--r--sys/dev/mscp/mscp.c9
-rw-r--r--sys/dev/mscp/mscp_disk.c9
-rw-r--r--sys/dev/mscp/mscp_tape.c12
3 files changed, 9 insertions, 21 deletions
diff --git a/sys/dev/mscp/mscp.c b/sys/dev/mscp/mscp.c
index f84a019b92f..6b0c9d57533 100644
--- a/sys/dev/mscp/mscp.c
+++ b/sys/dev/mscp/mscp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: mscp.c,v 1.25 2007/03/04 06:02:14 christos Exp $ */
+/* $NetBSD: mscp.c,v 1.26 2007/07/29 12:15:43 ad Exp $ */
/*
* Copyright (c) 1988 Regents of the University of California.
@@ -76,7 +76,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mscp.c,v 1.25 2007/03/04 06:02:14 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mscp.c,v 1.26 2007/07/29 12:15:43 ad Exp $");
#include <sys/param.h>
#include <sys/buf.h>
@@ -369,10 +369,7 @@ rwend:
* WHAT STATUS WILL THESE HAVE? IT SURE WOULD BE NICE
* IF DEC SOLD DOCUMENTATION FOR THEIR OWN CONTROLLERS.
*/
- if (error) {
- bp->b_flags |= B_ERROR;
- bp->b_error = error;
- }
+ bp->b_error = error;
if (st == M_ST_OFFLINE || st == M_ST_AVAILABLE) {
#ifdef notyet
(*md->md_offline)(ui, mp);
diff --git a/sys/dev/mscp/mscp_disk.c b/sys/dev/mscp/mscp_disk.c
index b2bf056ca19..0cd6fd53f32 100644
--- a/sys/dev/mscp/mscp_disk.c
+++ b/sys/dev/mscp/mscp_disk.c
@@ -1,4 +1,4 @@
-/* $NetBSD: mscp_disk.c,v 1.55 2007/07/21 19:51:48 ad Exp $ */
+/* $NetBSD: mscp_disk.c,v 1.56 2007/07/29 12:15:43 ad Exp $ */
/*
* Copyright (c) 1988 Regents of the University of California.
* All rights reserved.
@@ -81,7 +81,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mscp_disk.c,v 1.55 2007/07/21 19:51:48 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mscp_disk.c,v 1.56 2007/07/29 12:15:43 ad Exp $");
#include <sys/param.h>
#include <sys/buf.h>
@@ -365,7 +365,6 @@ rastrategy(bp)
unit = DISKUNIT(bp->b_dev);
if (unit > ra_cd.cd_ndevs || (ra = ra_cd.cd_devs[unit]) == NULL) {
bp->b_error = ENXIO;
- bp->b_flags |= B_ERROR;
goto done;
}
/*
@@ -383,7 +382,6 @@ rastrategy(bp)
/* If disk is not online, try to put it online */
if (ra->ra_state == DK_CLOSED)
if (ra_putonline(ra) == MSCP_FAILED) {
- bp->b_flags |= B_ERROR;
bp->b_error = EIO;
goto done;
}
@@ -808,14 +806,12 @@ rxstrategy(bp)
unit = DISKUNIT(bp->b_dev);
if (unit > rx_cd.cd_ndevs || (rx = rx_cd.cd_devs[unit]) == NULL) {
bp->b_error = ENXIO;
- bp->b_flags |= B_ERROR;
goto done;
}
/* If disk is not online, try to put it online */
if (rx->ra_state == DK_CLOSED)
if (rx_putonline(rx) == MSCP_FAILED) {
- bp->b_flags |= B_ERROR;
bp->b_error = EIO;
goto done;
}
@@ -1120,7 +1116,6 @@ rrioerror(usc, mp, bp)
switch (code & M_ST_MASK) {
/* The unit has fallen offline. Try to figure out why. */
case M_ST_OFFLINE:
- bp->b_flags |= B_ERROR;
bp->b_error = EIO;
ra->ra_state = DK_CLOSED;
if (code & M_OFFLINE_UNMOUNTED)
diff --git a/sys/dev/mscp/mscp_tape.c b/sys/dev/mscp/mscp_tape.c
index 6f8be2a0160..4f32fedaec5 100644
--- a/sys/dev/mscp/mscp_tape.c
+++ b/sys/dev/mscp/mscp_tape.c
@@ -1,4 +1,4 @@
-/* $NetBSD: mscp_tape.c,v 1.30 2007/03/04 06:02:14 christos Exp $ */
+/* $NetBSD: mscp_tape.c,v 1.31 2007/07/29 12:15:43 ad Exp $ */
/*
* Copyright (c) 1996 Ludd, University of Lule}, Sweden.
* All rights reserved.
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mscp_tape.c,v 1.30 2007/03/04 06:02:14 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mscp_tape.c,v 1.31 2007/07/29 12:15:43 ad Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -277,16 +277,13 @@ mtstrategy(bp)
unit = mtunit(bp->b_dev);
if (unit > mt_cd.cd_ndevs || (mt = mt_cd.cd_devs[unit]) == NULL) {
bp->b_error = ENXIO;
- goto bad;
+ biodone(bp);
+ return;
}
mt->mt_waswrite = bp->b_flags & B_READ ? 0 : 1;
mscp_strategy(bp, device_parent(&mt->mt_dev));
return;
-
-bad:
- bp->b_flags |= B_ERROR;
- biodone(bp);
}
int
@@ -424,7 +421,6 @@ mtioerror(usc, mp, bp)
mt_ioerrs[st-1]);
else
printf("%s: error %d\n", mt->mt_dev.dv_xname, st);
- bp->b_flags |= B_ERROR;
bp->b_error = EROFS;
}