From owner-svn-src-stable@FreeBSD.ORG Sat May 24 10:20:57 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 784554B3; Sat, 24 May 2014 10:20:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 647C32E75; Sat, 24 May 2014 10:20:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4OAKv41011718; Sat, 24 May 2014 10:20:57 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4OAKvq4011717; Sat, 24 May 2014 10:20:57 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201405241020.s4OAKvq4011717@svn.freebsd.org> From: Alexander Motin Date: Sat, 24 May 2014 10:20:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266608 - stable/10/sys/geom X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 May 2014 10:20:57 -0000 Author: mav Date: Sat May 24 10:20:56 2014 New Revision: 266608 URL: http://svnweb.freebsd.org/changeset/base/266608 Log: MFC r266319: Make GEOM DISK to account also BIO_FLUSH operations. Modified: stable/10/sys/geom/geom_disk.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/geom/geom_disk.c ============================================================================== --- stable/10/sys/geom/geom_disk.c Sat May 24 09:50:10 2014 (r266607) +++ stable/10/sys/geom/geom_disk.c Sat May 24 10:20:56 2014 (r266608) @@ -243,7 +243,7 @@ g_disk_done(struct bio *bp) if (bp2->bio_error == 0) bp2->bio_error = bp->bio_error; bp2->bio_completed += bp->bio_completed; - if ((bp->bio_cmd & (BIO_READ|BIO_WRITE|BIO_DELETE)) != 0) + if ((bp->bio_cmd & (BIO_READ|BIO_WRITE|BIO_DELETE|BIO_FLUSH)) != 0) devstat_end_transaction_bio_bt(sc->dp->d_devstat, bp, &now); bp2->bio_inbed++; if (bp2->bio_children == bp2->bio_inbed) { @@ -264,7 +264,7 @@ g_disk_done_single(struct bio *bp) bp->bio_completed = bp->bio_length - bp->bio_resid; bp->bio_done = (void *)bp->bio_to; bp->bio_to = LIST_FIRST(&bp->bio_disk->d_geom->provider); - if ((bp->bio_cmd & (BIO_READ|BIO_WRITE|BIO_DELETE)) != 0) { + if ((bp->bio_cmd & (BIO_READ|BIO_WRITE|BIO_DELETE|BIO_FLUSH)) != 0) { binuptime(&now); sc = bp->bio_to->private; mtx_lock(&sc->done_mtx); @@ -441,6 +441,9 @@ g_disk_start(struct bio *bp) bp->bio_disk = dp; bp->bio_to = (void *)bp->bio_done; bp->bio_done = g_disk_done_single; + mtx_lock(&sc->start_mtx); + devstat_start_transaction_bio(dp->d_devstat, bp); + mtx_unlock(&sc->start_mtx); g_disk_lock_giant(dp); dp->d_strategy(bp); g_disk_unlock_giant(dp);