Merge branch 'for-4.3/blkcg' of git://git.kernel.dk/linux-block
[firefly-linux-kernel-4.4.55.git] / fs / ext4 / readpage.c
index ec3ef93a52dbbcf3c0f26680ce769890c56807f3..e26803fb210d3bf1134f500b85f43802b2ce7e58 100644 (file)
@@ -98,7 +98,7 @@ static inline bool ext4_bio_encrypted(struct bio *bio)
  * status of that page is hard.  See end_buffer_async_read() for the details.
  * There is no point in duplicating all that complexity.
  */
-static void mpage_end_io(struct bio *bio, int err)
+static void mpage_end_io(struct bio *bio)
 {
        struct bio_vec *bv;
        int i;
@@ -106,7 +106,7 @@ static void mpage_end_io(struct bio *bio, int err)
        if (ext4_bio_encrypted(bio)) {
                struct ext4_crypto_ctx *ctx = bio->bi_private;
 
-               if (err) {
+               if (bio->bi_error) {
                        ext4_release_crypto_ctx(ctx);
                } else {
                        INIT_WORK(&ctx->r.work, completion_pages);
@@ -118,7 +118,7 @@ static void mpage_end_io(struct bio *bio, int err)
        bio_for_each_segment_all(bv, bio, i) {
                struct page *page = bv->bv_page;
 
-               if (!err) {
+               if (!bio->bi_error) {
                        SetPageUptodate(page);
                } else {
                        ClearPageUptodate(page);
@@ -284,7 +284,7 @@ int ext4_mpage_readpages(struct address_space *mapping,
                                        goto set_error_page;
                        }
                        bio = bio_alloc(GFP_KERNEL,
-                               min_t(int, nr_pages, bio_get_nr_vecs(bdev)));
+                               min_t(int, nr_pages, BIO_MAX_PAGES));
                        if (!bio) {
                                if (ctx)
                                        ext4_release_crypto_ctx(ctx);