From owner-p4-projects@FreeBSD.ORG Fri Mar 17 00:48:33 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 649D216A424; Fri, 17 Mar 2006 00:48:33 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 29D0116A401 for ; Fri, 17 Mar 2006 00:48:33 +0000 (UTC) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id EB5CA43D48 for ; Fri, 17 Mar 2006 00:48:32 +0000 (GMT) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k2H0mWRZ026292 for ; Fri, 17 Mar 2006 00:48:32 GMT (envelope-from kmacy@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k2H0mWr4026289 for perforce@freebsd.org; Fri, 17 Mar 2006 00:48:32 GMT (envelope-from kmacy@freebsd.org) Date: Fri, 17 Mar 2006 00:48:32 GMT Message-Id: <200603170048.k2H0mWr4026289@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to kmacy@freebsd.org using -f From: Kip Macy To: Perforce Change Reviews Cc: Subject: PERFORCE change 93424 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Mar 2006 00:48:33 -0000 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)