aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/pktcdvd.c14
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/*