diff options
Diffstat (limited to 'include/linux/blkdev.h')
-rw-r--r-- | include/linux/blkdev.h | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index b126c6f68e27..5ed888b04b29 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef _LINUX_BLKDEV_H | 1 | #ifndef _LINUX_BLKDEV_H |
2 | #define _LINUX_BLKDEV_H | 2 | #define _LINUX_BLKDEV_H |
3 | 3 | ||
4 | #ifdef CONFIG_BLOCK | ||
5 | |||
4 | #include <linux/sched.h> | 6 | #include <linux/sched.h> |
5 | #include <linux/major.h> | 7 | #include <linux/major.h> |
6 | #include <linux/genhd.h> | 8 | #include <linux/genhd.h> |
@@ -18,22 +20,6 @@ | |||
18 | 20 | ||
19 | #include <asm/scatterlist.h> | 21 | #include <asm/scatterlist.h> |
20 | 22 | ||
21 | #ifdef CONFIG_LBD | ||
22 | # include <asm/div64.h> | ||
23 | # define sector_div(a, b) do_div(a, b) | ||
24 | #else | ||
25 | # define sector_div(n, b)( \ | ||
26 | { \ | ||
27 | int _res; \ | ||
28 | _res = (n) % (b); \ | ||
29 | (n) /= (b); \ | ||
30 | _res; \ | ||
31 | } \ | ||
32 | ) | ||
33 | #endif | ||
34 | |||
35 | #ifdef CONFIG_BLOCK | ||
36 | |||
37 | struct scsi_ioctl_command; | 23 | struct scsi_ioctl_command; |
38 | 24 | ||
39 | struct request_queue; | 25 | struct request_queue; |
@@ -471,7 +457,6 @@ struct request_queue | |||
471 | int orderr, ordcolor; | 457 | int orderr, ordcolor; |
472 | struct request pre_flush_rq, bar_rq, post_flush_rq; | 458 | struct request pre_flush_rq, bar_rq, post_flush_rq; |
473 | struct request *orig_bar_rq; | 459 | struct request *orig_bar_rq; |
474 | unsigned int bi_size; | ||
475 | 460 | ||
476 | struct mutex sysfs_lock; | 461 | struct mutex sysfs_lock; |
477 | 462 | ||
@@ -637,10 +622,23 @@ static inline void blk_queue_bounce(struct request_queue *q, struct bio **bio) | |||
637 | } | 622 | } |
638 | #endif /* CONFIG_MMU */ | 623 | #endif /* CONFIG_MMU */ |
639 | 624 | ||
640 | #define rq_for_each_bio(_bio, rq) \ | 625 | struct req_iterator { |
626 | int i; | ||
627 | struct bio *bio; | ||
628 | }; | ||
629 | |||
630 | /* This should not be used directly - use rq_for_each_segment */ | ||
631 | #define __rq_for_each_bio(_bio, rq) \ | ||
641 | if ((rq->bio)) \ | 632 | if ((rq->bio)) \ |
642 | for (_bio = (rq)->bio; _bio; _bio = _bio->bi_next) | 633 | for (_bio = (rq)->bio; _bio; _bio = _bio->bi_next) |
643 | 634 | ||
635 | #define rq_for_each_segment(bvl, _rq, _iter) \ | ||
636 | __rq_for_each_bio(_iter.bio, _rq) \ | ||
637 | bio_for_each_segment(bvl, _iter.bio, _iter.i) | ||
638 | |||
639 | #define rq_iter_last(rq, _iter) \ | ||
640 | (_iter.bio->bi_next == NULL && _iter.i == _iter.bio->bi_vcnt-1) | ||
641 | |||
644 | extern int blk_register_queue(struct gendisk *disk); | 642 | extern int blk_register_queue(struct gendisk *disk); |
645 | extern void blk_unregister_queue(struct gendisk *disk); | 643 | extern void blk_unregister_queue(struct gendisk *disk); |
646 | extern void register_disk(struct gendisk *dev); | 644 | extern void register_disk(struct gendisk *dev); |
@@ -662,8 +660,8 @@ extern int sg_scsi_ioctl(struct file *, struct request_queue *, | |||
662 | /* | 660 | /* |
663 | * Temporary export, until SCSI gets fixed up. | 661 | * Temporary export, until SCSI gets fixed up. |
664 | */ | 662 | */ |
665 | extern int ll_back_merge_fn(struct request_queue *, struct request *, | 663 | extern int blk_rq_append_bio(struct request_queue *q, struct request *rq, |
666 | struct bio *); | 664 | struct bio *bio); |
667 | 665 | ||
668 | /* | 666 | /* |
669 | * A queue has just exitted congestion. Note this in the global counter of | 667 | * A queue has just exitted congestion. Note this in the global counter of |
@@ -810,7 +808,6 @@ static inline struct request *blk_map_queue_find_tag(struct blk_queue_tag *bqt, | |||
810 | return bqt->tag_index[tag]; | 808 | return bqt->tag_index[tag]; |
811 | } | 809 | } |
812 | 810 | ||
813 | extern void blk_rq_bio_prep(struct request_queue *, struct request *, struct bio *); | ||
814 | extern int blkdev_issue_flush(struct block_device *, sector_t *); | 811 | extern int blkdev_issue_flush(struct block_device *, sector_t *); |
815 | 812 | ||
816 | #define MAX_PHYS_SEGMENTS 128 | 813 | #define MAX_PHYS_SEGMENTS 128 |