50c50
< * $FreeBSD: head/sys/dev/fdc/fdc.c 58934 2000-04-02 15:24:56Z phk $
---
> * $FreeBSD: head/sys/dev/fdc/fdc.c 59249 2000-04-15 05:54:02Z phk $
87d86
< #define B_FORMAT B_XXX
866c865
< bufq_init(&fdc->head);
---
> bioq_init(&fdc->head);
1450c1449
< fdstrategy(struct buf *bp)
---
> fdstrategy(struct bio *bp)
1459c1458
< fdu = FDUNIT(minor(bp->b_dev));
---
> fdu = FDUNIT(minor(bp->bio_dev));
1463c1462
< (u_long)major(bp->b_dev), (u_long)minor(bp->b_dev));
---
> (u_long)major(bp->bio_dev), (u_long)minor(bp->bio_dev));
1466,1467c1465,1466
< bp->b_error = ENXIO;
< bp->b_ioflags |= BIO_ERROR;
---
> bp->bio_error = ENXIO;
> bp->bio_flags |= BIO_ERROR;
1472,1473c1471,1472
< if (!(bp->b_flags & B_FORMAT)) {
< if (bp->b_blkno < 0) {
---
> if (!(bp->bio_cmd & BIO_FORMAT)) {
> if (bp->bio_blkno < 0) {
1476,1478c1475,1477
< fdu, (u_long)bp->b_blkno, bp->b_bcount);
< bp->b_error = EINVAL;
< bp->b_ioflags |= BIO_ERROR;
---
> fdu, (u_long)bp->bio_blkno, bp->bio_bcount);
> bp->bio_error = EINVAL;
> bp->bio_flags |= BIO_ERROR;
1481,1483c1480,1482
< if ((bp->b_bcount % fdblk) != 0) {
< bp->b_error = EINVAL;
< bp->b_ioflags |= BIO_ERROR;
---
> if ((bp->bio_bcount % fdblk) != 0) {
> bp->bio_error = EINVAL;
> bp->bio_flags |= BIO_ERROR;
1491c1490
< if (bp->b_blkno > 20000000) {
---
> if (bp->bio_blkno > 20000000) {
1496,1497c1495,1496
< bp->b_error = EINVAL;
< bp->b_ioflags |= BIO_ERROR;
---
> bp->bio_error = EINVAL;
> bp->bio_flags |= BIO_ERROR;
1500c1499
< blknum = (unsigned) bp->b_blkno * DEV_BSIZE/fdblk;
---
> blknum = (unsigned) bp->bio_blkno * DEV_BSIZE/fdblk;
1502,1503c1501,1502
< bp->b_resid = 0;
< if (blknum + (bp->b_bcount / fdblk) > nblocks) {
---
> bp->bio_resid = 0;
> if (blknum + (bp->bio_bcount / fdblk) > nblocks) {
1506c1505
< bp->b_resid = bp->b_bcount - cando;
---
> bp->bio_resid = bp->bio_bcount - cando;
1510,1511c1509,1510
< bp->b_error = EINVAL;
< bp->b_ioflags |= BIO_ERROR;
---
> bp->bio_error = EINVAL;
> bp->bio_flags |= BIO_ERROR;
1515c1514
< bp->b_pblkno = bp->b_blkno;
---
> bp->bio_pblkno = bp->bio_blkno;
1517c1516
< bufqdisksort(&fdc->head, bp);
---
> bioqdisksort(&fdc->head, bp);
1650c1649
< register struct buf *bp;
---
> register struct bio *bp;
1656c1655
< bp = bufq_first(&fdc->head);
---
> bp = bioq_first(&fdc->head);
1658c1657
< bufq_remove(&fdc->head, bp);
---
> bioq_remove(&fdc->head, bp);
1677c1676
< fdu = FDUNIT(minor(bp->b_dev));
---
> fdu = FDUNIT(minor(bp->bio_dev));
1682c1681
< read = bp->b_iocmd == BIO_READ;
---
> read = bp->bio_cmd == BIO_READ;
1687c1686
< format = bp->b_flags & B_FORMAT;
---
> format = bp->bio_cmd & BIO_FORMAT;
1689c1688
< finfo = (struct fd_formb *)bp->b_data;
---
> finfo = (struct fd_formb *)bp->bio_data;
1694c1693
< blknum = (unsigned) bp->b_pblkno * DEV_BSIZE/fdblk +
---
> blknum = (unsigned) bp->bio_pblkno * DEV_BSIZE/fdblk +
1833,1834c1832,1833
< isa_dmastart(idf, bp->b_data+fd->skip,
< format ? bp->b_bcount : fdblk, fdc->dmachan);
---
> isa_dmastart(idf, bp->bio_data+fd->skip,
> format ? bp->bio_bcount : fdblk, fdc->dmachan);
1849,1850c1848,1849
< bp->b_data + fd->skip,
< format ? bp->b_bcount : fdblk,
---
> bp->bio_data + fd->skip,
> format ? bp->bio_bcount : fdblk,
1890c1889
< SET_BCDR(fdc, 1, bp->b_bcount, 0);
---
> SET_BCDR(fdc, 1, bp->bio_bcount, 0);
1892,1894c1891,1893
< (void)fdcpio(fdc,bp->b_iocmd,
< bp->b_data+fd->skip,
< bp->b_bcount);
---
> (void)fdcpio(fdc,bp->bio_cmd,
> bp->bio_data+fd->skip,
> bp->bio_bcount);
1906,1907c1905,1906
< bp->b_data + fd->skip,
< format ? bp->b_bcount : fdblk,
---
> bp->bio_data + fd->skip,
> format ? bp->bio_bcount : fdblk,
1925,1926c1924,1925
< (void)fdcpio(fdc,bp->b_iocmd,
< bp->b_data+fd->skip,
---
> (void)fdcpio(fdc,bp->bio_cmd,
> bp->bio_data+fd->skip,
1943,1944c1942,1943
< bp->b_data + fd->skip,
< format ? bp->b_bcount : fdblk,
---
> bp->bio_data + fd->skip,
> format ? bp->bio_bcount : fdblk,
1955,1956c1954,1955
< if (read && !fdcpio(fdc,bp->b_iocmd,
< bp->b_data+fd->skip,fdblk)) {
---
> if (read && !fdcpio(fdc,bp->bio_cmd,
> bp->bio_data+fd->skip,fdblk)) {
1973c1972
< (void)fdcpio(fdc,bp->b_iocmd,bp->b_data+fd->skip,fdblk);
---
> (void)fdcpio(fdc,bp->bio_cmd,bp->bio_data+fd->skip,fdblk);
1981,1982c1980,1981
< isa_dmadone(idf, bp->b_data + fd->skip,
< format ? bp->b_bcount : fdblk,
---
> isa_dmadone(idf, bp->bio_data + fd->skip,
> format ? bp->bio_bcount : fdblk,
1995,1996c1994,1995
< isa_dmadone(idf, bp->b_data + fd->skip,
< format ? bp->b_bcount : fdblk, fdc->dmachan);
---
> isa_dmadone(idf, bp->bio_data + fd->skip,
> format ? bp->bio_bcount : fdblk, fdc->dmachan);
2021c2020
< if (!format && fd->skip < bp->b_bcount - bp->b_resid) {
---
> if (!format && fd->skip < bp->bio_bcount - bp->bio_resid) {
2029c2028
< devstat_end_transaction_buf(&fd->device_stats, bp);
---
> devstat_end_transaction_bio(&fd->device_stats, bp);
2140c2139
< register struct buf *bp;
---
> struct bio *bp;
2147c2146
< fdu = FDUNIT(minor(bp->b_dev));
---
> fdu = FDUNIT(minor(bp->bio_dev));
2167c2166
< dev_t sav_b_dev = bp->b_dev;
---
> dev_t sav_bio_dev = bp->bio_dev;
2169,2170c2168,2169
< bp->b_dev = makedev(major(bp->b_dev),
< (FDUNIT(minor(bp->b_dev))<<3)|RAW_PART);
---
> bp->bio_dev = makedev(major(bp->bio_dev),
> (FDUNIT(minor(bp->bio_dev))<<3)|RAW_PART);
2174c2173
< bp->b_dev = sav_b_dev;
---
> bp->bio_dev = sav_bio_dev;
2188,2190c2187,2189
< bp->b_ioflags |= BIO_ERROR;
< bp->b_error = EIO;
< bp->b_resid += bp->b_bcount - fdc->fd->skip;
---
> bp->bio_flags |= BIO_ERROR;
> bp->bio_error = EIO;
> bp->bio_resid += bp->bio_bcount - fdc->fd->skip;
2194c2193
< devstat_end_transaction_buf(&fdc->fd->device_stats, bp);
---
> devstat_end_transaction_bio(&fdc->fd->device_stats, bp);
2234,2235c2233,2234
< bp->b_flags = B_PHYS | B_FORMAT;
< bp->b_iocmd = BIO_WRITE;
---
> bp->b_flags = B_PHYS;
> bp->b_iocmd = BIO_FORMAT;
2264c2263
< biodone(bp);
---
> biodone(&bp->b_io); /* XXX: HUH ? */
< * $FreeBSD: head/sys/dev/fdc/fdc.c 58934 2000-04-02 15:24:56Z phk $
---
> * $FreeBSD: head/sys/dev/fdc/fdc.c 59249 2000-04-15 05:54:02Z phk $
87d86
< #define B_FORMAT B_XXX
866c865
< bufq_init(&fdc->head);
---
> bioq_init(&fdc->head);
1450c1449
< fdstrategy(struct buf *bp)
---
> fdstrategy(struct bio *bp)
1459c1458
< fdu = FDUNIT(minor(bp->b_dev));
---
> fdu = FDUNIT(minor(bp->bio_dev));
1463c1462
< (u_long)major(bp->b_dev), (u_long)minor(bp->b_dev));
---
> (u_long)major(bp->bio_dev), (u_long)minor(bp->bio_dev));
1466,1467c1465,1466
< bp->b_error = ENXIO;
< bp->b_ioflags |= BIO_ERROR;
---
> bp->bio_error = ENXIO;
> bp->bio_flags |= BIO_ERROR;
1472,1473c1471,1472
< if (!(bp->b_flags & B_FORMAT)) {
< if (bp->b_blkno < 0) {
---
> if (!(bp->bio_cmd & BIO_FORMAT)) {
> if (bp->bio_blkno < 0) {
1476,1478c1475,1477
< fdu, (u_long)bp->b_blkno, bp->b_bcount);
< bp->b_error = EINVAL;
< bp->b_ioflags |= BIO_ERROR;
---
> fdu, (u_long)bp->bio_blkno, bp->bio_bcount);
> bp->bio_error = EINVAL;
> bp->bio_flags |= BIO_ERROR;
1481,1483c1480,1482
< if ((bp->b_bcount % fdblk) != 0) {
< bp->b_error = EINVAL;
< bp->b_ioflags |= BIO_ERROR;
---
> if ((bp->bio_bcount % fdblk) != 0) {
> bp->bio_error = EINVAL;
> bp->bio_flags |= BIO_ERROR;
1491c1490
< if (bp->b_blkno > 20000000) {
---
> if (bp->bio_blkno > 20000000) {
1496,1497c1495,1496
< bp->b_error = EINVAL;
< bp->b_ioflags |= BIO_ERROR;
---
> bp->bio_error = EINVAL;
> bp->bio_flags |= BIO_ERROR;
1500c1499
< blknum = (unsigned) bp->b_blkno * DEV_BSIZE/fdblk;
---
> blknum = (unsigned) bp->bio_blkno * DEV_BSIZE/fdblk;
1502,1503c1501,1502
< bp->b_resid = 0;
< if (blknum + (bp->b_bcount / fdblk) > nblocks) {
---
> bp->bio_resid = 0;
> if (blknum + (bp->bio_bcount / fdblk) > nblocks) {
1506c1505
< bp->b_resid = bp->b_bcount - cando;
---
> bp->bio_resid = bp->bio_bcount - cando;
1510,1511c1509,1510
< bp->b_error = EINVAL;
< bp->b_ioflags |= BIO_ERROR;
---
> bp->bio_error = EINVAL;
> bp->bio_flags |= BIO_ERROR;
1515c1514
< bp->b_pblkno = bp->b_blkno;
---
> bp->bio_pblkno = bp->bio_blkno;
1517c1516
< bufqdisksort(&fdc->head, bp);
---
> bioqdisksort(&fdc->head, bp);
1650c1649
< register struct buf *bp;
---
> register struct bio *bp;
1656c1655
< bp = bufq_first(&fdc->head);
---
> bp = bioq_first(&fdc->head);
1658c1657
< bufq_remove(&fdc->head, bp);
---
> bioq_remove(&fdc->head, bp);
1677c1676
< fdu = FDUNIT(minor(bp->b_dev));
---
> fdu = FDUNIT(minor(bp->bio_dev));
1682c1681
< read = bp->b_iocmd == BIO_READ;
---
> read = bp->bio_cmd == BIO_READ;
1687c1686
< format = bp->b_flags & B_FORMAT;
---
> format = bp->bio_cmd & BIO_FORMAT;
1689c1688
< finfo = (struct fd_formb *)bp->b_data;
---
> finfo = (struct fd_formb *)bp->bio_data;
1694c1693
< blknum = (unsigned) bp->b_pblkno * DEV_BSIZE/fdblk +
---
> blknum = (unsigned) bp->bio_pblkno * DEV_BSIZE/fdblk +
1833,1834c1832,1833
< isa_dmastart(idf, bp->b_data+fd->skip,
< format ? bp->b_bcount : fdblk, fdc->dmachan);
---
> isa_dmastart(idf, bp->bio_data+fd->skip,
> format ? bp->bio_bcount : fdblk, fdc->dmachan);
1849,1850c1848,1849
< bp->b_data + fd->skip,
< format ? bp->b_bcount : fdblk,
---
> bp->bio_data + fd->skip,
> format ? bp->bio_bcount : fdblk,
1890c1889
< SET_BCDR(fdc, 1, bp->b_bcount, 0);
---
> SET_BCDR(fdc, 1, bp->bio_bcount, 0);
1892,1894c1891,1893
< (void)fdcpio(fdc,bp->b_iocmd,
< bp->b_data+fd->skip,
< bp->b_bcount);
---
> (void)fdcpio(fdc,bp->bio_cmd,
> bp->bio_data+fd->skip,
> bp->bio_bcount);
1906,1907c1905,1906
< bp->b_data + fd->skip,
< format ? bp->b_bcount : fdblk,
---
> bp->bio_data + fd->skip,
> format ? bp->bio_bcount : fdblk,
1925,1926c1924,1925
< (void)fdcpio(fdc,bp->b_iocmd,
< bp->b_data+fd->skip,
---
> (void)fdcpio(fdc,bp->bio_cmd,
> bp->bio_data+fd->skip,
1943,1944c1942,1943
< bp->b_data + fd->skip,
< format ? bp->b_bcount : fdblk,
---
> bp->bio_data + fd->skip,
> format ? bp->bio_bcount : fdblk,
1955,1956c1954,1955
< if (read && !fdcpio(fdc,bp->b_iocmd,
< bp->b_data+fd->skip,fdblk)) {
---
> if (read && !fdcpio(fdc,bp->bio_cmd,
> bp->bio_data+fd->skip,fdblk)) {
1973c1972
< (void)fdcpio(fdc,bp->b_iocmd,bp->b_data+fd->skip,fdblk);
---
> (void)fdcpio(fdc,bp->bio_cmd,bp->bio_data+fd->skip,fdblk);
1981,1982c1980,1981
< isa_dmadone(idf, bp->b_data + fd->skip,
< format ? bp->b_bcount : fdblk,
---
> isa_dmadone(idf, bp->bio_data + fd->skip,
> format ? bp->bio_bcount : fdblk,
1995,1996c1994,1995
< isa_dmadone(idf, bp->b_data + fd->skip,
< format ? bp->b_bcount : fdblk, fdc->dmachan);
---
> isa_dmadone(idf, bp->bio_data + fd->skip,
> format ? bp->bio_bcount : fdblk, fdc->dmachan);
2021c2020
< if (!format && fd->skip < bp->b_bcount - bp->b_resid) {
---
> if (!format && fd->skip < bp->bio_bcount - bp->bio_resid) {
2029c2028
< devstat_end_transaction_buf(&fd->device_stats, bp);
---
> devstat_end_transaction_bio(&fd->device_stats, bp);
2140c2139
< register struct buf *bp;
---
> struct bio *bp;
2147c2146
< fdu = FDUNIT(minor(bp->b_dev));
---
> fdu = FDUNIT(minor(bp->bio_dev));
2167c2166
< dev_t sav_b_dev = bp->b_dev;
---
> dev_t sav_bio_dev = bp->bio_dev;
2169,2170c2168,2169
< bp->b_dev = makedev(major(bp->b_dev),
< (FDUNIT(minor(bp->b_dev))<<3)|RAW_PART);
---
> bp->bio_dev = makedev(major(bp->bio_dev),
> (FDUNIT(minor(bp->bio_dev))<<3)|RAW_PART);
2174c2173
< bp->b_dev = sav_b_dev;
---
> bp->bio_dev = sav_bio_dev;
2188,2190c2187,2189
< bp->b_ioflags |= BIO_ERROR;
< bp->b_error = EIO;
< bp->b_resid += bp->b_bcount - fdc->fd->skip;
---
> bp->bio_flags |= BIO_ERROR;
> bp->bio_error = EIO;
> bp->bio_resid += bp->bio_bcount - fdc->fd->skip;
2194c2193
< devstat_end_transaction_buf(&fdc->fd->device_stats, bp);
---
> devstat_end_transaction_bio(&fdc->fd->device_stats, bp);
2234,2235c2233,2234
< bp->b_flags = B_PHYS | B_FORMAT;
< bp->b_iocmd = BIO_WRITE;
---
> bp->b_flags = B_PHYS;
> bp->b_iocmd = BIO_FORMAT;
2264c2263
< biodone(bp);
---
> biodone(&bp->b_io); /* XXX: HUH ? */