b_resid cleanups, pointed out by minoura@kw.netlaputa.or.jp in netbsd pr#3007
authorderaadt <deraadt@openbsd.org>
Wed, 11 Dec 1996 19:08:14 +0000 (19:08 +0000)
committerderaadt <deraadt@openbsd.org>
Wed, 11 Dec 1996 19:08:14 +0000 (19:08 +0000)
sys/dev/atapi/acd.c
sys/scsi/cd.c
sys/scsi/sd.c
sys/scsi/st.c

index 15113b3..4e630ea 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: acd.c,v 1.16 1996/12/05 13:12:11 deraadt Exp $        */
+/*     $OpenBSD: acd.c,v 1.17 1996/12/11 19:08:24 deraadt Exp $        */
 
 /*
  * Copyright (c) 1996 Manuel Bouyer.  All rights reserved.
@@ -589,6 +589,7 @@ acdstart(vp)
                if ((ad_link->flags & ADEV_MEDIA_LOADED) == 0) {
                        bp->b_error = EIO;
                        bp->b_flags |= B_ERROR;
+                       bp->b_resid = bp->b_bcount;
                        biodone(bp);
                        continue;
                }
index 7e84a1e..82a995b 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: cd.c,v 1.17 1996/12/05 13:10:24 deraadt Exp $ */
+/*     $OpenBSD: cd.c,v 1.18 1996/12/11 19:08:14 deraadt Exp $ */
 /*     $NetBSD: cd.c,v 1.92 1996/05/05 19:52:50 christos Exp $ */
 
 /*
@@ -575,6 +575,7 @@ cdstart(v)
                if ((sc_link->flags & SDEV_MEDIA_LOADED) == 0) {
                        bp->b_error = EIO;
                        bp->b_flags |= B_ERROR;
+                       bp->b_resid = bp->b_bcount;
                        biodone(bp);
                        continue;
                }
index b1b9515..65384ca 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: sd.c,v 1.20 1996/12/03 08:08:00 deraadt Exp $ */
+/*     $OpenBSD: sd.c,v 1.21 1996/12/11 19:08:18 deraadt Exp $ */
 /*     $NetBSD: sd.c,v 1.100.4.1 1996/06/04 23:14:08 thorpej Exp $     */
 
 /*
@@ -543,6 +543,7 @@ sdstart(v)
                if ((sc_link->flags & SDEV_MEDIA_LOADED) == 0) {
                        bp->b_error = EIO;
                        bp->b_flags |= B_ERROR;
+                       bp->b_resid = bp->b_bcount;
                        biodone(bp);
                        continue;
                }
index 97a4a81..0e2c16b 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: st.c,v 1.12 1996/08/11 23:26:07 deraadt Exp $ */
+/*     $OpenBSD: st.c,v 1.13 1996/12/11 19:08:20 deraadt Exp $ */
 /*     $NetBSD: st.c,v 1.66 1996/05/05 19:53:01 christos Exp $ */
 
 /*
@@ -936,7 +936,7 @@ ststart(v)
                *bp->b_actb = dp;
 
                /*
-                * if the device has been unmounted byt the user
+                * if the device has been unmounted by the user
                 * then throw away all requests until done
                 */
                if (!(st->flags & ST_MOUNTED) ||
@@ -944,6 +944,7 @@ ststart(v)
                        /* make sure that one implies the other.. */
                        sc_link->flags &= ~SDEV_MEDIA_LOADED;
                        bp->b_flags |= B_ERROR;
+                       bp->b_resid = bp->b_bcount;
                        bp->b_error = EIO;
                        biodone(bp);
                        continue;
@@ -966,6 +967,7 @@ ststart(v)
                                         */
                                        if (st_space(st, 0, SP_FILEMARKS, 0)) {
                                                bp->b_flags |= B_ERROR;
+                                               bp->b_resid = bp->b_bcount;
                                                bp->b_error = EIO;
                                                biodone(bp);
                                                continue;