diff options
-rw-r--r-- | drivers/scsi/osd/osd_initiator.c | 23 | ||||
-rw-r--r-- | fs/exofs/inode.c | 5 | ||||
-rw-r--r-- | include/scsi/osd_initiator.h | 4 |
3 files changed, 18 insertions, 14 deletions
diff --git a/drivers/scsi/osd/osd_initiator.c b/drivers/scsi/osd/osd_initiator.c index ba2ebae305cd..3f5ec578e6c6 100644 --- a/drivers/scsi/osd/osd_initiator.c +++ b/drivers/scsi/osd/osd_initiator.c | |||
@@ -779,13 +779,14 @@ EXPORT_SYMBOL(osd_req_remove_object); | |||
779 | */ | 779 | */ |
780 | 780 | ||
781 | void osd_req_write(struct osd_request *or, | 781 | void osd_req_write(struct osd_request *or, |
782 | const struct osd_obj_id *obj, struct bio *bio, u64 offset) | 782 | const struct osd_obj_id *obj, u64 offset, |
783 | struct bio *bio, u64 len) | ||
783 | { | 784 | { |
784 | _osd_req_encode_common(or, OSD_ACT_WRITE, obj, offset, bio->bi_size); | 785 | _osd_req_encode_common(or, OSD_ACT_WRITE, obj, offset, len); |
785 | WARN_ON(or->out.bio || or->out.total_bytes); | 786 | WARN_ON(or->out.bio || or->out.total_bytes); |
786 | bio->bi_rw |= (1 << BIO_RW); | 787 | WARN_ON(0 == bio_rw_flagged(bio, BIO_RW)); |
787 | or->out.bio = bio; | 788 | or->out.bio = bio; |
788 | or->out.total_bytes = bio->bi_size; | 789 | or->out.total_bytes = len; |
789 | } | 790 | } |
790 | EXPORT_SYMBOL(osd_req_write); | 791 | EXPORT_SYMBOL(osd_req_write); |
791 | 792 | ||
@@ -798,7 +799,8 @@ int osd_req_write_kern(struct osd_request *or, | |||
798 | if (IS_ERR(bio)) | 799 | if (IS_ERR(bio)) |
799 | return PTR_ERR(bio); | 800 | return PTR_ERR(bio); |
800 | 801 | ||
801 | osd_req_write(or, obj, bio, offset); | 802 | bio->bi_rw |= (1 << BIO_RW); /* FIXME: bio_set_dir() */ |
803 | osd_req_write(or, obj, offset, bio, len); | ||
802 | return 0; | 804 | return 0; |
803 | } | 805 | } |
804 | EXPORT_SYMBOL(osd_req_write_kern); | 806 | EXPORT_SYMBOL(osd_req_write_kern); |
@@ -828,13 +830,14 @@ void osd_req_flush_object(struct osd_request *or, | |||
828 | EXPORT_SYMBOL(osd_req_flush_object); | 830 | EXPORT_SYMBOL(osd_req_flush_object); |
829 | 831 | ||
830 | void osd_req_read(struct osd_request *or, | 832 | void osd_req_read(struct osd_request *or, |
831 | const struct osd_obj_id *obj, struct bio *bio, u64 offset) | 833 | const struct osd_obj_id *obj, u64 offset, |
834 | struct bio *bio, u64 len) | ||
832 | { | 835 | { |
833 | _osd_req_encode_common(or, OSD_ACT_READ, obj, offset, bio->bi_size); | 836 | _osd_req_encode_common(or, OSD_ACT_READ, obj, offset, len); |
834 | WARN_ON(or->in.bio || or->in.total_bytes); | 837 | WARN_ON(or->in.bio || or->in.total_bytes); |
835 | bio->bi_rw &= ~(1 << BIO_RW); | 838 | WARN_ON(1 == bio_rw_flagged(bio, BIO_RW)); |
836 | or->in.bio = bio; | 839 | or->in.bio = bio; |
837 | or->in.total_bytes = bio->bi_size; | 840 | or->in.total_bytes = len; |
838 | } | 841 | } |
839 | EXPORT_SYMBOL(osd_req_read); | 842 | EXPORT_SYMBOL(osd_req_read); |
840 | 843 | ||
@@ -847,7 +850,7 @@ int osd_req_read_kern(struct osd_request *or, | |||
847 | if (IS_ERR(bio)) | 850 | if (IS_ERR(bio)) |
848 | return PTR_ERR(bio); | 851 | return PTR_ERR(bio); |
849 | 852 | ||
850 | osd_req_read(or, obj, bio, offset); | 853 | osd_req_read(or, obj, offset, bio, len); |
851 | return 0; | 854 | return 0; |
852 | } | 855 | } |
853 | EXPORT_SYMBOL(osd_req_read_kern); | 856 | EXPORT_SYMBOL(osd_req_read_kern); |
diff --git a/fs/exofs/inode.c b/fs/exofs/inode.c index ba8d9fab4693..f79e8e58c3a2 100644 --- a/fs/exofs/inode.c +++ b/fs/exofs/inode.c | |||
@@ -266,7 +266,7 @@ static int read_exec(struct page_collect *pcol, bool is_sync) | |||
266 | goto err; | 266 | goto err; |
267 | } | 267 | } |
268 | 268 | ||
269 | osd_req_read(or, &obj, pcol->bio, i_start); | 269 | osd_req_read(or, &obj, i_start, pcol->bio, pcol->length); |
270 | 270 | ||
271 | if (is_sync) { | 271 | if (is_sync) { |
272 | exofs_sync_op(or, pcol->sbi->s_timeout, oi->i_cred); | 272 | exofs_sync_op(or, pcol->sbi->s_timeout, oi->i_cred); |
@@ -522,7 +522,8 @@ static int write_exec(struct page_collect *pcol) | |||
522 | 522 | ||
523 | *pcol_copy = *pcol; | 523 | *pcol_copy = *pcol; |
524 | 524 | ||
525 | osd_req_write(or, &obj, pcol_copy->bio, i_start); | 525 | pcol_copy->bio->bi_rw |= (1 << BIO_RW); /* FIXME: bio_set_dir() */ |
526 | osd_req_write(or, &obj, i_start, pcol_copy->bio, pcol_copy->length); | ||
526 | ret = exofs_async_op(or, writepages_done, pcol_copy, oi->i_cred); | 527 | ret = exofs_async_op(or, writepages_done, pcol_copy, oi->i_cred); |
527 | if (unlikely(ret)) { | 528 | if (unlikely(ret)) { |
528 | EXOFS_ERR("write_exec: exofs_async_op() Faild\n"); | 529 | EXOFS_ERR("write_exec: exofs_async_op() Faild\n"); |
diff --git a/include/scsi/osd_initiator.h b/include/scsi/osd_initiator.h index 6132790d678f..8c1e3b804afd 100644 --- a/include/scsi/osd_initiator.h +++ b/include/scsi/osd_initiator.h | |||
@@ -363,7 +363,7 @@ void osd_req_create_object(struct osd_request *or, struct osd_obj_id *); | |||
363 | void osd_req_remove_object(struct osd_request *or, struct osd_obj_id *); | 363 | void osd_req_remove_object(struct osd_request *or, struct osd_obj_id *); |
364 | 364 | ||
365 | void osd_req_write(struct osd_request *or, | 365 | void osd_req_write(struct osd_request *or, |
366 | const struct osd_obj_id *, struct bio *data_out, u64 offset); | 366 | const struct osd_obj_id *obj, u64 offset, struct bio *bio, u64 len); |
367 | int osd_req_write_kern(struct osd_request *or, | 367 | int osd_req_write_kern(struct osd_request *or, |
368 | const struct osd_obj_id *obj, u64 offset, void *buff, u64 len); | 368 | const struct osd_obj_id *obj, u64 offset, void *buff, u64 len); |
369 | void osd_req_append(struct osd_request *or, | 369 | void osd_req_append(struct osd_request *or, |
@@ -380,7 +380,7 @@ void osd_req_flush_object(struct osd_request *or, | |||
380 | /*V2*/ u64 offset, /*V2*/ u64 len); | 380 | /*V2*/ u64 offset, /*V2*/ u64 len); |
381 | 381 | ||
382 | void osd_req_read(struct osd_request *or, | 382 | void osd_req_read(struct osd_request *or, |
383 | const struct osd_obj_id *, struct bio *data_in, u64 offset); | 383 | const struct osd_obj_id *obj, u64 offset, struct bio *bio, u64 len); |
384 | int osd_req_read_kern(struct osd_request *or, | 384 | int osd_req_read_kern(struct osd_request *or, |
385 | const struct osd_obj_id *obj, u64 offset, void *buff, u64 len); | 385 | const struct osd_obj_id *obj, u64 offset, void *buff, u64 len); |
386 | 386 | ||