aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/blkdev.h
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2012-01-09 02:38:23 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2012-01-09 02:38:23 -0500
commitda733563be5a9da26fe81d9f007262d00b846e22 (patch)
treedb28291df94a2043af2123911984c5c173da4e6f /include/linux/blkdev.h
parent6ccbcf2cb41131f8d56ef0723bf3f7c1f8486076 (diff)
parentdab78d7924598ea4031663dd10db814e2e324928 (diff)
Merge branch 'next' into for-linus
Diffstat (limited to 'include/linux/blkdev.h')
-rw-r--r--include/linux/blkdev.h43
1 files changed, 18 insertions, 25 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 84b15d54f8c2..c7a6d3b5bc7b 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -14,7 +14,6 @@
14#include <linux/wait.h> 14#include <linux/wait.h>
15#include <linux/mempool.h> 15#include <linux/mempool.h>
16#include <linux/bio.h> 16#include <linux/bio.h>
17#include <linux/module.h>
18#include <linux/stringify.h> 17#include <linux/stringify.h>
19#include <linux/gfp.h> 18#include <linux/gfp.h>
20#include <linux/bsg.h> 19#include <linux/bsg.h>
@@ -22,6 +21,7 @@
22 21
23#include <asm/scatterlist.h> 22#include <asm/scatterlist.h>
24 23
24struct module;
25struct scsi_ioctl_command; 25struct scsi_ioctl_command;
26 26
27struct request_queue; 27struct request_queue;
@@ -195,7 +195,7 @@ struct request_pm_state
195#include <linux/elevator.h> 195#include <linux/elevator.h>
196 196
197typedef void (request_fn_proc) (struct request_queue *q); 197typedef void (request_fn_proc) (struct request_queue *q);
198typedef int (make_request_fn) (struct request_queue *q, struct bio *bio); 198typedef void (make_request_fn) (struct request_queue *q, struct bio *bio);
199typedef int (prep_rq_fn) (struct request_queue *, struct request *); 199typedef int (prep_rq_fn) (struct request_queue *, struct request *);
200typedef void (unprep_rq_fn) (struct request_queue *, struct request *); 200typedef void (unprep_rq_fn) (struct request_queue *, struct request *);
201 201
@@ -680,6 +680,8 @@ extern int scsi_cmd_ioctl(struct request_queue *, struct gendisk *, fmode_t,
680extern int sg_scsi_ioctl(struct request_queue *, struct gendisk *, fmode_t, 680extern int sg_scsi_ioctl(struct request_queue *, struct gendisk *, fmode_t,
681 struct scsi_ioctl_command __user *); 681 struct scsi_ioctl_command __user *);
682 682
683extern void blk_queue_bio(struct request_queue *q, struct bio *bio);
684
683/* 685/*
684 * A queue has just exitted congestion. Note this in the global counter of 686 * A queue has just exitted congestion. Note this in the global counter of
685 * congested queues, and wake up anyone who was waiting for requests to be 687 * congested queues, and wake up anyone who was waiting for requests to be
@@ -863,17 +865,22 @@ struct request_queue *blk_alloc_queue_node(gfp_t, int);
863extern void blk_put_queue(struct request_queue *); 865extern void blk_put_queue(struct request_queue *);
864 866
865/* 867/*
866 * Note: Code in between changing the blk_plug list/cb_list or element of such 868 * blk_plug permits building a queue of related requests by holding the I/O
867 * lists is preemptable, but such code can't do sleep (or be very careful), 869 * fragments for a short period. This allows merging of sequential requests
868 * otherwise data is corrupted. For details, please check schedule() where 870 * into single larger request. As the requests are moved from a per-task list to
869 * blk_schedule_flush_plug() is called. 871 * the device's request_queue in a batch, this results in improved scalability
872 * as the lock contention for request_queue lock is reduced.
873 *
874 * It is ok not to disable preemption when adding the request to the plug list
875 * or when attempting a merge, because blk_schedule_flush_list() will only flush
876 * the plug list when the task sleeps by itself. For details, please see
877 * schedule() where blk_schedule_flush_plug() is called.
870 */ 878 */
871struct blk_plug { 879struct blk_plug {
872 unsigned long magic; 880 unsigned long magic; /* detect uninitialized use-cases */
873 struct list_head list; 881 struct list_head list; /* requests */
874 struct list_head cb_list; 882 struct list_head cb_list; /* md requires an unplug callback */
875 unsigned int should_sort; 883 unsigned int should_sort; /* list to be sorted before flushing? */
876 unsigned int count;
877}; 884};
878#define BLK_MAX_REQUEST_COUNT 16 885#define BLK_MAX_REQUEST_COUNT 16
879 886
@@ -1190,20 +1197,6 @@ static inline uint64_t rq_io_start_time_ns(struct request *req)
1190} 1197}
1191#endif 1198#endif
1192 1199
1193#ifdef CONFIG_BLK_DEV_THROTTLING
1194extern int blk_throtl_init(struct request_queue *q);
1195extern void blk_throtl_exit(struct request_queue *q);
1196extern int blk_throtl_bio(struct request_queue *q, struct bio **bio);
1197#else /* CONFIG_BLK_DEV_THROTTLING */
1198static inline int blk_throtl_bio(struct request_queue *q, struct bio **bio)
1199{
1200 return 0;
1201}
1202
1203static inline int blk_throtl_init(struct request_queue *q) { return 0; }
1204static inline int blk_throtl_exit(struct request_queue *q) { return 0; }
1205#endif /* CONFIG_BLK_DEV_THROTTLING */
1206
1207#define MODULE_ALIAS_BLOCKDEV(major,minor) \ 1200#define MODULE_ALIAS_BLOCKDEV(major,minor) \
1208 MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor)) 1201 MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor))
1209#define MODULE_ALIAS_BLOCKDEV_MAJOR(major) \ 1202#define MODULE_ALIAS_BLOCKDEV_MAJOR(major) \