]> git.hungrycats.org Git - linux/commitdiff
Revert "btrfs: Add inflight BIO request counter (rebased on 5.13)"
authorZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Fri, 19 Nov 2021 04:44:35 +0000 (23:44 -0500)
committerZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Fri, 19 Nov 2021 04:44:35 +0000 (23:44 -0500)
This reverts commit b5e3ece0371d61cd8b7e6f8d568b2d8ae49e2bd0.

fs/btrfs/volumes.c
fs/btrfs/volumes.h

index 3720c71f224864ab169fdb0be7d9d34ae686c2be..e241df980705964af008ba4af525e9b0a4d39178 100644 (file)
@@ -380,7 +380,6 @@ void btrfs_free_device(struct btrfs_device *device)
        extent_io_tree_release(&device->alloc_state);
        bio_put(device->flush_bio);
        btrfs_destroy_dev_zone_info(device);
-       percpu_counter_destroy(&device->inflight);
        kfree(device);
 }
 
@@ -444,11 +443,6 @@ static struct btrfs_device *__alloc_device(struct btrfs_fs_info *fs_info)
        extent_io_tree_init(fs_info, &dev->alloc_state,
                            IO_TREE_DEVICE_ALLOC_STATE, NULL);
 
-       if (percpu_counter_init(&dev->inflight, 0, GFP_KERNEL)) {
-               kfree(dev);
-               return ERR_PTR(-ENOMEM);
-       }
-
        return dev;
 }
 
@@ -6835,7 +6829,6 @@ static inline void btrfs_end_bbio(struct btrfs_bio *bbio, struct bio *bio)
 
 static void btrfs_end_bio(struct bio *bio)
 {
-       struct btrfs_device *dev = btrfs_io_bio(bio)->device;
        struct btrfs_bio *bbio = bio->bi_private;
        int is_orig_bio = 0;
 
@@ -6843,6 +6836,8 @@ static void btrfs_end_bio(struct bio *bio)
                atomic_inc(&bbio->error);
                if (bio->bi_status == BLK_STS_IOERR ||
                    bio->bi_status == BLK_STS_TARGET) {
+                       struct btrfs_device *dev = btrfs_io_bio(bio)->device;
+
                        ASSERT(dev->bdev);
                        if (btrfs_op(bio) == BTRFS_MAP_WRITE)
                                btrfs_dev_stat_inc_and_print(dev,
@@ -6860,7 +6855,6 @@ static void btrfs_end_bio(struct bio *bio)
                is_orig_bio = 1;
 
        btrfs_bio_counter_dec(bbio->fs_info);
-       percpu_counter_dec(&dev->inflight);
 
        if (atomic_dec_and_test(&bbio->stripes_pending)) {
                if (!is_orig_bio) {
@@ -6919,7 +6913,6 @@ static void submit_stripe_bio(struct btrfs_bio *bbio, struct bio *bio,
        bio_set_dev(bio, dev->bdev);
 
        btrfs_bio_counter_inc_noblocked(fs_info);
-       percpu_counter_inc(&dev->inflight);
 
        btrfsic_submit_bio(bio);
 }
index 95cfaa7f9ca4654f8c2f35f89ff177f4551be9d9..f623e8882e9932a74ba87e9e862983210120da08 100644 (file)
@@ -147,9 +147,6 @@ struct btrfs_device {
 
        /* Bandwidth limit for scrub, in bytes */
        u64 scrub_speed_max;
-
-       /* I/O stats for raid1 mirror selection */
-       struct percpu_counter inflight;
 };
 
 /*