diff options
author | NeilBrown <neilb@suse.de> | 2010-03-25 01:20:56 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2010-05-18 01:27:52 -0400 |
commit | 490773268cf64f68da2470e07b52c7944da6312d (patch) | |
tree | d394aafa7203c316db6b63f128b8894e18993fca /drivers/md/linear.c | |
parent | 2b7f22284d71975e37a82db154386348eec0e52c (diff) |
md: move io accounting out of personalities into md_make_request
While I generally prefer letting personalities do as much as possible,
given that we have a central md_make_request anyway we may as well use
it to simplify code.
Also this centralises knowledge of ->gendisk which will help later.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/linear.c')
-rw-r--r-- | drivers/md/linear.c | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/drivers/md/linear.c b/drivers/md/linear.c index 9db8ee0614a4..3048c1704f40 100644 --- a/drivers/md/linear.c +++ b/drivers/md/linear.c | |||
@@ -288,23 +288,15 @@ static int linear_stop (mddev_t *mddev) | |||
288 | 288 | ||
289 | static int linear_make_request (struct request_queue *q, struct bio *bio) | 289 | static int linear_make_request (struct request_queue *q, struct bio *bio) |
290 | { | 290 | { |
291 | const int rw = bio_data_dir(bio); | ||
292 | mddev_t *mddev = q->queuedata; | 291 | mddev_t *mddev = q->queuedata; |
293 | dev_info_t *tmp_dev; | 292 | dev_info_t *tmp_dev; |
294 | sector_t start_sector; | 293 | sector_t start_sector; |
295 | int cpu; | ||
296 | 294 | ||
297 | if (unlikely(bio_rw_flagged(bio, BIO_RW_BARRIER))) { | 295 | if (unlikely(bio_rw_flagged(bio, BIO_RW_BARRIER))) { |
298 | md_barrier_request(mddev, bio); | 296 | md_barrier_request(mddev, bio); |
299 | return 0; | 297 | return 0; |
300 | } | 298 | } |
301 | 299 | ||
302 | cpu = part_stat_lock(); | ||
303 | part_stat_inc(cpu, &mddev->gendisk->part0, ios[rw]); | ||
304 | part_stat_add(cpu, &mddev->gendisk->part0, sectors[rw], | ||
305 | bio_sectors(bio)); | ||
306 | part_stat_unlock(); | ||
307 | |||
308 | rcu_read_lock(); | 300 | rcu_read_lock(); |
309 | tmp_dev = which_dev(mddev, bio->bi_sector); | 301 | tmp_dev = which_dev(mddev, bio->bi_sector); |
310 | start_sector = tmp_dev->end_sector - tmp_dev->rdev->sectors; | 302 | start_sector = tmp_dev->end_sector - tmp_dev->rdev->sectors; |