diff options
Diffstat (limited to 'include/linux/blkdev.h')
| -rw-r--r-- | include/linux/blkdev.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 3899acc8a4f1..32a8cddd2ca3 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -349,6 +349,30 @@ static inline request_queue_t *bdev_get_queue(struct block_device *bdev) } /* + * end_request() and friends. Must be called with the request queue spinlock + * acquired. All functions called within end_request() _must_be_ atomic. + * + * Several drivers define their own end_request and call + * end_that_request_first() and end_that_request_last() + * for parts of the original function. This prevents + * code duplication in drivers. + */ +extern int end_that_request_first(struct request *, int, int); +extern int end_that_request_chunk(struct request *, int, int); +extern void end_that_request_last(struct request *); +extern void end_request(struct request *req, int uptodate); + +static inline void blkdev_dequeue_request(struct request *req) +{ + BUG_ON(list_empty(&req->queuelist)); + + list_del_init(&req->queuelist); + + if (req->q) + elv_remove_request(req->q, req); +} + +/* * get ready for proper ref counting */ #define blk_put_queue(q) do { } while (0) |
