diff options
author | Alasdair G Kergon <agk@redhat.com> | 2008-07-03 03:53:43 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2008-07-03 07:21:15 -0400 |
commit | cc371e66e340f35eed8dc4651c7c18e754c7fb26 (patch) | |
tree | 5a2d6727eb07a05999c531a90da43ab1c36b713e /include/linux/blkdev.h | |
parent | b24498d477a14680fc3bb3ad884fa9fa76a2d237 (diff) |
Add bvec_merge_data to handle stacked devices and ->merge_bvec()
When devices are stacked, one device's merge_bvec_fn may need to perform
the mapping and then call one or more functions for its underlying devices.
The following bio fields are used:
bio->bi_sector
bio->bi_bdev
bio->bi_size
bio->bi_rw using bio_data_dir()
This patch creates a new struct bvec_merge_data holding a copy of those
fields to avoid having to change them directly in the struct bio when
going down the stack only to have to change them back again on the way
back up. (And then when the bio gets mapped for real, the whole
exercise gets repeated, but that's a problem for another day...)
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Cc: Neil Brown <neilb@suse.de>
Cc: Milan Broz <mbroz@redhat.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'include/linux/blkdev.h')
-rw-r--r-- | include/linux/blkdev.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 7ab8acad5b6e..ff9d0bdf2a16 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -254,7 +254,14 @@ typedef int (prep_rq_fn) (struct request_queue *, struct request *); | |||
254 | typedef void (unplug_fn) (struct request_queue *); | 254 | typedef void (unplug_fn) (struct request_queue *); |
255 | 255 | ||
256 | struct bio_vec; | 256 | struct bio_vec; |
257 | typedef int (merge_bvec_fn) (struct request_queue *, struct bio *, struct bio_vec *); | 257 | struct bvec_merge_data { |
258 | struct block_device *bi_bdev; | ||
259 | sector_t bi_sector; | ||
260 | unsigned bi_size; | ||
261 | unsigned long bi_rw; | ||
262 | }; | ||
263 | typedef int (merge_bvec_fn) (struct request_queue *, struct bvec_merge_data *, | ||
264 | struct bio_vec *); | ||
258 | typedef void (prepare_flush_fn) (struct request_queue *, struct request *); | 265 | typedef void (prepare_flush_fn) (struct request_queue *, struct request *); |
259 | typedef void (softirq_done_fn)(struct request *); | 266 | typedef void (softirq_done_fn)(struct request *); |
260 | typedef int (dma_drain_needed_fn)(struct request *); | 267 | typedef int (dma_drain_needed_fn)(struct request *); |