]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
block: kill blk_do_io_stat() helper
authorJens Axboe <axboe@kernel.dk>
Thu, 3 Oct 2024 13:29:49 +0000 (07:29 -0600)
committerJens Axboe <axboe@kernel.dk>
Tue, 22 Oct 2024 14:14:56 +0000 (08:14 -0600)
It's now just checking whether or not RQF_IO_STAT is set, so let's get
rid of it and just open-code the specific flag that is being checked.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-merge.c
block/blk-mq.c
block/blk.h

index ad763ec313b6ade3622aeb6c43e5868511239132..8b9a9646aed8b1e1252ef74839e98bd457c76d14 100644 (file)
@@ -797,7 +797,7 @@ static inline void blk_update_mixed_merge(struct request *req,
 
 static void blk_account_io_merge_request(struct request *req)
 {
-       if (blk_do_io_stat(req)) {
+       if (req->rq_flags & RQF_IO_STAT) {
                part_stat_lock();
                part_stat_inc(req->part, merges[op_stat_group(req_op(req))]);
                part_stat_local_dec(req->part,
@@ -1005,12 +1005,11 @@ enum elv_merge blk_try_merge(struct request *rq, struct bio *bio)
 
 static void blk_account_io_merge_bio(struct request *req)
 {
-       if (!blk_do_io_stat(req))
-               return;
-
-       part_stat_lock();
-       part_stat_inc(req->part, merges[op_stat_group(req_op(req))]);
-       part_stat_unlock();
+       if (req->rq_flags & RQF_IO_STAT) {
+               part_stat_lock();
+               part_stat_inc(req->part, merges[op_stat_group(req_op(req))]);
+               part_stat_unlock();
+       }
 }
 
 enum bio_merge_status bio_attempt_back_merge(struct request *req,
index c7220ed0392e198efe10fa0ae2e207a547c30b60..b249514c2d638482e1f02d639d391eb5b581f8b1 100644 (file)
@@ -92,7 +92,7 @@ static bool blk_mq_check_inflight(struct request *rq, void *priv)
 {
        struct mq_inflight *mi = priv;
 
-       if (blk_do_io_stat(rq) &&
+       if (rq->rq_flags & RQF_IO_STAT &&
            (!bdev_is_partition(mi->part) || rq->part == mi->part) &&
            blk_mq_rq_state(rq) == MQ_RQ_IN_FLIGHT)
                mi->inflight[rq_data_dir(rq)]++;
@@ -762,7 +762,7 @@ EXPORT_SYMBOL(blk_dump_rq_flags);
 
 static void blk_account_io_completion(struct request *req, unsigned int bytes)
 {
-       if (blk_do_io_stat(req)) {
+       if (req->rq_flags & RQF_IO_STAT) {
                const int sgrp = op_stat_group(req_op(req));
 
                part_stat_lock();
@@ -980,7 +980,7 @@ static inline void blk_account_io_done(struct request *req, u64 now)
         * normal IO on queueing nor completion.  Accounting the
         * containing request is enough.
         */
-       if (blk_do_io_stat(req) && !(req->rq_flags & RQF_FLUSH_SEQ)) {
+       if ((req->rq_flags & (RQF_IO_STAT|RQF_FLUSH_SEQ)) == RQF_IO_STAT) {
                const int sgrp = op_stat_group(req_op(req));
 
                part_stat_lock();
index 84178e535533b40276d3e690e109be7a6fb7a3c8..ea926d685e92e7bc34ad61e1568f2dce8ac53b73 100644 (file)
@@ -405,17 +405,6 @@ void blk_apply_bdi_limits(struct backing_dev_info *bdi,
                struct queue_limits *lim);
 int blk_dev_init(void);
 
-/*
- * Contribute to IO statistics IFF:
- *
- *     a) it's attached to a gendisk, and
- *     b) the queue had IO stats enabled when this request was started
- */
-static inline bool blk_do_io_stat(struct request *rq)
-{
-       return rq->rq_flags & RQF_IO_STAT;
-}
-
 void update_io_ticks(struct block_device *part, unsigned long now, bool end);
 unsigned int part_in_flight(struct block_device *part);