From owner-p4-projects@FreeBSD.ORG Thu Jan 5 23:20:15 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 2F13B16A422; Thu, 5 Jan 2006 23:20:15 +0000 (GMT) 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 F3F0B16A41F for ; Thu, 5 Jan 2006 23:20:14 +0000 (GMT) (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 A440943D55 for ; Thu, 5 Jan 2006 23:20:14 +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 k05NKENP050852 for ; Thu, 5 Jan 2006 23:20:14 GMT (envelope-from kmacy@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k05NKEdo050849 for perforce@freebsd.org; Thu, 5 Jan 2006 23:20:14 GMT (envelope-from kmacy@freebsd.org) Date: Thu, 5 Jan 2006 23:20:14 GMT Message-Id: <200601052320.k05NKEdo050849@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 89239 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: Thu, 05 Jan 2006 23:20:16 -0000 http://perforce.freebsd.org/chv.cgi?CH=89239 Change 89239 by kmacy@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);