Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[linux-drm-fsl-dcu.git] / fs / bio.c
index c6c07ca5b5a9d36e2306197a1b6d007f78f293e8..50c40ce2cead2078d528d48112d09b062fb32eb0 100644 (file)
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -560,10 +560,8 @@ struct bio *bio_copy_user(request_queue_t *q, unsigned long uaddr,
                        break;
                }
 
-               if (bio_add_pc_page(q, bio, page, bytes, 0) < bytes) {
-                       ret = -EINVAL;
+               if (bio_add_pc_page(q, bio, page, bytes, 0) < bytes)
                        break;
-               }
 
                len -= bytes;
        }
@@ -622,10 +620,9 @@ static struct bio *__bio_map_user_iov(request_queue_t *q,
 
                nr_pages += end - start;
                /*
-                * transfer and buffer must be aligned to at least hardsector
-                * size for now, in the future we can relax this restriction
+                * buffer must be aligned to at least hardsector size for now
                 */
-               if ((uaddr & queue_dma_alignment(q)) || (len & queue_dma_alignment(q)))
+               if (uaddr & queue_dma_alignment(q))
                        return ERR_PTR(-EINVAL);
        }
 
@@ -751,7 +748,6 @@ struct bio *bio_map_user_iov(request_queue_t *q, struct block_device *bdev,
                             int write_to_vm)
 {
        struct bio *bio;
-       int len = 0, i;
 
        bio = __bio_map_user_iov(q, bdev, iov, iov_count, write_to_vm);
 
@@ -766,18 +762,7 @@ struct bio *bio_map_user_iov(request_queue_t *q, struct block_device *bdev,
         */
        bio_get(bio);
 
-       for (i = 0; i < iov_count; i++)
-               len += iov[i].iov_len;
-
-       if (bio->bi_size == len)
-               return bio;
-
-       /*
-        * don't support partial mappings
-        */
-       bio_endio(bio, bio->bi_size, 0);
-       bio_unmap_user(bio);
-       return ERR_PTR(-EINVAL);
+       return bio;
 }
 
 static void __bio_unmap_user(struct bio *bio)