Commit e00ab6b6 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] generic uses of ->rq_dev

	* uses in ll_rw_blk.c and elevator.c eliminated - ->rq_disk has
everything we need.
parent e822d857
...@@ -69,7 +69,7 @@ inline int bio_rq_in_between(struct bio *bio, struct request *rq, ...@@ -69,7 +69,7 @@ inline int bio_rq_in_between(struct bio *bio, struct request *rq,
* if the device is different (not a normal case) just check if * if the device is different (not a normal case) just check if
* bio is after rq * bio is after rq
*/ */
if (!kdev_same(next_rq->rq_dev, rq->rq_dev)) if (next_rq->rq_disk != rq->rq_disk)
return bio->bi_sector > rq->sector; return bio->bi_sector > rq->sector;
/* /*
...@@ -112,7 +112,7 @@ inline int elv_rq_merge_ok(struct request *rq, struct bio *bio) ...@@ -112,7 +112,7 @@ inline int elv_rq_merge_ok(struct request *rq, struct bio *bio)
/* /*
* same device and no special stuff set, merge is ok * same device and no special stuff set, merge is ok
*/ */
if (kdev_same(rq->rq_dev, to_kdev_t(bio->bi_bdev->bd_dev)) && if (rq->rq_disk == bio->bi_bdev->bd_disk &&
!rq->waiting && !rq->special) !rq->waiting && !rq->special)
return 1; return 1;
......
...@@ -584,8 +584,8 @@ int blk_queue_start_tag(request_queue_t *q, struct request *rq) ...@@ -584,8 +584,8 @@ int blk_queue_start_tag(request_queue_t *q, struct request *rq)
if (unlikely((rq->flags & REQ_QUEUED))) { if (unlikely((rq->flags & REQ_QUEUED))) {
printk(KERN_ERR printk(KERN_ERR
"request %p for device [02%x:02%x] already tagged %d", "request %p for device [%s] already tagged %d",
rq, major(rq->rq_dev), minor(rq->rq_dev), rq->tag); rq, rq->rq_disk ? rq->rq_disk->disk_name : "?", rq->tag);
BUG(); BUG();
} }
...@@ -665,7 +665,8 @@ void blk_dump_rq_flags(struct request *rq, char *msg) ...@@ -665,7 +665,8 @@ void blk_dump_rq_flags(struct request *rq, char *msg)
{ {
int bit; int bit;
printk("%s: dev %02x:%02x: flags = ", msg, major(rq->rq_dev), minor(rq->rq_dev)); printk("%s: dev %s: flags = ", msg,
rq->rq_disk ? rq->rq_disk->disk_name : "?");
bit = 0; bit = 0;
do { do {
if (rq->flags & (1 << bit)) if (rq->flags & (1 << bit))
...@@ -1410,9 +1411,8 @@ void blk_insert_request(request_queue_t *q, struct request *rq, ...@@ -1410,9 +1411,8 @@ void blk_insert_request(request_queue_t *q, struct request *rq,
void drive_stat_acct(struct request *rq, int nr_sectors, int new_io) void drive_stat_acct(struct request *rq, int nr_sectors, int new_io)
{ {
unsigned int major = major(rq->rq_dev);
int rw = rq_data_dir(rq); int rw = rq_data_dir(rq);
unsigned int index; unsigned int major, index;
if (!rq->rq_disk) if (!rq->rq_disk)
return; return;
...@@ -1431,6 +1431,7 @@ void drive_stat_acct(struct request *rq, int nr_sectors, int new_io) ...@@ -1431,6 +1431,7 @@ void drive_stat_acct(struct request *rq, int nr_sectors, int new_io)
rq->rq_disk->in_flight++; rq->rq_disk->in_flight++;
} }
major = rq->rq_disk->major;
index = rq->rq_disk->first_minor >> rq->rq_disk->minor_shift; index = rq->rq_disk->first_minor >> rq->rq_disk->minor_shift;
if ((index >= DK_MAX_DISK) || (major >= DK_MAX_MAJOR)) if ((index >= DK_MAX_DISK) || (major >= DK_MAX_MAJOR))
...@@ -1586,7 +1587,7 @@ static void attempt_merge(request_queue_t *q, struct request *req, ...@@ -1586,7 +1587,7 @@ static void attempt_merge(request_queue_t *q, struct request *req,
return; return;
if (rq_data_dir(req) != rq_data_dir(next) if (rq_data_dir(req) != rq_data_dir(next)
|| !kdev_same(req->rq_dev, next->rq_dev) || req->rq_disk != next->rq_disk
|| next->waiting || next->special) || next->waiting || next->special)
return; return;
...@@ -2018,7 +2019,7 @@ static int __end_that_request_first(struct request *req, int uptodate, ...@@ -2018,7 +2019,7 @@ static int __end_that_request_first(struct request *req, int uptodate,
error = -EIO; error = -EIO;
if (!(req->flags & REQ_QUIET)) if (!(req->flags & REQ_QUIET))
printk("end_request: I/O error, dev %s, sector %llu\n", printk("end_request: I/O error, dev %s, sector %llu\n",
kdevname(req->rq_dev), req->rq_disk ? req->rq_disk->disk_name : "?",
(unsigned long long)req->sector); (unsigned long long)req->sector);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment