This patch adds a variant of the interface, blk_end_request_callback(), which has driver callback feature. Drivers may need to do special works between end_that_request_first() and end_that_request_last(). For such drivers, blk_end_request_callback() allows it to pass a callback function which is called between end_that_request_first() and end_that_request_last(). This interface is only for fallback of other blk_end_request interfaces. Drivers should avoid their tricky behaviors and use other interfaces as much as possible. Currently, only one driver, ide-cd, needs this interface. So this interface should/will be removed, after the driver removes such tricky behaviors. o ide-cd (cdrom_newpc_intr()) In PIO mode, cdrom_newpc_intr() needs to defer end_that_request_last() until the device clears DRQ_STAT and raises an interrupt after end_that_request_first(). So end_that_request_first() and end_that_request_last() are called separately in cdrom_newpc_intr(). This means blk_end_request_callback() has to return without completing request even if no leftover in the request. To satisfy the requirement, callback function has return value so that drivers can tell blk_end_request_callback() to return without completing request.
Showing the changes to include/linux/blkdev.h (1 of 2 files). Show all
Unified · Split
| @@ -734,6 +734,8 @@ extern void end_that_request_last(struct request *, int); · 733 unmodified lines | |||
| 734 | extern void end_request(struct request *, int); | 734 | extern void end_request(struct request *, int); |
| 735 | extern void end_queued_request(struct request *, int); | 735 | extern void end_queued_request(struct request *, int); |
| 736 | extern void end_dequeued_request(struct request *, int); | 736 | extern void end_dequeued_request(struct request *, int); |
| 737 | extern int blk_end_request_callback(struct request *rq, int error, int nr_bytes, | ||
| 738 | int (drv_callback)(struct request *)); | ||
| 737 | extern void blk_complete_request(struct request *); | 739 | extern void blk_complete_request(struct request *); |
| 738 | 740 | ||
| 739 | /* | 741 | /* |