]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - include/linux/blk-mq.h
blk-mq: introduce .get_budget and .put_budget in blk_mq_ops
[linux.git] / include / linux / blk-mq.h
index 50c6485cb04f5d4f306ef794758e280113b5756a..901457df3d64dd74bea45088c5035d502d461f08 100644 (file)
@@ -90,6 +90,8 @@ struct blk_mq_queue_data {
 
 typedef blk_status_t (queue_rq_fn)(struct blk_mq_hw_ctx *,
                const struct blk_mq_queue_data *);
+typedef blk_status_t (get_budget_fn)(struct blk_mq_hw_ctx *);
+typedef void (put_budget_fn)(struct blk_mq_hw_ctx *);
 typedef enum blk_eh_timer_return (timeout_fn)(struct request *, bool);
 typedef int (init_hctx_fn)(struct blk_mq_hw_ctx *, void *, unsigned int);
 typedef void (exit_hctx_fn)(struct blk_mq_hw_ctx *, unsigned int);
@@ -111,6 +113,15 @@ struct blk_mq_ops {
         */
        queue_rq_fn             *queue_rq;
 
+       /*
+        * Reserve budget before queue request, once .queue_rq is
+        * run, it is driver's responsibility to release the
+        * reserved budget. Also we have to handle failure case
+        * of .get_budget for avoiding I/O deadlock.
+        */
+       get_budget_fn           *get_budget;
+       put_budget_fn           *put_budget;
+
        /*
         * Called on request timeout
         */