aboutsummaryrefslogtreecommitdiffstats
path: root/block/cfq-iosched.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2010-08-07 12:20:39 -0400
committerJens Axboe <jaxboe@fusionio.com>2010-08-07 12:20:39 -0400
commit7b6d91daee5cac6402186ff224c3af39d79f4a0e (patch)
treeb1518cf0b6c301178e0a320f80610cd5b3aa7625 /block/cfq-iosched.c
parent33659ebbae262228eef4e0fe990f393d1f0ed941 (diff)
block: unify flags for struct bio and struct request
Remove the current bio flags and reuse the request flags for the bio, too. This allows to more easily trace the type of I/O from the filesystem down to the block driver. There were two flags in the bio that were missing in the requests: BIO_RW_UNPLUG and BIO_RW_AHEAD. Also I've renamed two request flags that had a superflous RW in them. Note that the flags are in bio.h despite having the REQ_ name - as blkdev.h includes bio.h that is the only way to go for now. 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.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index d4edeb8fceb8..eb4086f7dfef 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -458,7 +458,7 @@ static inline struct cfq_data *cic_to_cfqd(struct cfq_io_context *cic)
458 */ 458 */
459static inline bool cfq_bio_sync(struct bio *bio) 459static inline bool cfq_bio_sync(struct bio *bio)
460{ 460{
461 return bio_data_dir(bio) == READ || bio_rw_flagged(bio, BIO_RW_SYNCIO); 461 return bio_data_dir(bio) == READ || (bio->bi_rw & REQ_SYNC);
462} 462}
463 463
464/* 464/*
@@ -646,10 +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 ((rq1->cmd_flags & REQ_RW_META) && !(rq2->cmd_flags & REQ_RW_META)) 649 if ((rq1->cmd_flags & REQ_META) && !(rq2->cmd_flags & REQ_META))
650 return rq1; 650 return rq1;
651 else if ((rq2->cmd_flags & REQ_RW_META) && 651 else if ((rq2->cmd_flags & REQ_META) &&
652 !(rq1->cmd_flags & REQ_RW_META)) 652 !(rq1->cmd_flags & REQ_META))
653 return rq2; 653 return rq2;
654 654
655 s1 = blk_rq_pos(rq1); 655 s1 = blk_rq_pos(rq1);
@@ -1485,7 +1485,7 @@ static void cfq_remove_request(struct request *rq)
1485 cfqq->cfqd->rq_queued--; 1485 cfqq->cfqd->rq_queued--;
1486 cfq_blkiocg_update_io_remove_stats(&(RQ_CFQG(rq))->blkg, 1486 cfq_blkiocg_update_io_remove_stats(&(RQ_CFQG(rq))->blkg,
1487 rq_data_dir(rq), rq_is_sync(rq)); 1487 rq_data_dir(rq), rq_is_sync(rq));
1488 if (rq->cmd_flags & REQ_RW_META) { 1488 if (rq->cmd_flags & REQ_META) {
1489 WARN_ON(!cfqq->meta_pending); 1489 WARN_ON(!cfqq->meta_pending);
1490 cfqq->meta_pending--; 1490 cfqq->meta_pending--;
1491 } 1491 }
@@ -3177,7 +3177,7 @@ cfq_should_preempt(struct cfq_data *cfqd, struct cfq_queue *new_cfqq,
3177 * 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
3178 * 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.
3179 */ 3179 */
3180 if ((rq->cmd_flags & REQ_RW_META) && !cfqq->meta_pending) 3180 if ((rq->cmd_flags & REQ_META) && !cfqq->meta_pending)
3181 return true; 3181 return true;
3182 3182
3183 /* 3183 /*
@@ -3231,7 +3231,7 @@ cfq_rq_enqueued(struct cfq_data *cfqd, struct cfq_queue *cfqq,
3231 struct cfq_io_context *cic = RQ_CIC(rq); 3231 struct cfq_io_context *cic = RQ_CIC(rq);
3232 3232
3233 cfqd->rq_queued++; 3233 cfqd->rq_queued++;
3234 if (rq->cmd_flags & REQ_RW_META) 3234 if (rq->cmd_flags & REQ_META)
3235 cfqq->meta_pending++; 3235 cfqq->meta_pending++;
3236 3236
3237 cfq_update_io_thinktime(cfqd, cic); 3237 cfq_update_io_thinktime(cfqd, cic);