diff options
Diffstat (limited to 'include/linux/blkdev.h')
-rw-r--r-- | include/linux/blkdev.h | 52 |
1 files changed, 30 insertions, 22 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 031a315c0509..7035cec583b6 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -26,7 +26,6 @@ struct scsi_ioctl_command; | |||
26 | 26 | ||
27 | struct request_queue; | 27 | struct request_queue; |
28 | struct elevator_queue; | 28 | struct elevator_queue; |
29 | typedef struct elevator_queue elevator_t; | ||
30 | struct request_pm_state; | 29 | struct request_pm_state; |
31 | struct blk_trace; | 30 | struct blk_trace; |
32 | struct request; | 31 | struct request; |
@@ -313,7 +312,7 @@ struct request_queue | |||
313 | */ | 312 | */ |
314 | struct list_head queue_head; | 313 | struct list_head queue_head; |
315 | struct request *last_merge; | 314 | struct request *last_merge; |
316 | elevator_t *elevator; | 315 | struct elevator_queue *elevator; |
317 | 316 | ||
318 | /* | 317 | /* |
319 | * the queue request freelist, one for reads and one for writes | 318 | * the queue request freelist, one for reads and one for writes |
@@ -449,6 +448,7 @@ struct request_queue | |||
449 | #define QUEUE_FLAG_FAIL_IO 12 /* fake timeout */ | 448 | #define QUEUE_FLAG_FAIL_IO 12 /* fake timeout */ |
450 | #define QUEUE_FLAG_STACKABLE 13 /* supports request stacking */ | 449 | #define QUEUE_FLAG_STACKABLE 13 /* supports request stacking */ |
451 | #define QUEUE_FLAG_NONROT 14 /* non-rotational device (SSD) */ | 450 | #define QUEUE_FLAG_NONROT 14 /* non-rotational device (SSD) */ |
451 | #define QUEUE_FLAG_VIRT QUEUE_FLAG_NONROT /* paravirt device */ | ||
452 | 452 | ||
453 | static inline int queue_is_locked(struct request_queue *q) | 453 | static inline int queue_is_locked(struct request_queue *q) |
454 | { | 454 | { |
@@ -522,22 +522,32 @@ enum { | |||
522 | * TAG_FLUSH : ordering by tag w/ pre and post flushes | 522 | * TAG_FLUSH : ordering by tag w/ pre and post flushes |
523 | * TAG_FUA : ordering by tag w/ pre flush and FUA write | 523 | * TAG_FUA : ordering by tag w/ pre flush and FUA write |
524 | */ | 524 | */ |
525 | QUEUE_ORDERED_NONE = 0x00, | 525 | QUEUE_ORDERED_BY_DRAIN = 0x01, |
526 | QUEUE_ORDERED_DRAIN = 0x01, | 526 | QUEUE_ORDERED_BY_TAG = 0x02, |
527 | QUEUE_ORDERED_TAG = 0x02, | 527 | QUEUE_ORDERED_DO_PREFLUSH = 0x10, |
528 | 528 | QUEUE_ORDERED_DO_BAR = 0x20, | |
529 | QUEUE_ORDERED_PREFLUSH = 0x10, | 529 | QUEUE_ORDERED_DO_POSTFLUSH = 0x40, |
530 | QUEUE_ORDERED_POSTFLUSH = 0x20, | 530 | QUEUE_ORDERED_DO_FUA = 0x80, |
531 | QUEUE_ORDERED_FUA = 0x40, | 531 | |
532 | 532 | QUEUE_ORDERED_NONE = 0x00, | |
533 | QUEUE_ORDERED_DRAIN_FLUSH = QUEUE_ORDERED_DRAIN | | 533 | |
534 | QUEUE_ORDERED_PREFLUSH | QUEUE_ORDERED_POSTFLUSH, | 534 | QUEUE_ORDERED_DRAIN = QUEUE_ORDERED_BY_DRAIN | |
535 | QUEUE_ORDERED_DRAIN_FUA = QUEUE_ORDERED_DRAIN | | 535 | QUEUE_ORDERED_DO_BAR, |
536 | QUEUE_ORDERED_PREFLUSH | QUEUE_ORDERED_FUA, | 536 | QUEUE_ORDERED_DRAIN_FLUSH = QUEUE_ORDERED_DRAIN | |
537 | QUEUE_ORDERED_TAG_FLUSH = QUEUE_ORDERED_TAG | | 537 | QUEUE_ORDERED_DO_PREFLUSH | |
538 | QUEUE_ORDERED_PREFLUSH | QUEUE_ORDERED_POSTFLUSH, | 538 | QUEUE_ORDERED_DO_POSTFLUSH, |
539 | QUEUE_ORDERED_TAG_FUA = QUEUE_ORDERED_TAG | | 539 | QUEUE_ORDERED_DRAIN_FUA = QUEUE_ORDERED_DRAIN | |
540 | QUEUE_ORDERED_PREFLUSH | QUEUE_ORDERED_FUA, | 540 | QUEUE_ORDERED_DO_PREFLUSH | |
541 | QUEUE_ORDERED_DO_FUA, | ||
542 | |||
543 | QUEUE_ORDERED_TAG = QUEUE_ORDERED_BY_TAG | | ||
544 | QUEUE_ORDERED_DO_BAR, | ||
545 | QUEUE_ORDERED_TAG_FLUSH = QUEUE_ORDERED_TAG | | ||
546 | QUEUE_ORDERED_DO_PREFLUSH | | ||
547 | QUEUE_ORDERED_DO_POSTFLUSH, | ||
548 | QUEUE_ORDERED_TAG_FUA = QUEUE_ORDERED_TAG | | ||
549 | QUEUE_ORDERED_DO_PREFLUSH | | ||
550 | QUEUE_ORDERED_DO_FUA, | ||
541 | 551 | ||
542 | /* | 552 | /* |
543 | * Ordered operation sequence | 553 | * Ordered operation sequence |
@@ -585,7 +595,6 @@ enum { | |||
585 | #define blk_fua_rq(rq) ((rq)->cmd_flags & REQ_FUA) | 595 | #define blk_fua_rq(rq) ((rq)->cmd_flags & REQ_FUA) |
586 | #define blk_discard_rq(rq) ((rq)->cmd_flags & REQ_DISCARD) | 596 | #define blk_discard_rq(rq) ((rq)->cmd_flags & REQ_DISCARD) |
587 | #define blk_bidi_rq(rq) ((rq)->next_rq != NULL) | 597 | #define blk_bidi_rq(rq) ((rq)->next_rq != NULL) |
588 | #define blk_empty_barrier(rq) (blk_barrier_rq(rq) && blk_fs_request(rq) && !(rq)->hard_nr_sectors) | ||
589 | /* rq->queuelist of dequeued request must be list_empty() */ | 598 | /* rq->queuelist of dequeued request must be list_empty() */ |
590 | #define blk_queued_rq(rq) (!list_empty(&(rq)->queuelist)) | 599 | #define blk_queued_rq(rq) (!list_empty(&(rq)->queuelist)) |
591 | 600 | ||
@@ -855,10 +864,10 @@ extern void blk_queue_rq_timed_out(struct request_queue *, rq_timed_out_fn *); | |||
855 | extern void blk_queue_rq_timeout(struct request_queue *, unsigned int); | 864 | extern void blk_queue_rq_timeout(struct request_queue *, unsigned int); |
856 | extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev); | 865 | extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev); |
857 | extern int blk_queue_ordered(struct request_queue *, unsigned, prepare_flush_fn *); | 866 | extern int blk_queue_ordered(struct request_queue *, unsigned, prepare_flush_fn *); |
858 | extern int blk_do_ordered(struct request_queue *, struct request **); | 867 | extern bool blk_do_ordered(struct request_queue *, struct request **); |
859 | extern unsigned blk_ordered_cur_seq(struct request_queue *); | 868 | extern unsigned blk_ordered_cur_seq(struct request_queue *); |
860 | extern unsigned blk_ordered_req_seq(struct request *); | 869 | extern unsigned blk_ordered_req_seq(struct request *); |
861 | extern void blk_ordered_complete_seq(struct request_queue *, unsigned, int); | 870 | extern bool blk_ordered_complete_seq(struct request_queue *, unsigned, int); |
862 | 871 | ||
863 | extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *); | 872 | extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *); |
864 | extern void blk_dump_rq_flags(struct request *, char *); | 873 | extern void blk_dump_rq_flags(struct request *, char *); |
@@ -977,7 +986,6 @@ static inline void put_dev_sector(Sector p) | |||
977 | 986 | ||
978 | struct work_struct; | 987 | struct work_struct; |
979 | int kblockd_schedule_work(struct request_queue *q, struct work_struct *work); | 988 | int kblockd_schedule_work(struct request_queue *q, struct work_struct *work); |
980 | void kblockd_flush_work(struct work_struct *work); | ||
981 | 989 | ||
982 | #define MODULE_ALIAS_BLOCKDEV(major,minor) \ | 990 | #define MODULE_ALIAS_BLOCKDEV(major,minor) \ |
983 | MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor)) | 991 | MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor)) |