Commit 02e031cbc843b010e72fcc05c76113c688b2860f
Committed by
Jens Axboe
1 parent
00e375e7e9
Exists in
master
and in
39 other branches
block: remove REQ_HARDBARRIER
REQ_HARDBARRIER is dead now, so remove the leftovers. What's left at this point is: - various checks inside the block layer. - sanity checks in bio based drivers. - now unused bio_empty_barrier helper. - Xen blockfront use of BLKIF_OP_WRITE_BARRIER - it's dead for a while, but Xen really needs to sort out it's barrier situaton. - setting of ordered tags in uas - dead code copied from old scsi drivers. - scsi different retry for barriers - it's dead and should have been removed when flushes were converted to FS requests. - blktrace handling of barriers - removed. Someone who knows blktrace better should add support for REQ_FLUSH and REQ_FUA, though. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Showing 11 changed files with 11 additions and 51 deletions Side-by-side Diff
block/blk-core.c
... | ... | @@ -1194,13 +1194,6 @@ |
1194 | 1194 | int where = ELEVATOR_INSERT_SORT; |
1195 | 1195 | int rw_flags; |
1196 | 1196 | |
1197 | - /* REQ_HARDBARRIER is no more */ | |
1198 | - if (WARN_ONCE(bio->bi_rw & REQ_HARDBARRIER, | |
1199 | - "block: HARDBARRIER is deprecated, use FLUSH/FUA instead\n")) { | |
1200 | - bio_endio(bio, -EOPNOTSUPP); | |
1201 | - return 0; | |
1202 | - } | |
1203 | - | |
1204 | 1197 | /* |
1205 | 1198 | * low level driver can indicate that it wants pages above a |
1206 | 1199 | * certain limit bounced to low memory (ie for highmem, or even |
block/elevator.c
... | ... | @@ -429,7 +429,7 @@ |
429 | 429 | q->nr_sorted--; |
430 | 430 | |
431 | 431 | boundary = q->end_sector; |
432 | - stop_flags = REQ_SOFTBARRIER | REQ_HARDBARRIER | REQ_STARTED; | |
432 | + stop_flags = REQ_SOFTBARRIER | REQ_STARTED; | |
433 | 433 | list_for_each_prev(entry, &q->queue_head) { |
434 | 434 | struct request *pos = list_entry_rq(entry); |
435 | 435 | |
... | ... | @@ -691,7 +691,7 @@ |
691 | 691 | void __elv_add_request(struct request_queue *q, struct request *rq, int where, |
692 | 692 | int plug) |
693 | 693 | { |
694 | - if (rq->cmd_flags & (REQ_SOFTBARRIER | REQ_HARDBARRIER)) { | |
694 | + if (rq->cmd_flags & REQ_SOFTBARRIER) { | |
695 | 695 | /* barriers are scheduling boundary, update end_sector */ |
696 | 696 | if (rq->cmd_type == REQ_TYPE_FS || |
697 | 697 | (rq->cmd_flags & REQ_DISCARD)) { |
drivers/block/aoe/aoeblk.c
... | ... | @@ -180,9 +180,6 @@ |
180 | 180 | BUG(); |
181 | 181 | bio_endio(bio, -ENXIO); |
182 | 182 | return 0; |
183 | - } else if (bio->bi_rw & REQ_HARDBARRIER) { | |
184 | - bio_endio(bio, -EOPNOTSUPP); | |
185 | - return 0; | |
186 | 183 | } else if (bio->bi_io_vec == NULL) { |
187 | 184 | printk(KERN_ERR "aoe: bi_io_vec is NULL\n"); |
188 | 185 | BUG(); |
drivers/block/loop.c
... | ... | @@ -481,12 +481,6 @@ |
481 | 481 | if (bio_rw(bio) == WRITE) { |
482 | 482 | struct file *file = lo->lo_backing_file; |
483 | 483 | |
484 | - /* REQ_HARDBARRIER is deprecated */ | |
485 | - if (bio->bi_rw & REQ_HARDBARRIER) { | |
486 | - ret = -EOPNOTSUPP; | |
487 | - goto out; | |
488 | - } | |
489 | - | |
490 | 484 | if (bio->bi_rw & REQ_FLUSH) { |
491 | 485 | ret = vfs_fsync(file, 0); |
492 | 486 | if (unlikely(ret && ret != -EINVAL)) { |
drivers/block/xen-blkfront.c
... | ... | @@ -289,8 +289,6 @@ |
289 | 289 | |
290 | 290 | ring_req->operation = rq_data_dir(req) ? |
291 | 291 | BLKIF_OP_WRITE : BLKIF_OP_READ; |
292 | - if (req->cmd_flags & REQ_HARDBARRIER) | |
293 | - ring_req->operation = BLKIF_OP_WRITE_BARRIER; | |
294 | 292 | |
295 | 293 | ring_req->nr_segments = blk_rq_map_sg(req->q, req, info->sg); |
296 | 294 | BUG_ON(ring_req->nr_segments > BLKIF_MAX_SEGMENTS_PER_REQUEST); |
drivers/scsi/scsi_error.c
... | ... | @@ -320,19 +320,11 @@ |
320 | 320 | "changed. The Linux SCSI layer does not " |
321 | 321 | "automatically adjust these parameters.\n"); |
322 | 322 | |
323 | - if (scmd->request->cmd_flags & REQ_HARDBARRIER) | |
324 | - /* | |
325 | - * barrier requests should always retry on UA | |
326 | - * otherwise block will get a spurious error | |
327 | - */ | |
328 | - return NEEDS_RETRY; | |
329 | - else | |
330 | - /* | |
331 | - * for normal (non barrier) commands, pass the | |
332 | - * UA upwards for a determination in the | |
333 | - * completion functions | |
334 | - */ | |
335 | - return SUCCESS; | |
323 | + /* | |
324 | + * Pass the UA upwards for a determination in the completion | |
325 | + * functions. | |
326 | + */ | |
327 | + return SUCCESS; | |
336 | 328 | |
337 | 329 | /* these three are not supported */ |
338 | 330 | case COPY_ABORTED: |
drivers/usb/storage/uas.c
... | ... | @@ -331,10 +331,7 @@ |
331 | 331 | |
332 | 332 | iu->iu_id = IU_ID_COMMAND; |
333 | 333 | iu->tag = cpu_to_be16(stream_id); |
334 | - if (sdev->ordered_tags && (cmnd->request->cmd_flags & REQ_HARDBARRIER)) | |
335 | - iu->prio_attr = UAS_ORDERED_TAG; | |
336 | - else | |
337 | - iu->prio_attr = UAS_SIMPLE_TAG; | |
334 | + iu->prio_attr = UAS_SIMPLE_TAG; | |
338 | 335 | iu->len = len; |
339 | 336 | int_to_scsilun(sdev->lun, &iu->lun); |
340 | 337 | memcpy(iu->cdb, cmnd->cmnd, cmnd->cmd_len); |
include/linux/bio.h
... | ... | @@ -66,10 +66,6 @@ |
66 | 66 | #define bio_offset(bio) bio_iovec((bio))->bv_offset |
67 | 67 | #define bio_segments(bio) ((bio)->bi_vcnt - (bio)->bi_idx) |
68 | 68 | #define bio_sectors(bio) ((bio)->bi_size >> 9) |
69 | -#define bio_empty_barrier(bio) \ | |
70 | - ((bio->bi_rw & REQ_HARDBARRIER) && \ | |
71 | - !bio_has_data(bio) && \ | |
72 | - !(bio->bi_rw & REQ_DISCARD)) | |
73 | 69 | |
74 | 70 | static inline unsigned int bio_cur_bytes(struct bio *bio) |
75 | 71 | { |
include/linux/blk_types.h
... | ... | @@ -122,7 +122,6 @@ |
122 | 122 | __REQ_FAILFAST_TRANSPORT, /* no driver retries of transport errors */ |
123 | 123 | __REQ_FAILFAST_DRIVER, /* no driver retries of driver errors */ |
124 | 124 | |
125 | - __REQ_HARDBARRIER, /* may not be passed by drive either */ | |
126 | 125 | __REQ_SYNC, /* request is sync (sync write or read) */ |
127 | 126 | __REQ_META, /* metadata io request */ |
128 | 127 | __REQ_DISCARD, /* request to discard sectors */ |
... | ... | @@ -159,7 +158,6 @@ |
159 | 158 | #define REQ_FAILFAST_DEV (1 << __REQ_FAILFAST_DEV) |
160 | 159 | #define REQ_FAILFAST_TRANSPORT (1 << __REQ_FAILFAST_TRANSPORT) |
161 | 160 | #define REQ_FAILFAST_DRIVER (1 << __REQ_FAILFAST_DRIVER) |
162 | -#define REQ_HARDBARRIER (1 << __REQ_HARDBARRIER) | |
163 | 161 | #define REQ_SYNC (1 << __REQ_SYNC) |
164 | 162 | #define REQ_META (1 << __REQ_META) |
165 | 163 | #define REQ_DISCARD (1 << __REQ_DISCARD) |
... | ... | @@ -168,8 +166,8 @@ |
168 | 166 | #define REQ_FAILFAST_MASK \ |
169 | 167 | (REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER) |
170 | 168 | #define REQ_COMMON_MASK \ |
171 | - (REQ_WRITE | REQ_FAILFAST_MASK | REQ_HARDBARRIER | REQ_SYNC | \ | |
172 | - REQ_META | REQ_DISCARD | REQ_NOIDLE | REQ_FLUSH | REQ_FUA) | |
169 | + (REQ_WRITE | REQ_FAILFAST_MASK | REQ_SYNC | REQ_META | REQ_DISCARD | \ | |
170 | + REQ_NOIDLE | REQ_FLUSH | REQ_FUA) | |
173 | 171 | #define REQ_CLONE_MASK REQ_COMMON_MASK |
174 | 172 | |
175 | 173 | #define REQ_UNPLUG (1 << __REQ_UNPLUG) |
include/linux/blkdev.h
... | ... | @@ -552,8 +552,7 @@ |
552 | 552 | * it already be started by driver. |
553 | 553 | */ |
554 | 554 | #define RQ_NOMERGE_FLAGS \ |
555 | - (REQ_NOMERGE | REQ_STARTED | REQ_HARDBARRIER | REQ_SOFTBARRIER | \ | |
556 | - REQ_FLUSH | REQ_FUA) | |
555 | + (REQ_NOMERGE | REQ_STARTED | REQ_SOFTBARRIER | REQ_FLUSH | REQ_FUA) | |
557 | 556 | #define rq_mergeable(rq) \ |
558 | 557 | (!((rq)->cmd_flags & RQ_NOMERGE_FLAGS) && \ |
559 | 558 | (((rq)->cmd_flags & REQ_DISCARD) || \ |
kernel/trace/blktrace.c
... | ... | @@ -168,7 +168,6 @@ |
168 | 168 | static const u32 ddir_act[2] = { BLK_TC_ACT(BLK_TC_READ), |
169 | 169 | BLK_TC_ACT(BLK_TC_WRITE) }; |
170 | 170 | |
171 | -#define BLK_TC_HARDBARRIER BLK_TC_BARRIER | |
172 | 171 | #define BLK_TC_RAHEAD BLK_TC_AHEAD |
173 | 172 | |
174 | 173 | /* The ilog2() calls fall out because they're constant */ |
... | ... | @@ -196,7 +195,6 @@ |
196 | 195 | return; |
197 | 196 | |
198 | 197 | what |= ddir_act[rw & WRITE]; |
199 | - what |= MASK_TC_BIT(rw, HARDBARRIER); | |
200 | 198 | what |= MASK_TC_BIT(rw, SYNC); |
201 | 199 | what |= MASK_TC_BIT(rw, RAHEAD); |
202 | 200 | what |= MASK_TC_BIT(rw, META); |
... | ... | @@ -1807,8 +1805,6 @@ |
1807 | 1805 | |
1808 | 1806 | if (rw & REQ_RAHEAD) |
1809 | 1807 | rwbs[i++] = 'A'; |
1810 | - if (rw & REQ_HARDBARRIER) | |
1811 | - rwbs[i++] = 'B'; | |
1812 | 1808 | if (rw & REQ_SYNC) |
1813 | 1809 | rwbs[i++] = 'S'; |
1814 | 1810 | if (rw & REQ_META) |