diff options
Diffstat (limited to 'include/linux/blkdev.h')
-rw-r--r-- | include/linux/blkdev.h | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index ec0357d8c4a..2ad95fa1d13 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -196,7 +196,6 @@ typedef void (request_fn_proc) (struct request_queue *q); | |||
196 | typedef int (make_request_fn) (struct request_queue *q, struct bio *bio); | 196 | typedef int (make_request_fn) (struct request_queue *q, struct bio *bio); |
197 | typedef int (prep_rq_fn) (struct request_queue *, struct request *); | 197 | typedef int (prep_rq_fn) (struct request_queue *, struct request *); |
198 | typedef void (unprep_rq_fn) (struct request_queue *, struct request *); | 198 | typedef void (unprep_rq_fn) (struct request_queue *, struct request *); |
199 | typedef void (unplugged_fn) (struct request_queue *); | ||
200 | 199 | ||
201 | struct bio_vec; | 200 | struct bio_vec; |
202 | struct bvec_merge_data { | 201 | struct bvec_merge_data { |
@@ -284,7 +283,6 @@ struct request_queue | |||
284 | rq_timed_out_fn *rq_timed_out_fn; | 283 | rq_timed_out_fn *rq_timed_out_fn; |
285 | dma_drain_needed_fn *dma_drain_needed; | 284 | dma_drain_needed_fn *dma_drain_needed; |
286 | lld_busy_fn *lld_busy_fn; | 285 | lld_busy_fn *lld_busy_fn; |
287 | unplugged_fn *unplugged_fn; | ||
288 | 286 | ||
289 | /* | 287 | /* |
290 | * Dispatch queue sorting | 288 | * Dispatch queue sorting |
@@ -390,20 +388,19 @@ struct request_queue | |||
390 | #define QUEUE_FLAG_SYNCFULL 3 /* read queue has been filled */ | 388 | #define QUEUE_FLAG_SYNCFULL 3 /* read queue has been filled */ |
391 | #define QUEUE_FLAG_ASYNCFULL 4 /* write queue has been filled */ | 389 | #define QUEUE_FLAG_ASYNCFULL 4 /* write queue has been filled */ |
392 | #define QUEUE_FLAG_DEAD 5 /* queue being torn down */ | 390 | #define QUEUE_FLAG_DEAD 5 /* queue being torn down */ |
393 | #define QUEUE_FLAG_REENTER 6 /* Re-entrancy avoidance */ | 391 | #define QUEUE_FLAG_ELVSWITCH 6 /* don't use elevator, just do FIFO */ |
394 | #define QUEUE_FLAG_ELVSWITCH 7 /* don't use elevator, just do FIFO */ | 392 | #define QUEUE_FLAG_BIDI 7 /* queue supports bidi requests */ |
395 | #define QUEUE_FLAG_BIDI 8 /* queue supports bidi requests */ | 393 | #define QUEUE_FLAG_NOMERGES 8 /* disable merge attempts */ |
396 | #define QUEUE_FLAG_NOMERGES 9 /* disable merge attempts */ | 394 | #define QUEUE_FLAG_SAME_COMP 9 /* force complete on same CPU */ |
397 | #define QUEUE_FLAG_SAME_COMP 10 /* force complete on same CPU */ | 395 | #define QUEUE_FLAG_FAIL_IO 10 /* fake timeout */ |
398 | #define QUEUE_FLAG_FAIL_IO 11 /* fake timeout */ | 396 | #define QUEUE_FLAG_STACKABLE 11 /* supports request stacking */ |
399 | #define QUEUE_FLAG_STACKABLE 12 /* supports request stacking */ | 397 | #define QUEUE_FLAG_NONROT 12 /* non-rotational device (SSD) */ |
400 | #define QUEUE_FLAG_NONROT 13 /* non-rotational device (SSD) */ | ||
401 | #define QUEUE_FLAG_VIRT QUEUE_FLAG_NONROT /* paravirt device */ | 398 | #define QUEUE_FLAG_VIRT QUEUE_FLAG_NONROT /* paravirt device */ |
402 | #define QUEUE_FLAG_IO_STAT 15 /* do IO stats */ | 399 | #define QUEUE_FLAG_IO_STAT 13 /* do IO stats */ |
403 | #define QUEUE_FLAG_DISCARD 16 /* supports DISCARD */ | 400 | #define QUEUE_FLAG_DISCARD 14 /* supports DISCARD */ |
404 | #define QUEUE_FLAG_NOXMERGES 17 /* No extended merges */ | 401 | #define QUEUE_FLAG_NOXMERGES 15 /* No extended merges */ |
405 | #define QUEUE_FLAG_ADD_RANDOM 18 /* Contributes to random pool */ | 402 | #define QUEUE_FLAG_ADD_RANDOM 16 /* Contributes to random pool */ |
406 | #define QUEUE_FLAG_SECDISCARD 19 /* supports SECDISCARD */ | 403 | #define QUEUE_FLAG_SECDISCARD 17 /* supports SECDISCARD */ |
407 | 404 | ||
408 | #define QUEUE_FLAG_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \ | 405 | #define QUEUE_FLAG_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \ |
409 | (1 << QUEUE_FLAG_STACKABLE) | \ | 406 | (1 << QUEUE_FLAG_STACKABLE) | \ |
@@ -699,8 +696,9 @@ extern void blk_start_queue(struct request_queue *q); | |||
699 | extern void blk_stop_queue(struct request_queue *q); | 696 | extern void blk_stop_queue(struct request_queue *q); |
700 | extern void blk_sync_queue(struct request_queue *q); | 697 | extern void blk_sync_queue(struct request_queue *q); |
701 | extern void __blk_stop_queue(struct request_queue *q); | 698 | extern void __blk_stop_queue(struct request_queue *q); |
702 | extern void __blk_run_queue(struct request_queue *q, bool force_kblockd); | 699 | extern void __blk_run_queue(struct request_queue *q); |
703 | extern void blk_run_queue(struct request_queue *); | 700 | extern void blk_run_queue(struct request_queue *); |
701 | extern void blk_run_queue_async(struct request_queue *q); | ||
704 | extern int blk_rq_map_user(struct request_queue *, struct request *, | 702 | extern int blk_rq_map_user(struct request_queue *, struct request *, |
705 | struct rq_map_data *, void __user *, unsigned long, | 703 | struct rq_map_data *, void __user *, unsigned long, |
706 | gfp_t); | 704 | gfp_t); |
@@ -843,7 +841,6 @@ extern void blk_queue_dma_alignment(struct request_queue *, int); | |||
843 | extern void blk_queue_update_dma_alignment(struct request_queue *, int); | 841 | extern void blk_queue_update_dma_alignment(struct request_queue *, int); |
844 | extern void blk_queue_softirq_done(struct request_queue *, softirq_done_fn *); | 842 | extern void blk_queue_softirq_done(struct request_queue *, softirq_done_fn *); |
845 | extern void blk_queue_rq_timed_out(struct request_queue *, rq_timed_out_fn *); | 843 | extern void blk_queue_rq_timed_out(struct request_queue *, rq_timed_out_fn *); |
846 | extern void blk_queue_unplugged(struct request_queue *, unplugged_fn *); | ||
847 | extern void blk_queue_rq_timeout(struct request_queue *, unsigned int); | 844 | extern void blk_queue_rq_timeout(struct request_queue *, unsigned int); |
848 | extern void blk_queue_flush(struct request_queue *q, unsigned int flush); | 845 | extern void blk_queue_flush(struct request_queue *q, unsigned int flush); |
849 | extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev); | 846 | extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev); |
@@ -860,8 +857,13 @@ extern void blk_put_queue(struct request_queue *); | |||
860 | struct blk_plug { | 857 | struct blk_plug { |
861 | unsigned long magic; | 858 | unsigned long magic; |
862 | struct list_head list; | 859 | struct list_head list; |
860 | struct list_head cb_list; | ||
863 | unsigned int should_sort; | 861 | unsigned int should_sort; |
864 | }; | 862 | }; |
863 | struct blk_plug_cb { | ||
864 | struct list_head list; | ||
865 | void (*callback)(struct blk_plug_cb *); | ||
866 | }; | ||
865 | 867 | ||
866 | extern void blk_start_plug(struct blk_plug *); | 868 | extern void blk_start_plug(struct blk_plug *); |
867 | extern void blk_finish_plug(struct blk_plug *); | 869 | extern void blk_finish_plug(struct blk_plug *); |
@@ -887,7 +889,7 @@ static inline bool blk_needs_flush_plug(struct task_struct *tsk) | |||
887 | { | 889 | { |
888 | struct blk_plug *plug = tsk->plug; | 890 | struct blk_plug *plug = tsk->plug; |
889 | 891 | ||
890 | return plug && !list_empty(&plug->list); | 892 | return plug && (!list_empty(&plug->list) || !list_empty(&plug->cb_list)); |
891 | } | 893 | } |
892 | 894 | ||
893 | /* | 895 | /* |