diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/blk_types.h | 5 | ||||
-rw-r--r-- | include/linux/blkdev.h | 101 | ||||
-rw-r--r-- | include/linux/buffer_head.h | 2 | ||||
-rw-r--r-- | include/linux/fs.h | 28 | ||||
-rw-r--r-- | include/scsi/scsi_tcq.h | 6 |
5 files changed, 36 insertions, 106 deletions
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index d36629620a4f..0437ab6bb54c 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h | |||
@@ -146,7 +146,6 @@ enum rq_flag_bits { | |||
146 | __REQ_FAILED, /* set if the request failed */ | 146 | __REQ_FAILED, /* set if the request failed */ |
147 | __REQ_QUIET, /* don't worry about errors */ | 147 | __REQ_QUIET, /* don't worry about errors */ |
148 | __REQ_PREEMPT, /* set for "ide_preempt" requests */ | 148 | __REQ_PREEMPT, /* set for "ide_preempt" requests */ |
149 | __REQ_ORDERED_COLOR, /* is before or after barrier */ | ||
150 | __REQ_ALLOCED, /* request came from our alloc pool */ | 149 | __REQ_ALLOCED, /* request came from our alloc pool */ |
151 | __REQ_COPY_USER, /* contains copies of user pages */ | 150 | __REQ_COPY_USER, /* contains copies of user pages */ |
152 | __REQ_FLUSH, /* request for cache flush */ | 151 | __REQ_FLUSH, /* request for cache flush */ |
@@ -170,7 +169,8 @@ enum rq_flag_bits { | |||
170 | (REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER) | 169 | (REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER) |
171 | #define REQ_COMMON_MASK \ | 170 | #define REQ_COMMON_MASK \ |
172 | (REQ_WRITE | REQ_FAILFAST_MASK | REQ_HARDBARRIER | REQ_SYNC | \ | 171 | (REQ_WRITE | REQ_FAILFAST_MASK | REQ_HARDBARRIER | REQ_SYNC | \ |
173 | REQ_META| REQ_DISCARD | REQ_NOIDLE) | 172 | REQ_META | REQ_DISCARD | REQ_NOIDLE | REQ_FLUSH | REQ_FUA) |
173 | #define REQ_CLONE_MASK REQ_COMMON_MASK | ||
174 | 174 | ||
175 | #define REQ_UNPLUG (1 << __REQ_UNPLUG) | 175 | #define REQ_UNPLUG (1 << __REQ_UNPLUG) |
176 | #define REQ_RAHEAD (1 << __REQ_RAHEAD) | 176 | #define REQ_RAHEAD (1 << __REQ_RAHEAD) |
@@ -187,7 +187,6 @@ enum rq_flag_bits { | |||
187 | #define REQ_FAILED (1 << __REQ_FAILED) | 187 | #define REQ_FAILED (1 << __REQ_FAILED) |
188 | #define REQ_QUIET (1 << __REQ_QUIET) | 188 | #define REQ_QUIET (1 << __REQ_QUIET) |
189 | #define REQ_PREEMPT (1 << __REQ_PREEMPT) | 189 | #define REQ_PREEMPT (1 << __REQ_PREEMPT) |
190 | #define REQ_ORDERED_COLOR (1 << __REQ_ORDERED_COLOR) | ||
191 | #define REQ_ALLOCED (1 << __REQ_ALLOCED) | 190 | #define REQ_ALLOCED (1 << __REQ_ALLOCED) |
192 | #define REQ_COPY_USER (1 << __REQ_COPY_USER) | 191 | #define REQ_COPY_USER (1 << __REQ_COPY_USER) |
193 | #define REQ_FLUSH (1 << __REQ_FLUSH) | 192 | #define REQ_FLUSH (1 << __REQ_FLUSH) |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 16f7f1be1acf..009b80e49f53 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -360,12 +360,14 @@ struct request_queue | |||
360 | struct blk_trace *blk_trace; | 360 | struct blk_trace *blk_trace; |
361 | #endif | 361 | #endif |
362 | /* | 362 | /* |
363 | * reserved for flush operations | 363 | * for flush operations |
364 | */ | 364 | */ |
365 | unsigned int ordered, next_ordered, ordseq; | 365 | unsigned int flush_flags; |
366 | int orderr, ordcolor; | 366 | unsigned int flush_seq; |
367 | struct request pre_flush_rq, bar_rq, post_flush_rq; | 367 | int flush_err; |
368 | struct request *orig_bar_rq; | 368 | struct request flush_rq; |
369 | struct request *orig_flush_rq; | ||
370 | struct list_head pending_flushes; | ||
369 | 371 | ||
370 | struct mutex sysfs_lock; | 372 | struct mutex sysfs_lock; |
371 | 373 | ||
@@ -472,56 +474,6 @@ static inline void queue_flag_clear(unsigned int flag, struct request_queue *q) | |||
472 | __clear_bit(flag, &q->queue_flags); | 474 | __clear_bit(flag, &q->queue_flags); |
473 | } | 475 | } |
474 | 476 | ||
475 | enum { | ||
476 | /* | ||
477 | * Hardbarrier is supported with one of the following methods. | ||
478 | * | ||
479 | * NONE : hardbarrier unsupported | ||
480 | * DRAIN : ordering by draining is enough | ||
481 | * DRAIN_FLUSH : ordering by draining w/ pre and post flushes | ||
482 | * DRAIN_FUA : ordering by draining w/ pre flush and FUA write | ||
483 | * TAG : ordering by tag is enough | ||
484 | * TAG_FLUSH : ordering by tag w/ pre and post flushes | ||
485 | * TAG_FUA : ordering by tag w/ pre flush and FUA write | ||
486 | */ | ||
487 | QUEUE_ORDERED_BY_DRAIN = 0x01, | ||
488 | QUEUE_ORDERED_BY_TAG = 0x02, | ||
489 | QUEUE_ORDERED_DO_PREFLUSH = 0x10, | ||
490 | QUEUE_ORDERED_DO_BAR = 0x20, | ||
491 | QUEUE_ORDERED_DO_POSTFLUSH = 0x40, | ||
492 | QUEUE_ORDERED_DO_FUA = 0x80, | ||
493 | |||
494 | QUEUE_ORDERED_NONE = 0x00, | ||
495 | |||
496 | QUEUE_ORDERED_DRAIN = QUEUE_ORDERED_BY_DRAIN | | ||
497 | QUEUE_ORDERED_DO_BAR, | ||
498 | QUEUE_ORDERED_DRAIN_FLUSH = QUEUE_ORDERED_DRAIN | | ||
499 | QUEUE_ORDERED_DO_PREFLUSH | | ||
500 | QUEUE_ORDERED_DO_POSTFLUSH, | ||
501 | QUEUE_ORDERED_DRAIN_FUA = QUEUE_ORDERED_DRAIN | | ||
502 | QUEUE_ORDERED_DO_PREFLUSH | | ||
503 | QUEUE_ORDERED_DO_FUA, | ||
504 | |||
505 | QUEUE_ORDERED_TAG = QUEUE_ORDERED_BY_TAG | | ||
506 | QUEUE_ORDERED_DO_BAR, | ||
507 | QUEUE_ORDERED_TAG_FLUSH = QUEUE_ORDERED_TAG | | ||
508 | QUEUE_ORDERED_DO_PREFLUSH | | ||
509 | QUEUE_ORDERED_DO_POSTFLUSH, | ||
510 | QUEUE_ORDERED_TAG_FUA = QUEUE_ORDERED_TAG | | ||
511 | QUEUE_ORDERED_DO_PREFLUSH | | ||
512 | QUEUE_ORDERED_DO_FUA, | ||
513 | |||
514 | /* | ||
515 | * Ordered operation sequence | ||
516 | */ | ||
517 | QUEUE_ORDSEQ_STARTED = 0x01, /* flushing in progress */ | ||
518 | QUEUE_ORDSEQ_DRAIN = 0x02, /* waiting for the queue to be drained */ | ||
519 | QUEUE_ORDSEQ_PREFLUSH = 0x04, /* pre-flushing in progress */ | ||
520 | QUEUE_ORDSEQ_BAR = 0x08, /* original barrier req in progress */ | ||
521 | QUEUE_ORDSEQ_POSTFLUSH = 0x10, /* post-flushing in progress */ | ||
522 | QUEUE_ORDSEQ_DONE = 0x20, | ||
523 | }; | ||
524 | |||
525 | #define blk_queue_plugged(q) test_bit(QUEUE_FLAG_PLUGGED, &(q)->queue_flags) | 477 | #define blk_queue_plugged(q) test_bit(QUEUE_FLAG_PLUGGED, &(q)->queue_flags) |
526 | #define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags) | 478 | #define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags) |
527 | #define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) | 479 | #define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) |
@@ -531,7 +483,6 @@ enum { | |||
531 | #define blk_queue_nonrot(q) test_bit(QUEUE_FLAG_NONROT, &(q)->queue_flags) | 483 | #define blk_queue_nonrot(q) test_bit(QUEUE_FLAG_NONROT, &(q)->queue_flags) |
532 | #define blk_queue_io_stat(q) test_bit(QUEUE_FLAG_IO_STAT, &(q)->queue_flags) | 484 | #define blk_queue_io_stat(q) test_bit(QUEUE_FLAG_IO_STAT, &(q)->queue_flags) |
533 | #define blk_queue_add_random(q) test_bit(QUEUE_FLAG_ADD_RANDOM, &(q)->queue_flags) | 485 | #define blk_queue_add_random(q) test_bit(QUEUE_FLAG_ADD_RANDOM, &(q)->queue_flags) |
534 | #define blk_queue_flushing(q) ((q)->ordseq) | ||
535 | #define blk_queue_stackable(q) \ | 486 | #define blk_queue_stackable(q) \ |
536 | test_bit(QUEUE_FLAG_STACKABLE, &(q)->queue_flags) | 487 | test_bit(QUEUE_FLAG_STACKABLE, &(q)->queue_flags) |
537 | #define blk_queue_discard(q) test_bit(QUEUE_FLAG_DISCARD, &(q)->queue_flags) | 488 | #define blk_queue_discard(q) test_bit(QUEUE_FLAG_DISCARD, &(q)->queue_flags) |
@@ -602,7 +553,8 @@ static inline void blk_clear_queue_full(struct request_queue *q, int sync) | |||
602 | * it already be started by driver. | 553 | * it already be started by driver. |
603 | */ | 554 | */ |
604 | #define RQ_NOMERGE_FLAGS \ | 555 | #define RQ_NOMERGE_FLAGS \ |
605 | (REQ_NOMERGE | REQ_STARTED | REQ_HARDBARRIER | REQ_SOFTBARRIER) | 556 | (REQ_NOMERGE | REQ_STARTED | REQ_HARDBARRIER | REQ_SOFTBARRIER | \ |
557 | REQ_FLUSH | REQ_FUA) | ||
606 | #define rq_mergeable(rq) \ | 558 | #define rq_mergeable(rq) \ |
607 | (!((rq)->cmd_flags & RQ_NOMERGE_FLAGS) && \ | 559 | (!((rq)->cmd_flags & RQ_NOMERGE_FLAGS) && \ |
608 | (((rq)->cmd_flags & REQ_DISCARD) || \ | 560 | (((rq)->cmd_flags & REQ_DISCARD) || \ |
@@ -891,12 +843,8 @@ extern void blk_queue_update_dma_alignment(struct request_queue *, int); | |||
891 | extern void blk_queue_softirq_done(struct request_queue *, softirq_done_fn *); | 843 | extern void blk_queue_softirq_done(struct request_queue *, softirq_done_fn *); |
892 | extern void blk_queue_rq_timed_out(struct request_queue *, rq_timed_out_fn *); | 844 | extern void blk_queue_rq_timed_out(struct request_queue *, rq_timed_out_fn *); |
893 | extern void blk_queue_rq_timeout(struct request_queue *, unsigned int); | 845 | extern void blk_queue_rq_timeout(struct request_queue *, unsigned int); |
846 | extern void blk_queue_flush(struct request_queue *q, unsigned int flush); | ||
894 | extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev); | 847 | extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev); |
895 | extern int blk_queue_ordered(struct request_queue *, unsigned); | ||
896 | extern bool blk_do_ordered(struct request_queue *, struct request **); | ||
897 | extern unsigned blk_ordered_cur_seq(struct request_queue *); | ||
898 | extern unsigned blk_ordered_req_seq(struct request *); | ||
899 | extern bool blk_ordered_complete_seq(struct request_queue *, unsigned, int); | ||
900 | 848 | ||
901 | extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *); | 849 | extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *); |
902 | extern void blk_dump_rq_flags(struct request *, char *); | 850 | extern void blk_dump_rq_flags(struct request *, char *); |
@@ -929,27 +877,20 @@ static inline struct request *blk_map_queue_find_tag(struct blk_queue_tag *bqt, | |||
929 | return NULL; | 877 | return NULL; |
930 | return bqt->tag_index[tag]; | 878 | return bqt->tag_index[tag]; |
931 | } | 879 | } |
932 | enum{ | 880 | |
933 | BLKDEV_WAIT, /* wait for completion */ | 881 | #define BLKDEV_DISCARD_SECURE 0x01 /* secure discard */ |
934 | BLKDEV_BARRIER, /* issue request with barrier */ | 882 | |
935 | BLKDEV_SECURE, /* secure discard */ | 883 | extern int blkdev_issue_flush(struct block_device *, gfp_t, sector_t *); |
936 | }; | ||
937 | #define BLKDEV_IFL_WAIT (1 << BLKDEV_WAIT) | ||
938 | #define BLKDEV_IFL_BARRIER (1 << BLKDEV_BARRIER) | ||
939 | #define BLKDEV_IFL_SECURE (1 << BLKDEV_SECURE) | ||
940 | extern int blkdev_issue_flush(struct block_device *, gfp_t, sector_t *, | ||
941 | unsigned long); | ||
942 | extern int blkdev_issue_discard(struct block_device *bdev, sector_t sector, | 884 | extern int blkdev_issue_discard(struct block_device *bdev, sector_t sector, |
943 | sector_t nr_sects, gfp_t gfp_mask, unsigned long flags); | 885 | sector_t nr_sects, gfp_t gfp_mask, unsigned long flags); |
944 | extern int blkdev_issue_zeroout(struct block_device *bdev, sector_t sector, | 886 | extern int blkdev_issue_zeroout(struct block_device *bdev, sector_t sector, |
945 | sector_t nr_sects, gfp_t gfp_mask, unsigned long flags); | 887 | sector_t nr_sects, gfp_t gfp_mask); |
946 | static inline int sb_issue_discard(struct super_block *sb, | 888 | static inline int sb_issue_discard(struct super_block *sb, sector_t block, |
947 | sector_t block, sector_t nr_blocks) | 889 | sector_t nr_blocks, gfp_t gfp_mask, unsigned long flags) |
948 | { | 890 | { |
949 | block <<= (sb->s_blocksize_bits - 9); | 891 | return blkdev_issue_discard(sb->s_bdev, block << (sb->s_blocksize_bits - 9), |
950 | nr_blocks <<= (sb->s_blocksize_bits - 9); | 892 | nr_blocks << (sb->s_blocksize_bits - 9), |
951 | return blkdev_issue_discard(sb->s_bdev, block, nr_blocks, GFP_NOFS, | 893 | gfp_mask, flags); |
952 | BLKDEV_IFL_WAIT | BLKDEV_IFL_BARRIER); | ||
953 | } | 894 | } |
954 | 895 | ||
955 | extern int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm); | 896 | extern int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm); |
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index ec94c12f21da..dd1b25b2641c 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h | |||
@@ -32,7 +32,6 @@ enum bh_state_bits { | |||
32 | BH_Delay, /* Buffer is not yet allocated on disk */ | 32 | BH_Delay, /* Buffer is not yet allocated on disk */ |
33 | BH_Boundary, /* Block is followed by a discontiguity */ | 33 | BH_Boundary, /* Block is followed by a discontiguity */ |
34 | BH_Write_EIO, /* I/O error on write */ | 34 | BH_Write_EIO, /* I/O error on write */ |
35 | BH_Eopnotsupp, /* operation not supported (barrier) */ | ||
36 | BH_Unwritten, /* Buffer is allocated on disk but not written */ | 35 | BH_Unwritten, /* Buffer is allocated on disk but not written */ |
37 | BH_Quiet, /* Buffer Error Prinks to be quiet */ | 36 | BH_Quiet, /* Buffer Error Prinks to be quiet */ |
38 | 37 | ||
@@ -124,7 +123,6 @@ BUFFER_FNS(Async_Write, async_write) | |||
124 | BUFFER_FNS(Delay, delay) | 123 | BUFFER_FNS(Delay, delay) |
125 | BUFFER_FNS(Boundary, boundary) | 124 | BUFFER_FNS(Boundary, boundary) |
126 | BUFFER_FNS(Write_EIO, write_io_error) | 125 | BUFFER_FNS(Write_EIO, write_io_error) |
127 | BUFFER_FNS(Eopnotsupp, eopnotsupp) | ||
128 | BUFFER_FNS(Unwritten, unwritten) | 126 | BUFFER_FNS(Unwritten, unwritten) |
129 | 127 | ||
130 | #define bh_offset(bh) ((unsigned long)(bh)->b_data & ~PAGE_MASK) | 128 | #define bh_offset(bh) ((unsigned long)(bh)->b_data & ~PAGE_MASK) |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 0a81b87ea158..4f34ff6e5558 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -135,12 +135,12 @@ struct inodes_stat_t { | |||
135 | * immediately after submission. The write equivalent | 135 | * immediately after submission. The write equivalent |
136 | * of READ_SYNC. | 136 | * of READ_SYNC. |
137 | * WRITE_ODIRECT_PLUG Special case write for O_DIRECT only. | 137 | * WRITE_ODIRECT_PLUG Special case write for O_DIRECT only. |
138 | * WRITE_BARRIER Like WRITE_SYNC, but tells the block layer that all | 138 | * WRITE_FLUSH Like WRITE_SYNC but with preceding cache flush. |
139 | * previously submitted writes must be safely on storage | 139 | * WRITE_FUA Like WRITE_SYNC but data is guaranteed to be on |
140 | * before this one is started. Also guarantees that when | 140 | * non-volatile media on completion. |
141 | * this write is complete, it itself is also safely on | 141 | * WRITE_FLUSH_FUA Combination of WRITE_FLUSH and FUA. The IO is preceded |
142 | * storage. Prevents reordering of writes on both sides | 142 | * by a cache flush and data is guaranteed to be on |
143 | * of this IO. | 143 | * non-volatile media on completion. |
144 | * | 144 | * |
145 | */ | 145 | */ |
146 | #define RW_MASK REQ_WRITE | 146 | #define RW_MASK REQ_WRITE |
@@ -156,16 +156,12 @@ struct inodes_stat_t { | |||
156 | #define WRITE_SYNC (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_UNPLUG) | 156 | #define WRITE_SYNC (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_UNPLUG) |
157 | #define WRITE_ODIRECT_PLUG (WRITE | REQ_SYNC) | 157 | #define WRITE_ODIRECT_PLUG (WRITE | REQ_SYNC) |
158 | #define WRITE_META (WRITE | REQ_META) | 158 | #define WRITE_META (WRITE | REQ_META) |
159 | #define WRITE_BARRIER (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_UNPLUG | \ | 159 | #define WRITE_FLUSH (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_UNPLUG | \ |
160 | REQ_HARDBARRIER) | 160 | REQ_FLUSH) |
161 | 161 | #define WRITE_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_UNPLUG | \ | |
162 | /* | 162 | REQ_FUA) |
163 | * These aren't really reads or writes, they pass down information about | 163 | #define WRITE_FLUSH_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_UNPLUG | \ |
164 | * parts of device that are now unused by the file system. | 164 | REQ_FLUSH | REQ_FUA) |
165 | */ | ||
166 | #define DISCARD_NOBARRIER (WRITE | REQ_DISCARD) | ||
167 | #define DISCARD_BARRIER (WRITE | REQ_DISCARD | REQ_HARDBARRIER) | ||
168 | #define DISCARD_SECURE (DISCARD_NOBARRIER | REQ_SECURE) | ||
169 | 165 | ||
170 | #define SEL_IN 1 | 166 | #define SEL_IN 1 |
171 | #define SEL_OUT 2 | 167 | #define SEL_OUT 2 |
diff --git a/include/scsi/scsi_tcq.h b/include/scsi/scsi_tcq.h index 17231385cb37..d6e7994aa634 100644 --- a/include/scsi/scsi_tcq.h +++ b/include/scsi/scsi_tcq.h | |||
@@ -97,13 +97,9 @@ static inline void scsi_deactivate_tcq(struct scsi_device *sdev, int depth) | |||
97 | static inline int scsi_populate_tag_msg(struct scsi_cmnd *cmd, char *msg) | 97 | static inline int scsi_populate_tag_msg(struct scsi_cmnd *cmd, char *msg) |
98 | { | 98 | { |
99 | struct request *req = cmd->request; | 99 | struct request *req = cmd->request; |
100 | struct scsi_device *sdev = cmd->device; | ||
101 | 100 | ||
102 | if (blk_rq_tagged(req)) { | 101 | if (blk_rq_tagged(req)) { |
103 | if (sdev->ordered_tags && req->cmd_flags & REQ_HARDBARRIER) | 102 | *msg++ = MSG_SIMPLE_TAG; |
104 | *msg++ = MSG_ORDERED_TAG; | ||
105 | else | ||
106 | *msg++ = MSG_SIMPLE_TAG; | ||
107 | *msg++ = req->tag; | 103 | *msg++ = req->tag; |
108 | return 2; | 104 | return 2; |
109 | } | 105 | } |