aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-core.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2010-08-07 12:17:56 -0400
committerJens Axboe <jaxboe@fusionio.com>2010-08-07 12:17:56 -0400
commit33659ebbae262228eef4e0fe990f393d1f0ed941 (patch)
treefcb537f09359c8dad3a6f6e16dc4319562dc42cc /block/blk-core.c
parent7e005f79791dcd58436c88ded4a7f5aed1b82147 (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/blk-core.c')
-rw-r--r--block/blk-core.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index b4131d29148c..dca43a31e725 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -184,7 +184,7 @@ void blk_dump_rq_flags(struct request *rq, char *msg)
184 printk(KERN_INFO " bio %p, biotail %p, buffer %p, len %u\n", 184 printk(KERN_INFO " bio %p, biotail %p, buffer %p, len %u\n",
185 rq->bio, rq->biotail, rq->buffer, blk_rq_bytes(rq)); 185 rq->bio, rq->biotail, rq->buffer, blk_rq_bytes(rq));
186 186
187 if (blk_pc_request(rq)) { 187 if (rq->cmd_type == REQ_TYPE_BLOCK_PC) {
188 printk(KERN_INFO " cdb: "); 188 printk(KERN_INFO " cdb: ");
189 for (bit = 0; bit < BLK_MAX_CDB; bit++) 189 for (bit = 0; bit < BLK_MAX_CDB; bit++)
190 printk("%02x ", rq->cmd[bit]); 190 printk("%02x ", rq->cmd[bit]);
@@ -1796,7 +1796,7 @@ struct request *blk_peek_request(struct request_queue *q)
1796 * sees this request (possibly after 1796 * sees this request (possibly after
1797 * requeueing). Notify IO scheduler. 1797 * requeueing). Notify IO scheduler.
1798 */ 1798 */
1799 if (blk_sorted_rq(rq)) 1799 if (rq->cmd_flags & REQ_SORTED)
1800 elv_activate_rq(q, rq); 1800 elv_activate_rq(q, rq);
1801 1801
1802 /* 1802 /*
@@ -1984,10 +1984,11 @@ bool blk_update_request(struct request *req, int error, unsigned int nr_bytes)
1984 * TODO: tj: This is too subtle. It would be better to let 1984 * TODO: tj: This is too subtle. It would be better to let
1985 * low level drivers do what they see fit. 1985 * low level drivers do what they see fit.
1986 */ 1986 */
1987 if (blk_fs_request(req)) 1987 if (req->cmd_type == REQ_TYPE_FS)
1988 req->errors = 0; 1988 req->errors = 0;
1989 1989
1990 if (error && (blk_fs_request(req) && !(req->cmd_flags & REQ_QUIET))) { 1990 if (error && req->cmd_type == REQ_TYPE_FS &&
1991 !(req->cmd_flags & REQ_QUIET)) {
1991 printk(KERN_ERR "end_request: I/O error, dev %s, sector %llu\n", 1992 printk(KERN_ERR "end_request: I/O error, dev %s, sector %llu\n",
1992 req->rq_disk ? req->rq_disk->disk_name : "?", 1993 req->rq_disk ? req->rq_disk->disk_name : "?",
1993 (unsigned long long)blk_rq_pos(req)); 1994 (unsigned long long)blk_rq_pos(req));
@@ -2074,7 +2075,7 @@ bool blk_update_request(struct request *req, int error, unsigned int nr_bytes)
2074 req->buffer = bio_data(req->bio); 2075 req->buffer = bio_data(req->bio);
2075 2076
2076 /* update sector only for requests with clear definition of sector */ 2077 /* update sector only for requests with clear definition of sector */
2077 if (blk_fs_request(req) || blk_discard_rq(req)) 2078 if (req->cmd_type == REQ_TYPE_FS || (req->cmd_flags & REQ_DISCARD))
2078 req->__sector += total_bytes >> 9; 2079 req->__sector += total_bytes >> 9;
2079 2080
2080 /* mixed attributes always follow the first bio */ 2081 /* mixed attributes always follow the first bio */
@@ -2127,7 +2128,7 @@ static void blk_finish_request(struct request *req, int error)
2127 2128
2128 BUG_ON(blk_queued_rq(req)); 2129 BUG_ON(blk_queued_rq(req));
2129 2130
2130 if (unlikely(laptop_mode) && blk_fs_request(req)) 2131 if (unlikely(laptop_mode) && req->cmd_type == REQ_TYPE_FS)
2131 laptop_io_completion(&req->q->backing_dev_info); 2132 laptop_io_completion(&req->q->backing_dev_info);
2132 2133
2133 blk_delete_timer(req); 2134 blk_delete_timer(req);