svn commit: r245720 - projects/virtio/sys/dev/virtio/balloon

Bryan Venteicher bryanv at FreeBSD.org
Mon Jan 21 06:57:32 UTC 2013


Author: bryanv
Date: Mon Jan 21 06:57:31 2013
New Revision: 245720
URL: http://svnweb.freebsd.org/changeset/base/245720

Log:
  virtio_balloon: Simplify lowmem handling in vtballoon_inflate()
  
  Approved by:	grehan (implicit)

Modified:
  projects/virtio/sys/dev/virtio/balloon/virtio_balloon.c

Modified: projects/virtio/sys/dev/virtio/balloon/virtio_balloon.c
==============================================================================
--- projects/virtio/sys/dev/virtio/balloon/virtio_balloon.c	Mon Jan 21 06:55:51 2013	(r245719)
+++ projects/virtio/sys/dev/virtio/balloon/virtio_balloon.c	Mon Jan 21 06:57:31 2013	(r245720)
@@ -319,14 +319,15 @@ vtballoon_inflate(struct vtballoon_softc
 	int i;
 
 	vq = sc->vtballoon_inflate_vq;
-	m = NULL;
 
 	if (npages > VTBALLOON_PAGES_PER_REQUEST)
 		npages = VTBALLOON_PAGES_PER_REQUEST;
 
 	for (i = 0; i < npages; i++) {
-		if ((m = vtballoon_alloc_page(sc)) == NULL)
+		if ((m = vtballoon_alloc_page(sc)) == NULL) {
+			sc->vtballoon_timeout = VTBALLOON_LOWMEM_TIMEOUT;
 			break;
+		}
 
 		sc->vtballoon_page_frames[i] =
 		    VM_PAGE_TO_PHYS(m) >> VIRTIO_BALLOON_PFN_SHIFT;
@@ -338,9 +339,6 @@ vtballoon_inflate(struct vtballoon_softc
 
 	if (i > 0)
 		vtballoon_send_page_frames(sc, vq, i);
-
-	if (m == NULL)
-		sc->vtballoon_timeout = VTBALLOON_LOWMEM_TIMEOUT;
 }
 
 static void


More information about the svn-src-projects mailing list