Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Aug 2014 08:50:05 +0000 (UTC)
From:      Roger Pau Monné <royger@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r270130 - stable/10/sys/dev/xen/blkfront
Message-ID:  <201408180850.s7I8o53Q050143@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: royger
Date: Mon Aug 18 08:50:05 2014
New Revision: 270130
URL: http://svnweb.freebsd.org/changeset/base/270130

Log:
  MFC r269814:
  
  blkfront: add support for unmapped IO
  
  Sponsored by:	Citrix Systems R&D
  Tested by:	robak
  PR:		191173

Modified:
  stable/10/sys/dev/xen/blkfront/blkfront.c

Modified: stable/10/sys/dev/xen/blkfront/blkfront.c
==============================================================================
--- stable/10/sys/dev/xen/blkfront/blkfront.c	Mon Aug 18 08:07:50 2014	(r270129)
+++ stable/10/sys/dev/xen/blkfront/blkfront.c	Mon Aug 18 08:50:05 2014	(r270130)
@@ -272,8 +272,12 @@ xbd_queue_request(struct xbd_softc *sc, 
 {
 	int error;
 
-	error = bus_dmamap_load(sc->xbd_io_dmat, cm->cm_map, cm->cm_data,
-	    cm->cm_datalen, xbd_queue_cb, cm, 0);
+	if (cm->cm_bp != NULL)
+		error = bus_dmamap_load_bio(sc->xbd_io_dmat, cm->cm_map,
+		    cm->cm_bp, xbd_queue_cb, cm, 0);
+	else
+		error = bus_dmamap_load(sc->xbd_io_dmat, cm->cm_map,
+		    cm->cm_data, cm->cm_datalen, xbd_queue_cb, cm, 0);
 	if (error == EINPROGRESS) {
 		/*
 		 * Maintain queuing order by freezing the queue.  The next
@@ -333,8 +337,6 @@ xbd_bio_command(struct xbd_softc *sc)
 	}
 
 	cm->cm_bp = bp;
-	cm->cm_data = bp->bio_data;
-	cm->cm_datalen = bp->bio_bcount;
 	cm->cm_sector_number = (blkif_sector_t)bp->bio_pblkno;
 
 	switch (bp->bio_cmd) {
@@ -993,7 +995,7 @@ xbd_instance_create(struct xbd_softc *sc
 
 	sc->xbd_disk->d_mediasize = sectors * sector_size;
 	sc->xbd_disk->d_maxsize = sc->xbd_max_request_size;
-	sc->xbd_disk->d_flags = 0;
+	sc->xbd_disk->d_flags = DISKFLAG_UNMAPPED_BIO;
 	if ((sc->xbd_flags & (XBDF_FLUSH|XBDF_BARRIER)) != 0) {
 		sc->xbd_disk->d_flags |= DISKFLAG_CANFLUSHCACHE;
 		device_printf(sc->xbd_dev,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201408180850.s7I8o53Q050143>