BIO_RW_FAILFAST replaced with BIO_RW_FAILFAST_{DEV|_TRANSPORT|_DRIVER}

Use the legacy BIO_RW_FAILFAST flag if it exists.  If it is missing it
means we are running against a kernel with the newer API.  We should
be able to enable some fairly smart behavior one we intergrate with the
new API, but until I get around to writing that code just remove the
flag entirely.  It's not critical for correctness.
This commit is contained in:
Brian Behlendorf 2009-07-24 15:16:13 -07:00
parent 67d31d626f
commit 1fc5fb504c
1 changed files with 4 additions and 4 deletions

View File

@ -260,10 +260,6 @@ __vdev_disk_physio(struct block_device *vd_lh, zio_t *zio, caddr_t kbuf_ptr,
int i, j, error = 0, bio_count, bio_size, dio_size; int i, j, error = 0, bio_count, bio_size, dio_size;
ASSERT3S(kbuf_offset % SECTOR_SIZE, ==, 0); ASSERT3S(kbuf_offset % SECTOR_SIZE, ==, 0);
ASSERT3S(flags &
~((1 << BIO_RW) |
(1 << BIO_RW_SYNC) |
(1 << BIO_RW_FAILFAST)), ==, 0);
bio_count = (kbuf_size / (q->max_hw_sectors << 9)) + 1; bio_count = (kbuf_size / (q->max_hw_sectors << 9)) + 1;
dio_size = sizeof(dio_request_t) + sizeof(struct bio *) * bio_count; dio_size = sizeof(dio_request_t) + sizeof(struct bio *) * bio_count;
@ -282,8 +278,10 @@ __vdev_disk_physio(struct block_device *vd_lh, zio_t *zio, caddr_t kbuf_ptr,
if (flags & (1 << BIO_RW)) if (flags & (1 << BIO_RW))
dr->dr_rw = (flags & (1 << BIO_RW_SYNC)) ? WRITE_SYNC : WRITE; dr->dr_rw = (flags & (1 << BIO_RW_SYNC)) ? WRITE_SYNC : WRITE;
#ifdef BIO_RW_FAILFAST
if (flags & (1 << BIO_RW_FAILFAST)) if (flags & (1 << BIO_RW_FAILFAST))
dr->dr_rw |= 1 << BIO_RW_FAILFAST; dr->dr_rw |= 1 << BIO_RW_FAILFAST;
#endif /* BIO_RW_FAILFAST */
/* /*
* When the IO size exceeds the maximum bio size for the request * When the IO size exceeds the maximum bio size for the request
@ -439,8 +437,10 @@ vdev_disk_io_start(zio_t *zio)
*/ */
flags = ((zio->io_type == ZIO_TYPE_READ) ? READ : WRITE); flags = ((zio->io_type == ZIO_TYPE_READ) ? READ : WRITE);
#ifdef BIO_RW_FAILFAST
if (zio->io_flags & ZIO_FLAG_IO_RETRY) if (zio->io_flags & ZIO_FLAG_IO_RETRY)
flags |= (1 << BIO_RW_FAILFAST); flags |= (1 << BIO_RW_FAILFAST);
#endif /* BIO_RW_FAILFAST */
error = __vdev_disk_physio(dvd->vd_lh, zio, zio->io_data, error = __vdev_disk_physio(dvd->vd_lh, zio, zio->io_data,
zio->io_size, zio->io_offset, flags); zio->io_size, zio->io_offset, flags);