aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/blkdev.h
diff options
context:
space:
mode:
authorKiyoshi Ueda <k-ueda@ct.jp.nec.com>2007-12-11 17:51:02 -0500
committerJens Axboe <jens.axboe@oracle.com>2008-01-28 04:37:04 -0500
commite19a3ab058fe91c8c54d43dc56dccf7eb386478e (patch)
treef62d5af2338484e8a3eec1dc453dec4f949024a7 /include/linux/blkdev.h
parent5e36bb6ee8d5ff6c6114b60d2aaa1c70d4275f4e (diff)
blk_end_request: add callback feature (take 4)
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. Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com> Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'include/linux/blkdev.h')
-rw-r--r--include/linux/blkdev.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index aa2341df7932..63fe7542b3fa 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -734,6 +734,8 @@ extern void end_that_request_last(struct request *, int);
734extern void end_request(struct request *, int); 734extern void end_request(struct request *, int);
735extern void end_queued_request(struct request *, int); 735extern void end_queued_request(struct request *, int);
736extern void end_dequeued_request(struct request *, int); 736extern void end_dequeued_request(struct request *, int);
737extern int blk_end_request_callback(struct request *rq, int error, int nr_bytes,
738 int (drv_callback)(struct request *));
737extern void blk_complete_request(struct request *); 739extern void blk_complete_request(struct request *);
738 740
739/* 741/*