PERFORCE change 93424 for review

Kip Macy kmacy at FreeBSD.org
Fri Mar 17 00:48:33 UTC 2006


http://perforce.freebsd.org/chv.cgi?CH=93424

Change 93424 by kmacy at kmacy_storage:sun4v_work on 2006/03/17 00:47:49

	fix I/O handling for requests larger than PAGE_SIZE

Affected files ...

.. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/simdisk.c#2 edit

Differences ...

==== //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/simdisk.c#2 (text+ko) ====

@@ -89,18 +89,22 @@
 hvd_startio(struct hvd_softc *sc, struct bio *bp)
 {
 	u_int r;
-#if 0
-	printf("hvd_startio called \n");
-#endif
-	r = 0;
+	int len;
+	r = H_EOK;
+
         switch (bp->bio_cmd) {
         case BIO_READ:
-		r = hv_sim_read(bp->bio_offset, vtophys((void *)bp->bio_data),
-		        bp->bio_length);
+		for (len = 0; len < bp->bio_length && r == H_EOK; len += PAGE_SIZE) {
+			int rlen = (bp->bio_length - len) > PAGE_SIZE ? PAGE_SIZE : bp->bio_length - len;
+			r = hv_sim_read(bp->bio_offset + len, vtophys((char *)bp->bio_data + len), rlen);
+
+		}
                 break;
         case BIO_WRITE:
-		r = hv_sim_read(bp->bio_offset, vtophys((void *)bp->bio_data),
-		        bp->bio_length);
+		for (len = 0; len < bp->bio_length && r == H_EOK; len += PAGE_SIZE) {
+			int wlen = (bp->bio_length - len) > PAGE_SIZE ? PAGE_SIZE : bp->bio_length - len;
+			r = hv_sim_write(bp->bio_offset + len, vtophys((char *)bp->bio_data + len), wlen);
+		}
                 break;
         }
 	if (r != H_EOK)


More information about the p4-projects mailing list