On 5/3/20 1:54 AM, Ming Lei wrote:
Now request is thought as in-flight only when its state is updated as MQ_RQ_IN_FLIGHT, which is done by driver via blk_mq_start_request(). Actually from blk-mq's view, one rq can be thought as in-flight after its tag is >= 0. Passing one rq filter callback so that we can iterating requests very flexible. Implement blk_mq_all_tag_busy_iter() which accepts a 'busy_fn' argument to filter over which commands to iterate, and make the existing blk_mq_tag_busy_iter() a wrapper for the new function. Cc: John Garry <john.garry@xxxxxxxxxx> Cc: Bart Van Assche <bvanassche@xxxxxxx> Cc: Hannes Reinecke <hare@xxxxxxxx> Cc: Christoph Hellwig <hch@xxxxxx> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx> Reviewed-by: Christoph Hellwig <hch@xxxxxx> Signed-off-by: Ming Lei <ming.lei@xxxxxxxxxx> --- block/blk-mq-tag.c | 39 +++++++++++++++++++++++++++------------ block/blk-mq-tag.h | 4 ++++ 2 files changed, 31 insertions(+), 12 deletions(-)
Reviewed-by: Hannes Reinecke <hare@xxxxxxx> Cheers, Hannes -- Dr. Hannes Reinecke Teamlead Storage & Networking hare@xxxxxxx +49 911 74053 688 SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer