aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-core.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2008-08-25 06:47:17 -0400
committerJens Axboe <jens.axboe@oracle.com>2008-10-09 02:56:04 -0400
commit310a2c1012934f590192377f65940cad4aa72b15 (patch)
treeed30346abf07c5a7e94719f567368d5642af1f95 /block/blk-core.c
parent88e341261ca4d39eec21b212961c77eff51105f7 (diff)
block: misc updates
This patch makes the following misc updates in preparation for disk->part dereference fix and extended block devt support. * implment part_to_disk() * fix comment about gendisk->part indexing * rename get_part() to disk_map_sector() * don't use n which is always zero while printing disk information in diskstats_show() Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block/blk-core.c')
-rw-r--r--block/blk-core.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index 86d22e7d65c5..a0dc2e72fcbb 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -60,7 +60,7 @@ static void drive_stat_acct(struct request *rq, int new_io)
60 if (!blk_fs_request(rq) || !rq->rq_disk) 60 if (!blk_fs_request(rq) || !rq->rq_disk)
61 return; 61 return;
62 62
63 part = get_part(rq->rq_disk, rq->sector); 63 part = disk_map_sector(rq->rq_disk, rq->sector);
64 if (!new_io) 64 if (!new_io)
65 __all_stat_inc(rq->rq_disk, part, merges[rw], rq->sector); 65 __all_stat_inc(rq->rq_disk, part, merges[rw], rq->sector);
66 else { 66 else {
@@ -1557,7 +1557,8 @@ static int __end_that_request_first(struct request *req, int error,
1557 } 1557 }
1558 1558
1559 if (blk_fs_request(req) && req->rq_disk) { 1559 if (blk_fs_request(req) && req->rq_disk) {
1560 struct hd_struct *part = get_part(req->rq_disk, req->sector); 1560 struct hd_struct *part =
1561 disk_map_sector(req->rq_disk, req->sector);
1561 const int rw = rq_data_dir(req); 1562 const int rw = rq_data_dir(req);
1562 1563
1563 all_stat_add(req->rq_disk, part, sectors[rw], 1564 all_stat_add(req->rq_disk, part, sectors[rw],
@@ -1745,7 +1746,7 @@ static void end_that_request_last(struct request *req, int error)
1745 if (disk && blk_fs_request(req) && req != &req->q->bar_rq) { 1746 if (disk && blk_fs_request(req) && req != &req->q->bar_rq) {
1746 unsigned long duration = jiffies - req->start_time; 1747 unsigned long duration = jiffies - req->start_time;
1747 const int rw = rq_data_dir(req); 1748 const int rw = rq_data_dir(req);
1748 struct hd_struct *part = get_part(disk, req->sector); 1749 struct hd_struct *part = disk_map_sector(disk, req->sector);
1749 1750
1750 __all_stat_inc(disk, part, ios[rw], req->sector); 1751 __all_stat_inc(disk, part, ios[rw], req->sector);
1751 __all_stat_add(disk, part, ticks[rw], duration, req->sector); 1752 __all_stat_add(disk, part, ticks[rw], duration, req->sector);