Skip to content

Commit

Permalink
block: add blk_start_queue_async()
Browse files Browse the repository at this point in the history
We currently only have an inline/sync helper to restart a stopped
queue. If drivers need an async version, they have to roll their
own. Add a generic helper instead.

Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
axboe committed Dec 28, 2015
1 parent d380561 commit 2149141
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions block/blk-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,22 @@ void blk_delay_queue(struct request_queue *q, unsigned long msecs)
}
EXPORT_SYMBOL(blk_delay_queue);

/**
* blk_start_queue_async - asynchronously restart a previously stopped queue
* @q: The &struct request_queue in question
*
* Description:
* blk_start_queue_async() will clear the stop flag on the queue, and
* ensure that the request_fn for the queue is run from an async
* context.
**/
void blk_start_queue_async(struct request_queue *q)
{
queue_flag_clear(QUEUE_FLAG_STOPPED, q);
blk_run_queue_async(q);
}
EXPORT_SYMBOL(blk_start_queue_async);

/**
* blk_start_queue - restart a previously stopped queue
* @q: The &struct request_queue in question
Expand Down
1 change: 1 addition & 0 deletions include/linux/blkdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -797,6 +797,7 @@ extern int sg_scsi_ioctl(struct request_queue *, struct gendisk *, fmode_t,
extern int blk_queue_enter(struct request_queue *q, gfp_t gfp);
extern void blk_queue_exit(struct request_queue *q);
extern void blk_start_queue(struct request_queue *q);
extern void blk_start_queue_async(struct request_queue *q);
extern void blk_stop_queue(struct request_queue *q);
extern void blk_sync_queue(struct request_queue *q);
extern void __blk_stop_queue(struct request_queue *q);
Expand Down

0 comments on commit 2149141

Please sign in to comment.