On Sat, Jan 25, 2020 at 09:41:37PM -0700, Andrzej Jakowski wrote:
if ((bio->bi_opf & REQ_NOWAIT) && !queue_is_mq(q))
- goto not_supported;
+ if (!(bio->bi_opf & REQ_HIPRI))
+ goto not_supported;
Can you explain this check? This looks weird to me I think we need
a generalized check if a make_request based driver supports REQ_NOWAIT
instead (and as a separate patch / patchset).
+ if (q->bio_poll_fn != NULL) {
+ state = current->state;
+ do {
+ int ret;
+
+ ret = q->bio_poll_fn(q, cookie);
+ if (ret > 0) {
+ __set_current_state(TASK_RUNNING);
+ return ret;
+ }
+
+ if (signal_pending_state(state, current))
+ __set_current_state(TASK_RUNNING);
+
+ if (current->state == TASK_RUNNING)
+ return 1;
+ if (ret < 0 || !spin)
+ break;
+ cpu_relax();
+ } while (!need_resched());
+
+ __set_current_state(TASK_RUNNING);
+
+ return 0;
+ }
This needs to be factored out into a helper at least.