The bi_end_io API changes make partial IO's impossible
Kernel commit 6712ecf8f648118c3363c142196418f89a510b90 which removes the size argument from bio_endio and bi_end_io, also removes the need to handle partial IOs in the handler.
This commit is contained in:
parent
9d80e40fbb
commit
67d31d626f
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue