History

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.

Kiyoshi Ueda committed 18 years ago

Commit e19a3ab1 parent 5e36bb62 files · +68 −6Browse files

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

Unified · Split

include/linux/blkdev.h+2−0
@@ -734,6 +734,8 @@ extern void end_that_request_last(struct request *, int); · 733 unmodified lines
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/*

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t