diff options
Diffstat (limited to 'fs/bio.c')
-rw-r--r-- | fs/bio.c | 23 |
1 files changed, 4 insertions, 19 deletions
@@ -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 | } |
@@ -622,10 +620,9 @@ static struct bio *__bio_map_user_iov(request_queue_t *q, | |||
622 | 620 | ||
623 | nr_pages += end - start; | 621 | nr_pages += end - start; |
624 | /* | 622 | /* |
625 | * transfer and buffer must be aligned to at least hardsector | 623 | * buffer must be aligned to at least hardsector size for now |
626 | * size for now, in the future we can relax this restriction | ||
627 | */ | 624 | */ |
628 | if ((uaddr & queue_dma_alignment(q)) || (len & queue_dma_alignment(q))) | 625 | if (uaddr & queue_dma_alignment(q)) |
629 | return ERR_PTR(-EINVAL); | 626 | return ERR_PTR(-EINVAL); |
630 | } | 627 | } |
631 | 628 | ||
@@ -751,7 +748,6 @@ struct bio *bio_map_user_iov(request_queue_t *q, struct block_device *bdev, | |||
751 | int write_to_vm) | 748 | int write_to_vm) |
752 | { | 749 | { |
753 | struct bio *bio; | 750 | struct bio *bio; |
754 | int len = 0, i; | ||
755 | 751 | ||
756 | 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); |
757 | 753 | ||
@@ -766,18 +762,7 @@ struct bio *bio_map_user_iov(request_queue_t *q, struct block_device *bdev, | |||
766 | */ | 762 | */ |
767 | bio_get(bio); | 763 | bio_get(bio); |
768 | 764 | ||
769 | for (i = 0; i < iov_count; i++) | 765 | return bio; |
770 | len += iov[i].iov_len; | ||
771 | |||
772 | if (bio->bi_size == len) | ||
773 | return bio; | ||
774 | |||
775 | /* | ||
776 | * don't support partial mappings | ||
777 | */ | ||
778 | bio_endio(bio, bio->bi_size, 0); | ||
779 | bio_unmap_user(bio); | ||
780 | return ERR_PTR(-EINVAL); | ||
781 | } | 766 | } |
782 | 767 | ||
783 | static void __bio_unmap_user(struct bio *bio) | 768 | static void __bio_unmap_user(struct bio *bio) |