diff options
| author | Tony Lindgren <tony@atomide.com> | 2011-11-07 15:27:23 -0500 |
|---|---|---|
| committer | Tony Lindgren <tony@atomide.com> | 2011-11-07 15:27:23 -0500 |
| commit | d30cc16c8e48368e0518f4975a78711e53e14a0f (patch) | |
| tree | 26b57f7ab5a963cc3d6c57dff6951bd930875583 /include/linux/blkdev.h | |
| parent | 41eb2d813f558900884e240c2f723e36c7bd151f (diff) | |
| parent | a1bcc1dcef8451b4291ea2a1b2677cb194102952 (diff) | |
Merge branch 'fixes-modulesplit' into fixes
Diffstat (limited to 'include/linux/blkdev.h')
| -rw-r--r-- | include/linux/blkdev.h | 42 |
1 files changed, 18 insertions, 24 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 7fbaa9103344..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 | ||
| 24 | struct module; | ||
| 25 | struct scsi_ioctl_command; | 25 | struct scsi_ioctl_command; |
| 26 | 26 | ||
| 27 | struct request_queue; | 27 | struct request_queue; |
| @@ -195,7 +195,7 @@ struct request_pm_state | |||
| 195 | #include <linux/elevator.h> | 195 | #include <linux/elevator.h> |
| 196 | 196 | ||
| 197 | typedef void (request_fn_proc) (struct request_queue *q); | 197 | typedef void (request_fn_proc) (struct request_queue *q); |
| 198 | typedef int (make_request_fn) (struct request_queue *q, struct bio *bio); | 198 | typedef void (make_request_fn) (struct request_queue *q, struct bio *bio); |
| 199 | typedef int (prep_rq_fn) (struct request_queue *, struct request *); | 199 | typedef int (prep_rq_fn) (struct request_queue *, struct request *); |
| 200 | typedef void (unprep_rq_fn) (struct request_queue *, struct request *); | 200 | typedef 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, | |||
| 680 | extern int sg_scsi_ioctl(struct request_queue *, struct gendisk *, fmode_t, | 680 | extern 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 | ||
| 683 | extern 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,16 +865,22 @@ struct request_queue *blk_alloc_queue_node(gfp_t, int); | |||
| 863 | extern void blk_put_queue(struct request_queue *); | 865 | extern 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 | */ |
| 871 | struct blk_plug { | 879 | struct 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 | }; | 884 | }; |
| 877 | #define BLK_MAX_REQUEST_COUNT 16 | 885 | #define BLK_MAX_REQUEST_COUNT 16 |
| 878 | 886 | ||
| @@ -1189,20 +1197,6 @@ static inline uint64_t rq_io_start_time_ns(struct request *req) | |||
| 1189 | } | 1197 | } |
| 1190 | #endif | 1198 | #endif |
| 1191 | 1199 | ||
| 1192 | #ifdef CONFIG_BLK_DEV_THROTTLING | ||
| 1193 | extern int blk_throtl_init(struct request_queue *q); | ||
| 1194 | extern void blk_throtl_exit(struct request_queue *q); | ||
| 1195 | extern int blk_throtl_bio(struct request_queue *q, struct bio **bio); | ||
| 1196 | #else /* CONFIG_BLK_DEV_THROTTLING */ | ||
| 1197 | static inline int blk_throtl_bio(struct request_queue *q, struct bio **bio) | ||
| 1198 | { | ||
| 1199 | return 0; | ||
| 1200 | } | ||
| 1201 | |||
| 1202 | static inline int blk_throtl_init(struct request_queue *q) { return 0; } | ||
| 1203 | static inline int blk_throtl_exit(struct request_queue *q) { return 0; } | ||
| 1204 | #endif /* CONFIG_BLK_DEV_THROTTLING */ | ||
| 1205 | |||
| 1206 | #define MODULE_ALIAS_BLOCKDEV(major,minor) \ | 1200 | #define MODULE_ALIAS_BLOCKDEV(major,minor) \ |
| 1207 | MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor)) | 1201 | MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor)) |
| 1208 | #define MODULE_ALIAS_BLOCKDEV_MAJOR(major) \ | 1202 | #define MODULE_ALIAS_BLOCKDEV_MAJOR(major) \ |
