diff options
author | Peter Osterlund <petero2@telia.com> | 2005-09-13 04:25:28 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-13 11:22:30 -0400 |
commit | 06e7ab53f4a1e8bbf66c3985968468949d74d006 (patch) | |
tree | bf5851f4751e63dbab225a3079e3ad90f171d717 | |
parent | a676f8d092f2a3aff419cacae79c80c3b7f6c0f5 (diff) |
[PATCH] pktcdvd: more accurate I/O accounting
In the /proc statistics, only count writes that upper layers have requested.
Don't count additional writes created inside the packet driver to satisfy the
requirement to only write full packets.
Signed-off-by: Peter Osterlund <petero2@telia.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | drivers/block/pktcdvd.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index aacf5cfccada..109db859112a 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c | |||
@@ -736,12 +736,6 @@ static void pkt_gather_data(struct pktcdvd_device *pd, struct packet_data *pkt) | |||
736 | atomic_set(&pkt->io_wait, 0); | 736 | atomic_set(&pkt->io_wait, 0); |
737 | atomic_set(&pkt->io_errors, 0); | 737 | atomic_set(&pkt->io_errors, 0); |
738 | 738 | ||
739 | if (pkt->cache_valid) { | ||
740 | VPRINTK("pkt_gather_data: zone %llx cached\n", | ||
741 | (unsigned long long)pkt->sector); | ||
742 | goto out_account; | ||
743 | } | ||
744 | |||
745 | /* | 739 | /* |
746 | * Figure out which frames we need to read before we can write. | 740 | * Figure out which frames we need to read before we can write. |
747 | */ | 741 | */ |
@@ -750,6 +744,7 @@ static void pkt_gather_data(struct pktcdvd_device *pd, struct packet_data *pkt) | |||
750 | for (bio = pkt->orig_bios; bio; bio = bio->bi_next) { | 744 | for (bio = pkt->orig_bios; bio; bio = bio->bi_next) { |
751 | int first_frame = (bio->bi_sector - pkt->sector) / (CD_FRAMESIZE >> 9); | 745 | int first_frame = (bio->bi_sector - pkt->sector) / (CD_FRAMESIZE >> 9); |
752 | int num_frames = bio->bi_size / CD_FRAMESIZE; | 746 | int num_frames = bio->bi_size / CD_FRAMESIZE; |
747 | pd->stats.secs_w += num_frames * (CD_FRAMESIZE >> 9); | ||
753 | BUG_ON(first_frame < 0); | 748 | BUG_ON(first_frame < 0); |
754 | BUG_ON(first_frame + num_frames > pkt->frames); | 749 | BUG_ON(first_frame + num_frames > pkt->frames); |
755 | for (f = first_frame; f < first_frame + num_frames; f++) | 750 | for (f = first_frame; f < first_frame + num_frames; f++) |
@@ -757,6 +752,12 @@ static void pkt_gather_data(struct pktcdvd_device *pd, struct packet_data *pkt) | |||
757 | } | 752 | } |
758 | spin_unlock(&pkt->lock); | 753 | spin_unlock(&pkt->lock); |
759 | 754 | ||
755 | if (pkt->cache_valid) { | ||
756 | VPRINTK("pkt_gather_data: zone %llx cached\n", | ||
757 | (unsigned long long)pkt->sector); | ||
758 | goto out_account; | ||
759 | } | ||
760 | |||
760 | /* | 761 | /* |
761 | * Schedule reads for missing parts of the packet. | 762 | * Schedule reads for missing parts of the packet. |
762 | */ | 763 | */ |
@@ -790,7 +791,6 @@ out_account: | |||
790 | frames_read, (unsigned long long)pkt->sector); | 791 | frames_read, (unsigned long long)pkt->sector); |
791 | pd->stats.pkt_started++; | 792 | pd->stats.pkt_started++; |
792 | pd->stats.secs_rg += frames_read * (CD_FRAMESIZE >> 9); | 793 | pd->stats.secs_rg += frames_read * (CD_FRAMESIZE >> 9); |
793 | pd->stats.secs_w += pd->settings.size; | ||
794 | } | 794 | } |
795 | 795 | ||
796 | /* | 796 | /* |