diff options
Diffstat (limited to 'block/blk-core.c')
-rw-r--r-- | block/blk-core.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index 25572802dac2..43fdedc524ee 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
@@ -64,12 +64,11 @@ static struct workqueue_struct *kblockd_workqueue; | |||
64 | 64 | ||
65 | static void drive_stat_acct(struct request *rq, int new_io) | 65 | static void drive_stat_acct(struct request *rq, int new_io) |
66 | { | 66 | { |
67 | struct gendisk *disk = rq->rq_disk; | ||
68 | struct hd_struct *part; | 67 | struct hd_struct *part; |
69 | int rw = rq_data_dir(rq); | 68 | int rw = rq_data_dir(rq); |
70 | int cpu; | 69 | int cpu; |
71 | 70 | ||
72 | if (!blk_fs_request(rq) || !disk || !blk_do_io_stat(disk->queue)) | 71 | if (!blk_fs_request(rq) || !blk_do_io_stat(rq)) |
73 | return; | 72 | return; |
74 | 73 | ||
75 | cpu = part_stat_lock(); | 74 | cpu = part_stat_lock(); |
@@ -1124,8 +1123,6 @@ void init_request_from_bio(struct request *req, struct bio *bio) | |||
1124 | 1123 | ||
1125 | if (bio_sync(bio)) | 1124 | if (bio_sync(bio)) |
1126 | req->cmd_flags |= REQ_RW_SYNC; | 1125 | req->cmd_flags |= REQ_RW_SYNC; |
1127 | if (bio_unplug(bio)) | ||
1128 | req->cmd_flags |= REQ_UNPLUG; | ||
1129 | if (bio_rw_meta(bio)) | 1126 | if (bio_rw_meta(bio)) |
1130 | req->cmd_flags |= REQ_RW_META; | 1127 | req->cmd_flags |= REQ_RW_META; |
1131 | if (bio_noidle(bio)) | 1128 | if (bio_noidle(bio)) |
@@ -1675,9 +1672,7 @@ EXPORT_SYMBOL(blkdev_dequeue_request); | |||
1675 | 1672 | ||
1676 | static void blk_account_io_completion(struct request *req, unsigned int bytes) | 1673 | static void blk_account_io_completion(struct request *req, unsigned int bytes) |
1677 | { | 1674 | { |
1678 | struct gendisk *disk = req->rq_disk; | 1675 | if (!blk_do_io_stat(req)) |
1679 | |||
1680 | if (!disk || !blk_do_io_stat(disk->queue)) | ||
1681 | return; | 1676 | return; |
1682 | 1677 | ||
1683 | if (blk_fs_request(req)) { | 1678 | if (blk_fs_request(req)) { |
@@ -1694,9 +1689,7 @@ static void blk_account_io_completion(struct request *req, unsigned int bytes) | |||
1694 | 1689 | ||
1695 | static void blk_account_io_done(struct request *req) | 1690 | static void blk_account_io_done(struct request *req) |
1696 | { | 1691 | { |
1697 | struct gendisk *disk = req->rq_disk; | 1692 | if (!blk_do_io_stat(req)) |
1698 | |||
1699 | if (!disk || !blk_do_io_stat(disk->queue)) | ||
1700 | return; | 1693 | return; |
1701 | 1694 | ||
1702 | /* | 1695 | /* |
@@ -1711,7 +1704,7 @@ static void blk_account_io_done(struct request *req) | |||
1711 | int cpu; | 1704 | int cpu; |
1712 | 1705 | ||
1713 | cpu = part_stat_lock(); | 1706 | cpu = part_stat_lock(); |
1714 | part = disk_map_sector_rcu(disk, req->sector); | 1707 | part = disk_map_sector_rcu(req->rq_disk, req->sector); |
1715 | 1708 | ||
1716 | part_stat_inc(cpu, part, ios[rw]); | 1709 | part_stat_inc(cpu, part, ios[rw]); |
1717 | part_stat_add(cpu, part, ticks[rw], duration); | 1710 | part_stat_add(cpu, part, ticks[rw], duration); |