Date: Fri, 17 Mar 2006 00:48:32 GMT From: Kip Macy <kmacy@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 93424 for review Message-ID: <200603170048.k2H0mWr4026289@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=93424 Change 93424 by kmacy@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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200603170048.k2H0mWr4026289>