diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2009-04-24 02:10:11 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2009-04-28 01:37:37 -0400 |
commit | c2553b5844b06910435e40cfab9e6f384840cb97 (patch) | |
tree | 00a6a1f0c056f19050a8b7c7a1db7b7e0e502062 /block/blk-core.c | |
parent | 731ec497e5888c6792ad62613ae9be97eebcd7ca (diff) |
block: make blk_do_io_stat() do the full "is this rq accountable" checks
We currently check for file system requests outside of blk_do_io_stat(rq),
but we may as well just include it.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block/blk-core.c')
-rw-r--r-- | block/blk-core.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index 6dd180cf15d2..1e3b97f0ae6e 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
@@ -68,7 +68,7 @@ static void drive_stat_acct(struct request *rq, int new_io) | |||
68 | int rw = rq_data_dir(rq); | 68 | int rw = rq_data_dir(rq); |
69 | int cpu; | 69 | int cpu; |
70 | 70 | ||
71 | if (!blk_fs_request(rq) || !blk_do_io_stat(rq)) | 71 | if (!blk_do_io_stat(rq)) |
72 | return; | 72 | return; |
73 | 73 | ||
74 | cpu = part_stat_lock(); | 74 | cpu = part_stat_lock(); |
@@ -1639,10 +1639,7 @@ EXPORT_SYMBOL(blkdev_dequeue_request); | |||
1639 | 1639 | ||
1640 | static void blk_account_io_completion(struct request *req, unsigned int bytes) | 1640 | static void blk_account_io_completion(struct request *req, unsigned int bytes) |
1641 | { | 1641 | { |
1642 | if (!blk_do_io_stat(req)) | 1642 | if (blk_do_io_stat(req)) { |
1643 | return; | ||
1644 | |||
1645 | if (blk_fs_request(req)) { | ||
1646 | const int rw = rq_data_dir(req); | 1643 | const int rw = rq_data_dir(req); |
1647 | struct hd_struct *part; | 1644 | struct hd_struct *part; |
1648 | int cpu; | 1645 | int cpu; |
@@ -1656,15 +1653,12 @@ static void blk_account_io_completion(struct request *req, unsigned int bytes) | |||
1656 | 1653 | ||
1657 | static void blk_account_io_done(struct request *req) | 1654 | static void blk_account_io_done(struct request *req) |
1658 | { | 1655 | { |
1659 | if (!blk_do_io_stat(req)) | ||
1660 | return; | ||
1661 | |||
1662 | /* | 1656 | /* |
1663 | * Account IO completion. bar_rq isn't accounted as a normal | 1657 | * Account IO completion. bar_rq isn't accounted as a normal |
1664 | * IO on queueing nor completion. Accounting the containing | 1658 | * IO on queueing nor completion. Accounting the containing |
1665 | * request is enough. | 1659 | * request is enough. |
1666 | */ | 1660 | */ |
1667 | if (blk_fs_request(req) && req != &req->q->bar_rq) { | 1661 | if (blk_do_io_stat(req) && req != &req->q->bar_rq) { |
1668 | unsigned long duration = jiffies - req->start_time; | 1662 | unsigned long duration = jiffies - req->start_time; |
1669 | const int rw = rq_data_dir(req); | 1663 | const int rw = rq_data_dir(req); |
1670 | struct hd_struct *part; | 1664 | struct hd_struct *part; |