X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/a12eac9b54943f621bdfc785076e219d5d1b2e55..795abf1316db53d4abdc5bff180f2b2376c5cfe4:/sys/scsi/sd.c?ds=inline diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c index 5cf7daf510..22dce9a788 100644 --- a/sys/scsi/sd.c +++ b/sys/scsi/sd.c @@ -14,7 +14,7 @@ * * Ported to run under 386BSD by Julian Elischer (julian@dialix.oz.au) Sept 1992 * - * $Id: sd.c,v 1.17 1994/01/29 10:30:39 rgrimes Exp $ + * $Id: sd.c,v 1.26 1994/05/26 00:23:24 jkh Exp $ */ #define SPLSD splbio @@ -415,14 +415,25 @@ sdstrategy(bp) if (bounds_check_with_label(bp, &sd->disklabel, sd->wlabel) <= 0) goto done; /* otherwise, process transfer request */ + } else { + bp->b_pblkno = bp->b_blkno; + bp->b_resid = 0; } opri = SPLSD(); dp = &sd->buf_queue; + /* + * Use a bounce buffer if necessary + */ +#ifndef NOBOUNCE + if (sd->sc_link->flags & SDEV_BOUNCE) + vm_bounce_alloc(bp); +#endif + /* * Place it in the queue of disk activities for this disk */ - disksort(dp, bp); + cldisksort(dp, bp, 64*1024); /* * Tell the device to get going on the transfer if it's @@ -877,7 +888,19 @@ sd_get_parms(unit, flags) sectors = sd_size(unit, flags); disk_parms->disksize = sectors; - sectors /= (disk_parms->heads * disk_parms->cyls); + /* Check if none of these values are zero */ + if(disk_parms->heads && disk_parms->cyls) { + sectors /= (disk_parms->heads * disk_parms->cyls); + } + else { + /* set it to something reasonable */ + disk_parms->heads = 64; + disk_parms->cyls = sectors / (64 * 32); + sectors = 32; + } + /* keep secsiz sane too - we may divide by it later */ + if(disk_parms->secsiz == 0) + disk_parms->secsiz = SECSIZE; disk_parms->sectors = sectors; /* dubious on SCSI *//*XXX */ } sd->sc_link->flags |= SDEV_MEDIA_LOADED;