From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MiW00-0003AG-CM for qemu-devel@nongnu.org; Tue, 01 Sep 2009 12:14:24 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MiVzv-00034k-H5 for qemu-devel@nongnu.org; Tue, 01 Sep 2009 12:14:23 -0400 Received: from [199.232.76.173] (port=49140 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MiVzv-00034X-Cr for qemu-devel@nongnu.org; Tue, 01 Sep 2009 12:14:19 -0400 Received: from mail-ew0-f223.google.com ([209.85.219.223]:54725) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MiVmG-00013M-53 for qemu-devel@nongnu.org; Tue, 01 Sep 2009 12:00:12 -0400 Received: by ewy23 with SMTP id 23so94692ewy.8 for ; Tue, 01 Sep 2009 09:00:06 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20090831201709.GB4874@lst.de> References: <20090831201627.GA4811@lst.de> <20090831201709.GB4874@lst.de> From: Blue Swirl Date: Tue, 1 Sep 2009 18:59:46 +0300 Message-ID: Subject: Re: [Qemu-devel] [PATCH 2/4] block: use fdatasync instead of fsync Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christoph Hellwig Cc: qemu-devel@nongnu.org On Mon, Aug 31, 2009 at 11:17 PM, Christoph Hellwig wrote: > > If we are flushing the caches for our image files we only care about the > data (including the metadata required for accessing it) but not things > like timestamp updates. =C2=A0So use fdatasync instead of fsync to implem= ent > the flush operations. > - =C2=A0 =C2=A0fsync(s->fd); > + =C2=A0 =C2=A0fdatasync(s->fd); There is no fdatasync outside of Linux, not in OpenBSD and mingw32 at least. But you could add a probe for it to configure.