Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[firefly-linux-kernel-4.4.55.git] / fs / xfs / xfs_aops.c
index 9bbb3507376a7503ece35508c765e6929fb9fbd6..cc2a321f774b204de565db643483ce4c48518bbf 100644 (file)
@@ -349,12 +349,11 @@ xfs_imap_valid(
  */
 STATIC void
 xfs_end_bio(
-       struct bio              *bio,
-       int                     error)
+       struct bio              *bio)
 {
        xfs_ioend_t             *ioend = bio->bi_private;
 
-       ioend->io_error = test_bit(BIO_UPTODATE, &bio->bi_flags) ? 0 : error;
+       ioend->io_error = bio->bi_error;
 
        /* Toss bio and pass work off to an xfsdatad thread */
        bio->bi_private = NULL;
@@ -380,8 +379,7 @@ STATIC struct bio *
 xfs_alloc_ioend_bio(
        struct buffer_head      *bh)
 {
-       int                     nvecs = bio_get_nr_vecs(bh->b_bdev);
-       struct bio              *bio = bio_alloc(GFP_NOIO, nvecs);
+       struct bio              *bio = bio_alloc(GFP_NOIO, BIO_MAX_PAGES);
 
        ASSERT(bio->bi_private == NULL);
        bio->bi_iter.bi_sector = bh->b_blocknr * (bh->b_size >> 9);