drbd_req.c: use part_[inc|dec]_in_flight()
authorPhilipp Reisner <philipp.reisner@linbit.com>
Wed, 18 Nov 2009 14:52:51 +0000 (15:52 +0100)
committerPhilipp Reisner <philipp.reisner@linbit.com>
Thu, 3 Dec 2009 16:40:51 +0000 (17:40 +0100)
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
drivers/block/drbd/drbd_req.c

index d09aac4..de81ab7 100644 (file)
@@ -39,8 +39,8 @@ static void _drbd_start_io_acct(struct drbd_conf *mdev, struct drbd_request *req
        cpu = part_stat_lock();
        part_stat_inc(cpu, &mdev->vdisk->part0, ios[rw]);
        part_stat_add(cpu, &mdev->vdisk->part0, sectors[rw], bio_sectors(bio));
+       part_inc_in_flight(&mdev->vdisk->part0, rw);
        part_stat_unlock();
-       mdev->vdisk->part0.in_flight[rw]++;
 }
 
 /* Update disk stats when completing request upwards */
@@ -52,8 +52,8 @@ static void _drbd_end_io_acct(struct drbd_conf *mdev, struct drbd_request *req)
        cpu = part_stat_lock();
        part_stat_add(cpu, &mdev->vdisk->part0, ticks[rw], duration);
        part_round_stats(cpu, &mdev->vdisk->part0);
+       part_dec_in_flight(&mdev->vdisk->part0, rw);
        part_stat_unlock();
-       mdev->vdisk->part0.in_flight[rw]--;
 }
 
 static void _req_is_done(struct drbd_conf *mdev, struct drbd_request *req, const int rw)