diff options
| author | Jens Axboe <axboe@suse.de> | 2005-03-07 17:49:01 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-03-07 17:49:01 -0800 |
| commit | e8be9091faa43e75879ec238d0171b6f3484d61c (patch) | |
| tree | a8cdf9c31e645d0de2b5822b43bbe0b7b91a824c /include/linux | |
| parent | cd67725a0cede85ca80348333efdd7063e3ebfb7 (diff) | |
[PATCH] Add struct request end_io callback
This is needed for several things, one in-tree user which I will introduce
after this patch.
This adds a ->end_io callback to struct request, so it can be used with
async io of any sort. Right now users have to wait for completion in a
blocking manner. In the next iteration, ->waiting can be folded into
->end_io_data since it is just a special case of that use.
From: Peter Osterlund <petero2@telia.com>
The problem is that the add-struct-request-end_io-callback patch forgot to
update pktcdvd.c. This patch fixes it.
Signed-off-by: Jens Axboe <axboe@suse.de>
Signed-off-by: Peter Osterlund <petero2@telia.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/blkdev.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 5615a3c9e410..c7553066b917 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -93,6 +93,9 @@ struct io_context *get_io_context(int gfp_flags); void copy_io_context(struct io_context **pdst, struct io_context **psrc); void swap_io_context(struct io_context **ioc1, struct io_context **ioc2); +struct request; +typedef void (rq_end_io_fn)(struct request *); + struct request_list { int count[2]; int starved[2]; @@ -176,6 +179,12 @@ struct request { * For Power Management requests */ struct request_pm_state *pm; + + /* + * completion callback. end_io_data should be folded in with waiting + */ + rq_end_io_fn *end_io; + void *end_io_data; }; /* @@ -509,10 +518,10 @@ extern void blk_unregister_queue(struct gendisk *disk); extern void register_disk(struct gendisk *dev); extern void generic_make_request(struct bio *bio); extern void blk_put_request(struct request *); +extern void blk_end_sync_rq(struct request *rq); extern void blk_attempt_remerge(request_queue_t *, struct request *); extern void __blk_attempt_remerge(request_queue_t *, struct request *); extern struct request *blk_get_request(request_queue_t *, int, int); -extern void blk_put_request(struct request *); extern void blk_insert_request(request_queue_t *, struct request *, int, void *, int); extern void blk_requeue_request(request_queue_t *, struct request *); extern void blk_plug_device(request_queue_t *); |
