History

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.

Jens Axboe committed 8 years ago

Commit 85f4d4b1 parent 849a3703 files · +12 −12Browse files

Showing the changes to include/linux/blkdev.h (1 of 3 files). Show all

Unified · Split

include/linux/blkdev.h+1−1
@@ -283,7 +283,7 @@ static inline unsigned short req_get_ioprio(struct request *req) · 282 unmodified lines
283struct blk_queue_ctx;283struct blk_queue_ctx;
284 284
285typedef blk_qc_t (make_request_fn) (struct request_queue *q, struct bio *bio);285typedef blk_qc_t (make_request_fn) (struct request_queue *q, struct bio *bio);
286typedef bool (poll_q_fn) (struct request_queue *q, blk_qc_t);286typedef int (poll_q_fn) (struct request_queue *q, blk_qc_t);
287 287
288struct bio_vec;288struct bio_vec;
289typedef int (dma_drain_needed_fn)(struct request *);289typedef int (dma_drain_needed_fn)(struct request *);