block: have ->poll_fn() return number of entries polled

We currently only really support sync poll, ie poll with 1 IO in flight.
This prepares us for supporting async poll.

Note that the returned value isn't necessarily 100% accurate. If poll
races with IRQ completion, we assume that the fact that the task is now
runnable means we found at least one entry. In reality it could be more
than 1, or not even 1. This is fine, the caller will just need to take
this into account.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
此提交包含在:
Jens Axboe
2018-11-06 13:30:55 -07:00
父節點 849a370016
當前提交 85f4d4b65f
共有 3 個檔案被更改,包括 12 行新增12 行删除

查看文件

@@ -220,11 +220,11 @@ static blk_qc_t nvme_ns_head_make_request(struct request_queue *q,
return ret;
}
static bool nvme_ns_head_poll(struct request_queue *q, blk_qc_t qc)
static int nvme_ns_head_poll(struct request_queue *q, blk_qc_t qc)
{
struct nvme_ns_head *head = q->queuedata;
struct nvme_ns *ns;
bool found = false;
int found = 0;
int srcu_idx;
srcu_idx = srcu_read_lock(&head->srcu);