Commit e0c10752 authored by Mike Snitzer's avatar Mike Snitzer

dm rq: introduce dm_mq_kick_requeue_list()

Make it possible for a request-based target to kick the DM device's
blk-mq request_queue's requeue_list.
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
parent fbc39b4c
...@@ -336,19 +336,28 @@ static void dm_old_requeue_request(struct request *rq) ...@@ -336,19 +336,28 @@ static void dm_old_requeue_request(struct request *rq)
spin_unlock_irqrestore(q->queue_lock, flags); spin_unlock_irqrestore(q->queue_lock, flags);
} }
static void dm_mq_delay_requeue_request(struct request *rq, unsigned long msecs) static void __dm_mq_kick_requeue_list(struct request_queue *q, unsigned long msecs)
{ {
struct request_queue *q = rq->q;
unsigned long flags; unsigned long flags;
blk_mq_requeue_request(rq);
spin_lock_irqsave(q->queue_lock, flags); spin_lock_irqsave(q->queue_lock, flags);
if (!blk_queue_stopped(q)) if (!blk_queue_stopped(q))
blk_mq_delay_kick_requeue_list(q, msecs); blk_mq_delay_kick_requeue_list(q, msecs);
spin_unlock_irqrestore(q->queue_lock, flags); spin_unlock_irqrestore(q->queue_lock, flags);
} }
void dm_mq_kick_requeue_list(struct mapped_device *md)
{
__dm_mq_kick_requeue_list(dm_get_md_queue(md), 0);
}
EXPORT_SYMBOL(dm_mq_kick_requeue_list);
static void dm_mq_delay_requeue_request(struct request *rq, unsigned long msecs)
{
blk_mq_requeue_request(rq);
__dm_mq_kick_requeue_list(rq->q, msecs);
}
static void dm_requeue_original_request(struct dm_rq_target_io *tio, bool delay_requeue) static void dm_requeue_original_request(struct dm_rq_target_io *tio, bool delay_requeue)
{ {
struct mapped_device *md = tio->md; struct mapped_device *md = tio->md;
......
...@@ -55,6 +55,8 @@ void dm_mq_cleanup_mapped_device(struct mapped_device *md); ...@@ -55,6 +55,8 @@ void dm_mq_cleanup_mapped_device(struct mapped_device *md);
void dm_start_queue(struct request_queue *q); void dm_start_queue(struct request_queue *q);
void dm_stop_queue(struct request_queue *q); void dm_stop_queue(struct request_queue *q);
void dm_mq_kick_requeue_list(struct mapped_device *md);
unsigned dm_get_reserved_rq_based_ios(void); unsigned dm_get_reserved_rq_based_ios(void);
ssize_t dm_attr_rq_based_seq_io_merge_deadline_show(struct mapped_device *md, char *buf); ssize_t dm_attr_rq_based_seq_io_merge_deadline_show(struct mapped_device *md, char *buf);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment