summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2021-09-27 13:43:09 -0600
committerJens Axboe <axboe@kernel.dk>2021-09-27 13:43:50 -0600
commit35cb9931c404e84ca826f22b53915a2d315f4096 (patch)
treef58fe6e440e7e5d68cdae1f04fed6978c16862ef
parenta53f4e0fb5eb8b1d8ecd065af86a32865e6e7b9e (diff)
block: add non-queue running variant of blk_execute_rq_nowait()
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--block/blk-exec.c33
-rw-r--r--include/linux/blkdev.h2
2 files changed, 22 insertions, 13 deletions
diff --git a/block/blk-exec.c b/block/blk-exec.c
index d6cd501c0d34..5fa3d735b9c8 100644
--- a/block/blk-exec.c
+++ b/block/blk-exec.c
@@ -30,6 +30,25 @@ static void blk_end_sync_rq(struct request *rq, blk_status_t error)
complete(waiting);
}
+void __blk_execute_rq_nowait(struct gendisk *bd_disk, struct request *rq,
+ bool at_head, bool run_queue, rq_end_io_fn *done)
+{
+ WARN_ON(irqs_disabled());
+ WARN_ON(!blk_rq_is_passthrough(rq));
+
+ rq->rq_disk = bd_disk;
+ rq->end_io = done;
+
+ blk_account_io_start(rq);
+
+ /*
+ * don't check dying flag for MQ because the request won't
+ * be reused after dying flag is set
+ */
+ blk_mq_sched_insert_request(rq, at_head, run_queue, false);
+}
+EXPORT_SYMBOL_GPL(__blk_execute_rq_nowait);
+
/**
* blk_execute_rq_nowait - insert a request to I/O scheduler for execution
* @bd_disk: matching gendisk
@@ -47,19 +66,7 @@ static void blk_end_sync_rq(struct request *rq, blk_status_t error)
void blk_execute_rq_nowait(struct gendisk *bd_disk, struct request *rq,
int at_head, rq_end_io_fn *done)
{
- WARN_ON(irqs_disabled());
- WARN_ON(!blk_rq_is_passthrough(rq));
-
- rq->rq_disk = bd_disk;
- rq->end_io = done;
-
- blk_account_io_start(rq);
-
- /*
- * don't check dying flag for MQ because the request won't
- * be reused after dying flag is set
- */
- blk_mq_sched_insert_request(rq, at_head, true, false);
+ __blk_execute_rq_nowait(bd_disk, rq, false, true, done);
}
EXPORT_SYMBOL_GPL(blk_execute_rq_nowait);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 568ee1ff5bf2..79d8dbdbf319 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -893,6 +893,8 @@ extern int blk_rq_map_user_iov(struct request_queue *, struct request *,
gfp_t);
extern void blk_execute_rq_nowait(struct gendisk *,
struct request *, int, rq_end_io_fn *);
+void __blk_execute_rq_nowait(struct gendisk *,
+ struct request *, bool, bool, rq_end_io_fn *);
blk_status_t blk_execute_rq(struct gendisk *bd_disk, struct request *rq,
int at_head);