From owner-svn-src-all@FreeBSD.ORG Tue Aug 31 19:05:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A75C610656AD; Tue, 31 Aug 2010 19:05:48 +0000 (UTC) (envelope-from freebsd-listen@fabiankeil.de) Received: from smtprelay02.ispgateway.de (smtprelay02.ispgateway.de [80.67.31.36]) by mx1.freebsd.org (Postfix) with ESMTP id 39A2C8FC1A; Tue, 31 Aug 2010 19:05:48 +0000 (UTC) Received: from [78.34.172.129] (helo=r500.local) by smtprelay02.ispgateway.de with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.68) (envelope-from ) id 1OqW9R-0003kt-Jn; Tue, 31 Aug 2010 21:05:45 +0200 Date: Tue, 31 Aug 2010 21:05:47 +0200 From: Fabian Keil To: Pawel Jakub Dawidek Message-ID: <20100831210547.52711617@r500.local> In-Reply-To: <20100831185752.GA1932@garage.freebsd.pl> References: <201008311041.o7VAfrAF028012@svn.freebsd.org> <20100831204421.4ad0a99a@r500.local> <20100831185752.GA1932@garage.freebsd.pl> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; amd64-portbld-freebsd9.0) X-PGP-KEY-URL: http://www.fabiankeil.de/gpg-keys/freebsd-listen-2008-08-18.asc Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/YFRJOkttmOWamA47vagVa23"; protocol="application/pgp-signature" X-Df-Sender: 775067 Cc: svn-src-all@freebsd.org Subject: Re: svn commit: r212050 - head/cddl/contrib/opensolaris/cmd/zpool X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Aug 2010 19:05:48 -0000 --Sig_/YFRJOkttmOWamA47vagVa23 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Pawel Jakub Dawidek wrote: > On Tue, Aug 31, 2010 at 08:44:21PM +0200, Fabian Keil wrote: > > Pawel Jakub Dawidek wrote: > > > static int > > > +is_root_pool(zpool_handle_t *zhp) > > > +{ > > > + static struct statfs sfs; > > > + static char *poolname =3D NULL; > > > + static boolean_t stated =3D B_FALSE; > >=20 > > Why are those variables static? They all seem to be (re)initialized > > before first-use in the function. >=20 > Not really. We enter while () loop only if stated is false and it will > be false only for the first call. By having those variables static we > statfs(2) the root file system only once. Right, I missed that. Thanks. Fabian --Sig_/YFRJOkttmOWamA47vagVa23 Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iEYEARECAAYFAkx9Uo8ACgkQBYqIVf93VJ3ccACgnB1DUhy8ohoxxN5PL4fk5U0g MzgAoJjgiOCuaCrEsdTvR20flzhzWy1o =qe5q -----END PGP SIGNATURE----- --Sig_/YFRJOkttmOWamA47vagVa23--