]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - block/blk-core.c
block: move poll code to blk-mq
[mirror_ubuntu-artful-kernel.git] / block / blk-core.c
index 59f8129a42950e0d23e0e4cc28d4ab8e8e67b63e..eea246567884bc37d45d40fe75ba60bbfc12221b 100644 (file)
@@ -3312,52 +3312,6 @@ void blk_finish_plug(struct blk_plug *plug)
 }
 EXPORT_SYMBOL(blk_finish_plug);
 
-bool blk_poll(struct request_queue *q, blk_qc_t cookie)
-{
-       struct blk_plug *plug;
-       long state;
-       unsigned int queue_num;
-       struct blk_mq_hw_ctx *hctx;
-
-       if (!q->mq_ops || !q->mq_ops->poll || !blk_qc_t_valid(cookie) ||
-           !test_bit(QUEUE_FLAG_POLL, &q->queue_flags))
-               return false;
-
-       queue_num = blk_qc_t_to_queue_num(cookie);
-       hctx = q->queue_hw_ctx[queue_num];
-       hctx->poll_considered++;
-
-       plug = current->plug;
-       if (plug)
-               blk_flush_plug_list(plug, false);
-
-       state = current->state;
-       while (!need_resched()) {
-               int ret;
-
-               hctx->poll_invoked++;
-
-               ret = q->mq_ops->poll(hctx, blk_qc_t_to_tag(cookie));
-               if (ret > 0) {
-                       hctx->poll_success++;
-                       set_current_state(TASK_RUNNING);
-                       return true;
-               }
-
-               if (signal_pending_state(state, current))
-                       set_current_state(TASK_RUNNING);
-
-               if (current->state == TASK_RUNNING)
-                       return true;
-               if (ret < 0)
-                       break;
-               cpu_relax();
-       }
-
-       return false;
-}
-EXPORT_SYMBOL_GPL(blk_poll);
-
 #ifdef CONFIG_PM
 /**
  * blk_pm_runtime_init - Block layer runtime PM initialization routine