aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/blkdev.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/blkdev.h')
-rw-r--r--include/linux/blkdev.h25
1 files changed, 18 insertions, 7 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index b126c6f68e27..95be0ac57e76 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>
@@ -32,8 +34,6 @@
32) 34)
33#endif 35#endif
34 36
35#ifdef CONFIG_BLOCK
36
37struct scsi_ioctl_command; 37struct scsi_ioctl_command;
38 38
39struct request_queue; 39struct request_queue;
@@ -471,7 +471,6 @@ struct request_queue
471 int orderr, ordcolor; 471 int orderr, ordcolor;
472 struct request pre_flush_rq, bar_rq, post_flush_rq; 472 struct request pre_flush_rq, bar_rq, post_flush_rq;
473 struct request *orig_bar_rq; 473 struct request *orig_bar_rq;
474 unsigned int bi_size;
475 474
476 struct mutex sysfs_lock; 475 struct mutex sysfs_lock;
477 476
@@ -637,10 +636,23 @@ static inline void blk_queue_bounce(struct request_queue *q, struct bio **bio)
637} 636}
638#endif /* CONFIG_MMU */ 637#endif /* CONFIG_MMU */
639 638
640#define rq_for_each_bio(_bio, rq) \ 639struct req_iterator {
640 int i;
641 struct bio *bio;
642};
643
644/* This should not be used directly - use rq_for_each_segment */
645#define __rq_for_each_bio(_bio, rq) \
641 if ((rq->bio)) \ 646 if ((rq->bio)) \
642 for (_bio = (rq)->bio; _bio; _bio = _bio->bi_next) 647 for (_bio = (rq)->bio; _bio; _bio = _bio->bi_next)
643 648
649#define rq_for_each_segment(bvl, _rq, _iter) \
650 __rq_for_each_bio(_iter.bio, _rq) \
651 bio_for_each_segment(bvl, _iter.bio, _iter.i)
652
653#define rq_iter_last(rq, _iter) \
654 (_iter.bio->bi_next == NULL && _iter.i == _iter.bio->bi_vcnt-1)
655
644extern int blk_register_queue(struct gendisk *disk); 656extern int blk_register_queue(struct gendisk *disk);
645extern void blk_unregister_queue(struct gendisk *disk); 657extern void blk_unregister_queue(struct gendisk *disk);
646extern void register_disk(struct gendisk *dev); 658extern void register_disk(struct gendisk *dev);
@@ -662,8 +674,8 @@ extern int sg_scsi_ioctl(struct file *, struct request_queue *,
662/* 674/*
663 * Temporary export, until SCSI gets fixed up. 675 * Temporary export, until SCSI gets fixed up.
664 */ 676 */
665extern int ll_back_merge_fn(struct request_queue *, struct request *, 677extern int blk_rq_append_bio(struct request_queue *q, struct request *rq,
666 struct bio *); 678 struct bio *bio);
667 679
668/* 680/*
669 * A queue has just exitted congestion. Note this in the global counter of 681 * A queue has just exitted congestion. Note this in the global counter of
@@ -810,7 +822,6 @@ static inline struct request *blk_map_queue_find_tag(struct blk_queue_tag *bqt,
810 return bqt->tag_index[tag]; 822 return bqt->tag_index[tag];
811} 823}
812 824
813extern void blk_rq_bio_prep(struct request_queue *, struct request *, struct bio *);
814extern int blkdev_issue_flush(struct block_device *, sector_t *); 825extern int blkdev_issue_flush(struct block_device *, sector_t *);
815 826
816#define MAX_PHYS_SEGMENTS 128 827#define MAX_PHYS_SEGMENTS 128