diff options
author | Christoph Hellwig <hch@lst.de> | 2010-08-07 12:17:56 -0400 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2010-08-07 12:17:56 -0400 |
commit | 33659ebbae262228eef4e0fe990f393d1f0ed941 (patch) | |
tree | fcb537f09359c8dad3a6f6e16dc4319562dc42cc /block/cfq-iosched.c | |
parent | 7e005f79791dcd58436c88ded4a7f5aed1b82147 (diff) |
block: remove wrappers for request type/flags
Remove all the trivial wrappers for the cmd_type and cmd_flags fields in
struct requests. This allows much easier grepping for different request
types instead of unwinding through macros.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'block/cfq-iosched.c')
-rw-r--r-- | block/cfq-iosched.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index 7982b830db58..d4edeb8fceb8 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c | |||
@@ -646,9 +646,10 @@ cfq_choose_req(struct cfq_data *cfqd, struct request *rq1, struct request *rq2, | |||
646 | return rq1; | 646 | return rq1; |
647 | else if (rq_is_sync(rq2) && !rq_is_sync(rq1)) | 647 | else if (rq_is_sync(rq2) && !rq_is_sync(rq1)) |
648 | return rq2; | 648 | return rq2; |
649 | if (rq_is_meta(rq1) && !rq_is_meta(rq2)) | 649 | if ((rq1->cmd_flags & REQ_RW_META) && !(rq2->cmd_flags & REQ_RW_META)) |
650 | return rq1; | 650 | return rq1; |
651 | else if (rq_is_meta(rq2) && !rq_is_meta(rq1)) | 651 | else if ((rq2->cmd_flags & REQ_RW_META) && |
652 | !(rq1->cmd_flags & REQ_RW_META)) | ||
652 | return rq2; | 653 | return rq2; |
653 | 654 | ||
654 | s1 = blk_rq_pos(rq1); | 655 | s1 = blk_rq_pos(rq1); |
@@ -1484,7 +1485,7 @@ static void cfq_remove_request(struct request *rq) | |||
1484 | cfqq->cfqd->rq_queued--; | 1485 | cfqq->cfqd->rq_queued--; |
1485 | cfq_blkiocg_update_io_remove_stats(&(RQ_CFQG(rq))->blkg, | 1486 | cfq_blkiocg_update_io_remove_stats(&(RQ_CFQG(rq))->blkg, |
1486 | rq_data_dir(rq), rq_is_sync(rq)); | 1487 | rq_data_dir(rq), rq_is_sync(rq)); |
1487 | if (rq_is_meta(rq)) { | 1488 | if (rq->cmd_flags & REQ_RW_META) { |
1488 | WARN_ON(!cfqq->meta_pending); | 1489 | WARN_ON(!cfqq->meta_pending); |
1489 | cfqq->meta_pending--; | 1490 | cfqq->meta_pending--; |
1490 | } | 1491 | } |
@@ -3176,7 +3177,7 @@ cfq_should_preempt(struct cfq_data *cfqd, struct cfq_queue *new_cfqq, | |||
3176 | * So both queues are sync. Let the new request get disk time if | 3177 | * So both queues are sync. Let the new request get disk time if |
3177 | * it's a metadata request and the current queue is doing regular IO. | 3178 | * it's a metadata request and the current queue is doing regular IO. |
3178 | */ | 3179 | */ |
3179 | if (rq_is_meta(rq) && !cfqq->meta_pending) | 3180 | if ((rq->cmd_flags & REQ_RW_META) && !cfqq->meta_pending) |
3180 | return true; | 3181 | return true; |
3181 | 3182 | ||
3182 | /* | 3183 | /* |
@@ -3230,7 +3231,7 @@ cfq_rq_enqueued(struct cfq_data *cfqd, struct cfq_queue *cfqq, | |||
3230 | struct cfq_io_context *cic = RQ_CIC(rq); | 3231 | struct cfq_io_context *cic = RQ_CIC(rq); |
3231 | 3232 | ||
3232 | cfqd->rq_queued++; | 3233 | cfqd->rq_queued++; |
3233 | if (rq_is_meta(rq)) | 3234 | if (rq->cmd_flags & REQ_RW_META) |
3234 | cfqq->meta_pending++; | 3235 | cfqq->meta_pending++; |
3235 | 3236 | ||
3236 | cfq_update_io_thinktime(cfqd, cic); | 3237 | cfq_update_io_thinktime(cfqd, cic); |
@@ -3365,7 +3366,8 @@ static void cfq_completed_request(struct request_queue *q, struct request *rq) | |||
3365 | unsigned long now; | 3366 | unsigned long now; |
3366 | 3367 | ||
3367 | now = jiffies; | 3368 | now = jiffies; |
3368 | cfq_log_cfqq(cfqd, cfqq, "complete rqnoidle %d", !!rq_noidle(rq)); | 3369 | cfq_log_cfqq(cfqd, cfqq, "complete rqnoidle %d", |
3370 | !!(rq->cmd_flags & REQ_NOIDLE)); | ||
3369 | 3371 | ||
3370 | cfq_update_hw_tag(cfqd); | 3372 | cfq_update_hw_tag(cfqd); |
3371 | 3373 | ||
@@ -3419,11 +3421,12 @@ static void cfq_completed_request(struct request_queue *q, struct request *rq) | |||
3419 | cfq_slice_expired(cfqd, 1); | 3421 | cfq_slice_expired(cfqd, 1); |
3420 | else if (sync && cfqq_empty && | 3422 | else if (sync && cfqq_empty && |
3421 | !cfq_close_cooperator(cfqd, cfqq)) { | 3423 | !cfq_close_cooperator(cfqd, cfqq)) { |
3422 | cfqd->noidle_tree_requires_idle |= !rq_noidle(rq); | 3424 | cfqd->noidle_tree_requires_idle |= |
3425 | !(rq->cmd_flags & REQ_NOIDLE); | ||
3423 | /* | 3426 | /* |
3424 | * Idling is enabled for SYNC_WORKLOAD. | 3427 | * Idling is enabled for SYNC_WORKLOAD. |
3425 | * SYNC_NOIDLE_WORKLOAD idles at the end of the tree | 3428 | * SYNC_NOIDLE_WORKLOAD idles at the end of the tree |
3426 | * only if we processed at least one !rq_noidle request | 3429 | * only if we processed at least one !REQ_NOIDLE request |
3427 | */ | 3430 | */ |
3428 | if (cfqd->serving_type == SYNC_WORKLOAD | 3431 | if (cfqd->serving_type == SYNC_WORKLOAD |
3429 | || cfqd->noidle_tree_requires_idle | 3432 | || cfqd->noidle_tree_requires_idle |