PERFORCE change 89239 for review

Kip Macy kmacy at FreeBSD.org
Thu Jan 5 15:20:16 PST 2006


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

Change 89239 by kmacy at kmacy:freebsd7_xen3 on 2006/01/05 23:19:48

	remove some dead code and don't disksort when not needed

Affected files ...

.. //depot/projects/xen3/src/sys/dev/xen/blkfront/blkfront.c#3 edit

Differences ...

==== //depot/projects/xen3/src/sys/dev/xen/blkfront/blkfront.c#3 (text+ko) ====

@@ -128,7 +128,6 @@
 #define XBD_SECTOR_SHFT		9
 
 static struct mtx blkif_io_lock;
-static struct mtx bioq_lock;
 
 static unsigned long 
 pfn_to_mfn(unsigned long pfn)
@@ -189,8 +188,6 @@
 }
 /************************ end VBD support *****************/
 
-#define USELOCK 0
-
 /*
  * Read/write routine for a buffer.  Finds the proper unit, place it on
  * the sortq and kick the controller.
@@ -209,20 +206,13 @@
 	}
 
 	DPRINTK("");
-#if USELOCK
-	mtx_lock_irqsave(&bioq_lock, flags);
-#else 
+
 	flags = splbio();
-#endif
 	/*
 	 * Place it in the queue of disk activities for this disk
 	 */
 	bioq_disksort(&sc->xb_bioq, bp);
-#if USELOCK
-	mtx_unlock_irqrestore(&bioq_lock, flags);
-#else
 	splx(flags);
-#endif
 
 	xb_startio(sc);
 	return;
@@ -773,34 +763,21 @@
 	int			flags, queued = 0;
 	struct blkfront_info *info = sc->xb_info;
 	DPRINTK("");
-#if USELOCK
-	mtx_lock_irqsave(&bioq_lock, flags);
-#else 
+
 	flags = splbio();
-#endif
+
 	while ((bp = bioq_takefirst(&sc->xb_bioq)) != NULL) {
 
 		if (RING_FULL(&info->ring)) 
 			goto wait;
     	
-#if USELOCK
-		mtx_unlock_irqrestore(&bioq_lock, flags);
-#else 
 		splx(flags);
-#endif
+
 		if (blkif_queue_request(bp)) {
-#if USELOCK
-			mtx_lock_irqsave(&bioq_lock, flags);
-#else
 			flags = splbio();
-#endif
 		wait:
-			bioq_disksort(&sc->xb_bioq, bp);
-#if USELOCK
-			mtx_unlock_irqrestore(&bioq_lock, flags);
-#else
+			bioq_insert_head(&sc->xb_bioq, bp);
 			splx(flags);
-#endif
 			break;
 		}
 		queued++;
@@ -1018,7 +995,6 @@
 }
 
 MTX_SYSINIT(ioreq, &blkif_io_lock, "BIO LOCK", MTX_SPIN | MTX_NOWITNESS); /* XXX how does one enroll a lock? */
-MTX_SYSINIT(bio, &bioq_lock, "BIOQ LOCK", MTX_SPIN | MTX_NOWITNESS); /* XXX how does one enroll a lock? */
 MTX_SYSINIT(ioreq_block, &blkif_io_block_lock, "BIO BLOCK LOCK", MTX_SPIN | MTX_NOWITNESS);
 SYSINIT(xbdev, SI_SUB_PSEUDO, SI_ORDER_ANY, xenbus_init, NULL);
 


More information about the p4-projects mailing list