Skip to content

Commit

Permalink
[PATCH] device-mapper statistics: basic
Browse files Browse the repository at this point in the history
Record basic I/O statistics for mapped devices.

Signed-off-by: Kevin Corry <kevcorry@us.ibm.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Kevin Corry authored and Linus Torvalds committed Feb 1, 2006
1 parent dab6a42 commit 12f03a4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/md/dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -573,10 +573,14 @@ static void __split_bio(struct mapped_device *md, struct bio *bio)
static int dm_request(request_queue_t *q, struct bio *bio)
{
int r;
int rw = bio_data_dir(bio);
struct mapped_device *md = q->queuedata;

down_read(&md->io_lock);

disk_stat_inc(dm_disk(md), ios[rw]);
disk_stat_add(dm_disk(md), sectors[rw], bio_sectors(bio));

/*
* If we're suspended we have to queue
* this io for later.
Expand Down

0 comments on commit 12f03a4

Please sign in to comment.