Btrfs: use bio_endio_nodec instead of open code
authorMiao Xie <miaox@cn.fujitsu.com>
Thu, 19 Jun 2014 02:42:53 +0000 (10:42 +0800)
committerChris Mason <clm@fb.com>
Thu, 19 Jun 2014 21:20:55 +0000 (14:20 -0700)
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/volumes.c

index 19c298a47a6fda8dc1f1c01b560ff3c12312f70d..31f9036f3171f2d41b4a9d41a754268462be24f9 100644 (file)
@@ -5399,12 +5399,6 @@ static void btrfs_end_bio(struct bio *bio, int err)
                        bio = bbio->orig_bio;
                }
 
-               /*
-                * We have original bio now. So increment bi_remaining to
-                * account for it in endio
-                */
-               atomic_inc(&bio->bi_remaining);
-
                bio->bi_private = bbio->private;
                bio->bi_end_io = bbio->end_io;
                btrfs_io_bio(bio)->mirror_num = bbio->mirror_num;
@@ -5422,8 +5416,7 @@ static void btrfs_end_bio(struct bio *bio, int err)
                        err = 0;
                }
                kfree(bbio);
-
-               bio_endio(bio, err);
+               bio_endio_nodec(bio, err);
        } else if (!is_orig_bio) {
                bio_put(bio);
        }