Merge commit 'refs/top-bases/linux-zfs-branch' into linux-zfs-branch

This commit is contained in:
Brian Behlendorf 2009-07-24 15:32:04 -07:00
commit 65ae9d706b
1 changed files with 11 additions and 12 deletions

View File

@ -136,18 +136,17 @@ vdev_disk_physio_completion(struct bio *bio, unsigned int size, int rc)
if (dr == NULL) { if (dr == NULL) {
printk("FATAL: bio->bi_private == NULL\n" printk("FATAL: bio->bi_private == NULL\n"
"bi_next: %p, bi_flags: %lx, bi_rw: %lu, bi_vcnt: %d\n" "bi_next: %p, bi_flags: %lx, bi_rw: %lu, bi_vcnt: %d\n"
"bi_idx: %d, bi->size: %d, bi_end_io: %p, bi_cnt: %d\n", "bi_idx: %d, bi_size: %d, bi_end_io: %p, bi_cnt: %d\n",
bio->bi_next, bio->bi_flags, bio->bi_rw, bio->bi_vcnt, bio->bi_next, bio->bi_flags, bio->bi_rw, bio->bi_vcnt,
bio->bi_idx, bio->bi_size, bio->bi_end_io, bio->bi_idx, bio->bi_size, bio->bi_end_io,
atomic_read(&bio->bi_cnt)); atomic_read(&bio->bi_cnt));
SBUG(); SBUG();
} }
/* Incomplete */ #ifndef HAVE_2ARGS_BIO_END_IO_T
if (bio->bi_size) { if (bio->bi_size)
rc = 1; return 1;
goto out; #endif /* HAVE_2ARGS_BIO_END_IO_T */
}
error = rc; error = rc;
if (error == 0 && !test_bit(BIO_UPTODATE, &bio->bi_flags)) if (error == 0 && !test_bit(BIO_UPTODATE, &bio->bi_flags))
@ -168,7 +167,7 @@ vdev_disk_physio_completion(struct bio *bio, unsigned int size, int rc)
zio = dr->dr_zio; zio = dr->dr_zio;
spin_unlock(&dr->dr_lock); spin_unlock(&dr->dr_lock);
/* Syncronous dio cleanup handled by waiter */ /* Synchronous dio cleanup handled by waiter */
if (dr->dr_rw & (1 << BIO_RW_SYNC)) { if (dr->dr_rw & (1 << BIO_RW_SYNC)) {
complete(&dr->dr_comp); complete(&dr->dr_comp);
} else { } else {
@ -188,7 +187,7 @@ vdev_disk_physio_completion(struct bio *bio, unsigned int size, int rc)
} }
rc = 0; rc = 0;
out:
#ifdef HAVE_2ARGS_BIO_END_IO_T #ifdef HAVE_2ARGS_BIO_END_IO_T
return; return;
#else #else
@ -261,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;
@ -283,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
@ -440,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);