diff options
author | Martin K. Petersen <martin.petersen@oracle.com> | 2012-09-18 12:19:25 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2012-09-20 08:31:38 -0400 |
commit | e2a60da74fc8215c68509a89e9a69c66363153db (patch) | |
tree | c23dd6540dc211e2b2583c3e950a7f6977e3f1df /block/elevator.c | |
parent | d41570b7469724005eb78448a69289900f911963 (diff) |
block: Clean up special command handling logic
Remove special-casing of non-rw fs style requests (discard). The nomerge
flags are consolidated in blk_types.h, and rq_mergeable() and
bio_mergeable() have been modified to use them.
bio_is_rw() is used in place of bio_has_data() a few places. This is
done to to distinguish true reads and writes from other fs type requests
that carry a payload (e.g. write same).
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Acked-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/elevator.c')
-rw-r--r-- | block/elevator.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/block/elevator.c b/block/elevator.c index 6a55d418896f..9b1d42b62f20 100644 --- a/block/elevator.c +++ b/block/elevator.c | |||
@@ -562,8 +562,7 @@ void __elv_add_request(struct request_queue *q, struct request *rq, int where) | |||
562 | 562 | ||
563 | if (rq->cmd_flags & REQ_SOFTBARRIER) { | 563 | if (rq->cmd_flags & REQ_SOFTBARRIER) { |
564 | /* barriers are scheduling boundary, update end_sector */ | 564 | /* barriers are scheduling boundary, update end_sector */ |
565 | if (rq->cmd_type == REQ_TYPE_FS || | 565 | if (rq->cmd_type == REQ_TYPE_FS) { |
566 | (rq->cmd_flags & REQ_DISCARD)) { | ||
567 | q->end_sector = rq_end_sector(rq); | 566 | q->end_sector = rq_end_sector(rq); |
568 | q->boundary_rq = rq; | 567 | q->boundary_rq = rq; |
569 | } | 568 | } |
@@ -605,8 +604,7 @@ void __elv_add_request(struct request_queue *q, struct request *rq, int where) | |||
605 | if (elv_attempt_insert_merge(q, rq)) | 604 | if (elv_attempt_insert_merge(q, rq)) |
606 | break; | 605 | break; |
607 | case ELEVATOR_INSERT_SORT: | 606 | case ELEVATOR_INSERT_SORT: |
608 | BUG_ON(rq->cmd_type != REQ_TYPE_FS && | 607 | BUG_ON(rq->cmd_type != REQ_TYPE_FS); |
609 | !(rq->cmd_flags & REQ_DISCARD)); | ||
610 | rq->cmd_flags |= REQ_SORTED; | 608 | rq->cmd_flags |= REQ_SORTED; |
611 | q->nr_sorted++; | 609 | q->nr_sorted++; |
612 | if (rq_mergeable(rq)) { | 610 | if (rq_mergeable(rq)) { |