aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorMike Christie <michaelc@cs.wisc.edu>2006-12-01 04:40:55 -0500
committerJens Axboe <jens.axboe@oracle.com>2006-12-01 04:40:55 -0500
commit0e75f9063f5c55fb0b0b546a7c356f8ec186825e (patch)
treedb138f641175403546c2147def4b405f3ff453a8 /fs
parentad2d7225709b11da47e092634cbdf0591829ae9c (diff)
[PATCH] block: support larger block pc requests
This patch modifies blk_rq_map/unmap_user() and the cdrom and scsi_ioctl.c users so that it supports requests larger than bio by chaining them together. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/bio.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/fs/bio.c b/fs/bio.c
index d91cfbf7ebc4..aa4d09bd4e71 100644
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -560,10 +560,8 @@ struct bio *bio_copy_user(request_queue_t *q, unsigned long uaddr,
560 break; 560 break;
561 } 561 }
562 562
563 if (bio_add_pc_page(q, bio, page, bytes, 0) < bytes) { 563 if (bio_add_pc_page(q, bio, page, bytes, 0) < bytes)
564 ret = -EINVAL;
565 break; 564 break;
566 }
567 565
568 len -= bytes; 566 len -= bytes;
569 } 567 }
@@ -750,7 +748,6 @@ struct bio *bio_map_user_iov(request_queue_t *q, struct block_device *bdev,
750 int write_to_vm) 748 int write_to_vm)
751{ 749{
752 struct bio *bio; 750 struct bio *bio;
753 int len = 0, i;
754 751
755 bio = __bio_map_user_iov(q, bdev, iov, iov_count, write_to_vm); 752 bio = __bio_map_user_iov(q, bdev, iov, iov_count, write_to_vm);
756 753
@@ -765,18 +762,7 @@ struct bio *bio_map_user_iov(request_queue_t *q, struct block_device *bdev,
765 */ 762 */
766 bio_get(bio); 763 bio_get(bio);
767 764
768 for (i = 0; i < iov_count; i++) 765 return bio;
769 len += iov[i].iov_len;
770
771 if (bio->bi_size == len)
772 return bio;
773
774 /*
775 * don't support partial mappings
776 */
777 bio_endio(bio, bio->bi_size, 0);
778 bio_unmap_user(bio);
779 return ERR_PTR(-EINVAL);
780} 766}
781 767
782static void __bio_unmap_user(struct bio *bio) 768static void __bio_unmap_user(struct bio *bio)