blk-flush: count inflight flush_data requests
authorChengming Zhou <zhouchengming@bytedance.com>
Mon, 17 Jul 2023 04:00:57 +0000 (12:00 +0800)
committerJens Axboe <axboe@kernel.dk>
Mon, 17 Jul 2023 14:18:21 +0000 (08:18 -0600)
commitb175c86739d38e41044d3136065f092a6d95aee6
treedb2a72218bc869280bb959bf45f69eea64be17a4
parent28b241237470981a96fbd82077c8044466b61e5f
blk-flush: count inflight flush_data requests

The flush state machine use a double list to link all inflight
flush_data requests, to avoid issuing separate post-flushes for
these flush_data requests which shared PREFLUSH.

So we can't reuse rq->queuelist, this is why we need rq->flush.list

In preparation of the next patch that reuse rq->queuelist for flush
state machine, we change the double linked list to unsigned long
counter, which count all inflight flush_data requests.

This is ok since we only need to know if there is any inflight
flush_data request, so unsigned long counter is good.

Signed-off-by: Chengming Zhou <zhouchengming@bytedance.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20230717040058.3993930-4-chengming.zhou@linux.dev
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-flush.c
block/blk.h