From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MKVyM-0002n0-EK for qemu-devel@nongnu.org; Sat, 27 Jun 2009 07:21:30 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MKVyF-0002lD-TS for qemu-devel@nongnu.org; Sat, 27 Jun 2009 07:21:27 -0400 Received: from [199.232.76.173] (port=58060 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MKVyD-0002l2-VR for qemu-devel@nongnu.org; Sat, 27 Jun 2009 07:21:22 -0400 Received: from moutng.kundenserver.de ([212.227.126.187]:51555) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MKVyD-0005Xh-7v for qemu-devel@nongnu.org; Sat, 27 Jun 2009 07:21:21 -0400 Received: from localhost ([127.0.0.1] ident=stefan) by flocke.weilnetz.de with esmtp (Exim 4.69) (envelope-from ) id 1MKVy9-0002lz-Lc for qemu-devel@nongnu.org; Sat, 27 Jun 2009 13:21:17 +0200 Message-ID: <4A4600AD.2000903@mail.berlios.de> Date: Sat, 27 Jun 2009 13:21:17 +0200 From: Stefan Weil MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] qcow2: Cache refcount blocks during snapshot creation References: <1246040378-4134-1-git-send-email-kwolf@redhat.com> <20090626184806.GE1119@codesourcery.com> <4A45DFF5.6080909@redhat.com> In-Reply-To: <4A45DFF5.6080909@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-devel@nongnu.org Kevin Wolf schrieb: > Nathan Froyd schrieb: >> On Fri, Jun 26, 2009 at 08:19:38PM +0200, Kevin Wolf wrote: >>> + if (s->refcount_block_cache_offset == 0) { >>> + return 0; >>> + } >>> + >>> + if (bdrv_pwrite(s->hd, s->refcount_block_cache_offset, >>> + s->refcount_block_cache, size) != size) >>> + { >> Nit: bad formatting for opening brace here. > > Oh, I like nitpicking. The coding style says: "The opening brace is on > the line that contains the control flow statement that introduces the > new block". No way to conform here without breaking the 80 characters > limit, so I did what I think is most reasonable. ;-) > > I guess you mean something like the following: > > if (bdrv_pwrite(s->hd, s->refcount_block_cache_offset, > s->refcount_block_cache, size) != size) { > do_it(); > } > > I don't like this very much because you can't see from the indentation > where the condition ends and the "then" branch begins (which is > different from a single-line condition). Maybe something to clarify in > the coding style and I'll happily follow it then. > > Kevin > > > Or like this? if (bdrv_pwrite(s->hd, s->refcount_block_cache_offset, s->refcount_block_cache, size) != size) { do_it(); } Stefan :-)