diff options
| author | Christoph Hellwig <hch@lst.de> | 2010-11-10 08:54:09 -0500 |
|---|---|---|
| committer | Jens Axboe <jaxboe@fusionio.com> | 2010-11-10 08:54:09 -0500 |
| commit | 02e031cbc843b010e72fcc05c76113c688b2860f (patch) | |
| tree | 9f68559ec3acc39bcc4ce2ff87043a094eaa2e8f | |
| parent | 00e375e7e962f938f6b3c93e4cd097a5e26cc788 (diff) | |
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>
| -rw-r--r-- | block/blk-core.c | 7 | ||||
| -rw-r--r-- | block/elevator.c | 4 | ||||
| -rw-r--r-- | drivers/block/aoe/aoeblk.c | 3 | ||||
| -rw-r--r-- | drivers/block/loop.c | 6 | ||||
| -rw-r--r-- | drivers/block/xen-blkfront.c | 2 | ||||
| -rw-r--r-- | drivers/scsi/scsi_error.c | 18 | ||||
| -rw-r--r-- | drivers/usb/storage/uas.c | 5 | ||||
| -rw-r--r-- | include/linux/bio.h | 4 | ||||
| -rw-r--r-- | include/linux/blk_types.h | 6 | ||||
| -rw-r--r-- | include/linux/blkdev.h | 3 | ||||
| -rw-r--r-- | kernel/trace/blktrace.c | 4 |
11 files changed, 11 insertions, 51 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index 17fcb83670c0..4ce953f1b390 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
| @@ -1194,13 +1194,6 @@ static int __make_request(struct request_queue *q, struct bio *bio) | |||
| 1194 | int where = ELEVATOR_INSERT_SORT; | 1194 | int where = ELEVATOR_INSERT_SORT; |
| 1195 | int rw_flags; | 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 | * low level driver can indicate that it wants pages above a | 1198 | * low level driver can indicate that it wants pages above a |
| 1206 | * certain limit bounced to low memory (ie for highmem, or even | 1199 | * certain limit bounced to low memory (ie for highmem, or even |
diff --git a/block/elevator.c b/block/elevator.c index 282e8308f7e2..2569512830d3 100644 --- a/block/elevator.c +++ b/block/elevator.c | |||
| @@ -429,7 +429,7 @@ void elv_dispatch_sort(struct request_queue *q, struct request *rq) | |||
| 429 | q->nr_sorted--; | 429 | q->nr_sorted--; |
| 430 | 430 | ||
| 431 | boundary = q->end_sector; | 431 | boundary = q->end_sector; |
| 432 | stop_flags = REQ_SOFTBARRIER | REQ_HARDBARRIER | REQ_STARTED; | 432 | stop_flags = REQ_SOFTBARRIER | REQ_STARTED; |
| 433 | list_for_each_prev(entry, &q->queue_head) { | 433 | list_for_each_prev(entry, &q->queue_head) { |
| 434 | struct request *pos = list_entry_rq(entry); | 434 | struct request *pos = list_entry_rq(entry); |
| 435 | 435 | ||
| @@ -691,7 +691,7 @@ void elv_insert(struct request_queue *q, struct request *rq, int where) | |||
| 691 | void __elv_add_request(struct request_queue *q, struct request *rq, int where, | 691 | void __elv_add_request(struct request_queue *q, struct request *rq, int where, |
| 692 | int plug) | 692 | int plug) |
| 693 | { | 693 | { |
| 694 | if (rq->cmd_flags & (REQ_SOFTBARRIER | REQ_HARDBARRIER)) { | 694 | if (rq->cmd_flags & REQ_SOFTBARRIER) { |
| 695 | /* barriers are scheduling boundary, update end_sector */ | 695 | /* barriers are scheduling boundary, update end_sector */ |
| 696 | if (rq->cmd_type == REQ_TYPE_FS || | 696 | if (rq->cmd_type == REQ_TYPE_FS || |
| 697 | (rq->cmd_flags & REQ_DISCARD)) { | 697 | (rq->cmd_flags & REQ_DISCARD)) { |
diff --git a/drivers/block/aoe/aoeblk.c b/drivers/block/aoe/aoeblk.c index 541e18879965..528f6318ded1 100644 --- a/drivers/block/aoe/aoeblk.c +++ b/drivers/block/aoe/aoeblk.c | |||
| @@ -180,9 +180,6 @@ aoeblk_make_request(struct request_queue *q, struct bio *bio) | |||
| 180 | BUG(); | 180 | BUG(); |
| 181 | bio_endio(bio, -ENXIO); | 181 | bio_endio(bio, -ENXIO); |
| 182 | return 0; | 182 | return 0; |
| 183 | } else if (bio->bi_rw & REQ_HARDBARRIER) { | ||
| 184 | bio_endio(bio, -EOPNOTSUPP); | ||
| 185 | return 0; | ||
| 186 | } else if (bio->bi_io_vec == NULL) { | 183 | } else if (bio->bi_io_vec == NULL) { |
| 187 | printk(KERN_ERR "aoe: bi_io_vec is NULL\n"); | 184 | printk(KERN_ERR "aoe: bi_io_vec is NULL\n"); |
| 188 | BUG(); | 185 | BUG(); |
diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 1e5284ef65fa..7ea0bea2f7e3 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c | |||
| @@ -481,12 +481,6 @@ static int do_bio_filebacked(struct loop_device *lo, struct bio *bio) | |||
| 481 | if (bio_rw(bio) == WRITE) { | 481 | if (bio_rw(bio) == WRITE) { |
| 482 | struct file *file = lo->lo_backing_file; | 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 | if (bio->bi_rw & REQ_FLUSH) { | 484 | if (bio->bi_rw & REQ_FLUSH) { |
| 491 | ret = vfs_fsync(file, 0); | 485 | ret = vfs_fsync(file, 0); |
| 492 | if (unlikely(ret && ret != -EINVAL)) { | 486 | if (unlikely(ret && ret != -EINVAL)) { |
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index 06e2812ba124..255035cfc88a 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c | |||
| @@ -289,8 +289,6 @@ static int blkif_queue_request(struct request *req) | |||
| 289 | 289 | ||
| 290 | ring_req->operation = rq_data_dir(req) ? | 290 | ring_req->operation = rq_data_dir(req) ? |
| 291 | BLKIF_OP_WRITE : BLKIF_OP_READ; | 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 | ring_req->nr_segments = blk_rq_map_sg(req->q, req, info->sg); | 293 | ring_req->nr_segments = blk_rq_map_sg(req->q, req, info->sg); |
| 296 | BUG_ON(ring_req->nr_segments > BLKIF_MAX_SEGMENTS_PER_REQUEST); | 294 | BUG_ON(ring_req->nr_segments > BLKIF_MAX_SEGMENTS_PER_REQUEST); |
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 1de30eb83bb0..f3cf924a2cd9 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c | |||
| @@ -320,19 +320,11 @@ static int scsi_check_sense(struct scsi_cmnd *scmd) | |||
| 320 | "changed. The Linux SCSI layer does not " | 320 | "changed. The Linux SCSI layer does not " |
| 321 | "automatically adjust these parameters.\n"); | 321 | "automatically adjust these parameters.\n"); |
| 322 | 322 | ||
| 323 | if (scmd->request->cmd_flags & REQ_HARDBARRIER) | 323 | /* |
| 324 | /* | 324 | * Pass the UA upwards for a determination in the completion |
| 325 | * barrier requests should always retry on UA | 325 | * functions. |
| 326 | * otherwise block will get a spurious error | 326 | */ |
| 327 | */ | 327 | return SUCCESS; |
| 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; | ||
| 336 | 328 | ||
| 337 | /* these three are not supported */ | 329 | /* these three are not supported */ |
| 338 | case COPY_ABORTED: | 330 | case COPY_ABORTED: |
diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c index 2054b1e25a65..d1268191acbd 100644 --- a/drivers/usb/storage/uas.c +++ b/drivers/usb/storage/uas.c | |||
| @@ -331,10 +331,7 @@ static struct urb *uas_alloc_cmd_urb(struct uas_dev_info *devinfo, gfp_t gfp, | |||
| 331 | 331 | ||
| 332 | iu->iu_id = IU_ID_COMMAND; | 332 | iu->iu_id = IU_ID_COMMAND; |
| 333 | iu->tag = cpu_to_be16(stream_id); | 333 | iu->tag = cpu_to_be16(stream_id); |
| 334 | if (sdev->ordered_tags && (cmnd->request->cmd_flags & REQ_HARDBARRIER)) | 334 | iu->prio_attr = UAS_SIMPLE_TAG; |
| 335 | iu->prio_attr = UAS_ORDERED_TAG; | ||
| 336 | else | ||
| 337 | iu->prio_attr = UAS_SIMPLE_TAG; | ||
| 338 | iu->len = len; | 335 | iu->len = len; |
| 339 | int_to_scsilun(sdev->lun, &iu->lun); | 336 | int_to_scsilun(sdev->lun, &iu->lun); |
| 340 | memcpy(iu->cdb, cmnd->cmnd, cmnd->cmd_len); | 337 | memcpy(iu->cdb, cmnd->cmnd, cmnd->cmd_len); |
diff --git a/include/linux/bio.h b/include/linux/bio.h index ba679992d39b..35dcdb3589bc 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
| @@ -66,10 +66,6 @@ | |||
| 66 | #define bio_offset(bio) bio_iovec((bio))->bv_offset | 66 | #define bio_offset(bio) bio_iovec((bio))->bv_offset |
| 67 | #define bio_segments(bio) ((bio)->bi_vcnt - (bio)->bi_idx) | 67 | #define bio_segments(bio) ((bio)->bi_vcnt - (bio)->bi_idx) |
| 68 | #define bio_sectors(bio) ((bio)->bi_size >> 9) | 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 | static inline unsigned int bio_cur_bytes(struct bio *bio) | 70 | static inline unsigned int bio_cur_bytes(struct bio *bio) |
| 75 | { | 71 | { |
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index 0437ab6bb54c..46ad5197537a 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h | |||
| @@ -122,7 +122,6 @@ enum rq_flag_bits { | |||
| 122 | __REQ_FAILFAST_TRANSPORT, /* no driver retries of transport errors */ | 122 | __REQ_FAILFAST_TRANSPORT, /* no driver retries of transport errors */ |
| 123 | __REQ_FAILFAST_DRIVER, /* no driver retries of driver errors */ | 123 | __REQ_FAILFAST_DRIVER, /* no driver retries of driver errors */ |
| 124 | 124 | ||
| 125 | __REQ_HARDBARRIER, /* may not be passed by drive either */ | ||
| 126 | __REQ_SYNC, /* request is sync (sync write or read) */ | 125 | __REQ_SYNC, /* request is sync (sync write or read) */ |
| 127 | __REQ_META, /* metadata io request */ | 126 | __REQ_META, /* metadata io request */ |
| 128 | __REQ_DISCARD, /* request to discard sectors */ | 127 | __REQ_DISCARD, /* request to discard sectors */ |
| @@ -159,7 +158,6 @@ enum rq_flag_bits { | |||
| 159 | #define REQ_FAILFAST_DEV (1 << __REQ_FAILFAST_DEV) | 158 | #define REQ_FAILFAST_DEV (1 << __REQ_FAILFAST_DEV) |
| 160 | #define REQ_FAILFAST_TRANSPORT (1 << __REQ_FAILFAST_TRANSPORT) | 159 | #define REQ_FAILFAST_TRANSPORT (1 << __REQ_FAILFAST_TRANSPORT) |
| 161 | #define REQ_FAILFAST_DRIVER (1 << __REQ_FAILFAST_DRIVER) | 160 | #define REQ_FAILFAST_DRIVER (1 << __REQ_FAILFAST_DRIVER) |
| 162 | #define REQ_HARDBARRIER (1 << __REQ_HARDBARRIER) | ||
| 163 | #define REQ_SYNC (1 << __REQ_SYNC) | 161 | #define REQ_SYNC (1 << __REQ_SYNC) |
| 164 | #define REQ_META (1 << __REQ_META) | 162 | #define REQ_META (1 << __REQ_META) |
| 165 | #define REQ_DISCARD (1 << __REQ_DISCARD) | 163 | #define REQ_DISCARD (1 << __REQ_DISCARD) |
| @@ -168,8 +166,8 @@ enum rq_flag_bits { | |||
