From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MiqQO-00056e-CN for qemu-devel@nongnu.org; Wed, 02 Sep 2009 10:03:00 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MiqQJ-00056S-TM for qemu-devel@nongnu.org; Wed, 02 Sep 2009 10:03:00 -0400 Received: from [199.232.76.173] (port=56462 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MiqQJ-00056P-Pk for qemu-devel@nongnu.org; Wed, 02 Sep 2009 10:02:55 -0400 Received: from mail-ew0-f223.google.com ([209.85.219.223]:43295) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MiqQJ-00057u-9W for qemu-devel@nongnu.org; Wed, 02 Sep 2009 10:02:55 -0400 Received: by ewy23 with SMTP id 23so888736ewy.8 for ; Wed, 02 Sep 2009 07:02:53 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20090902003705.GA13309@lst.de> References: <20090831201627.GA4811@lst.de> <20090831201709.GB4874@lst.de> <20090901160409.GA22629@lst.de> <20090902003454.GE1321@shareable.org> <20090902003705.GA13309@lst.de> From: Blue Swirl Date: Wed, 2 Sep 2009 17:02:32 +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 Wed, Sep 2, 2009 at 3:37 AM, Christoph Hellwig wrote: > On Wed, Sep 02, 2009 at 01:34:54AM +0100, Jamie Lokier wrote: >> fdatasync is common among the big commercial unixes which were still >> being actively developed a few years ago, but fsync is universal - >> it's very old. >> >> Neither OpenBSD nor FreeBSD have fdatasync. >> >> mingw32 is a thin wrapper around Windows. =C2=A0Windows as far as I can >> tell doesn't have an equivalent of fdatasync, although it does have an >> equivalent of O_DIRECT|O_SYNC (but documentation contradicts itself >> regarding whether the combination flushes metadata on each write). > > Yeah, =C2=A0I'll just add a > > #ifndef _POSIX_SYNCHRONIZED_IO > # define fdatasync(fd) =C2=A0fsync(fd) > #endif > > Now I'm pretty sure we'll find various fuckups where headers define > fdatasync but not _POSIX_SYNCHRONIZED_IO or vice versa, but I can > outsource adding workarounds for that to people with those broken > setups. I'd use a real function, like qemu_fdatasync(). Especially if the Windows equivalent will be complex.