From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Midqc-0003lE-7s for qemu-devel@nongnu.org; Tue, 01 Sep 2009 20:37:14 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MidqX-0003kh-M7 for qemu-devel@nongnu.org; Tue, 01 Sep 2009 20:37:13 -0400 Received: from [199.232.76.173] (port=42435 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MidqX-0003ke-GN for qemu-devel@nongnu.org; Tue, 01 Sep 2009 20:37:09 -0400 Received: from verein.lst.de ([213.95.11.210]:33397) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.60) (envelope-from ) id 1MidqX-0005lG-04 for qemu-devel@nongnu.org; Tue, 01 Sep 2009 20:37:09 -0400 Date: Wed, 2 Sep 2009 02:37:05 +0200 From: Christoph Hellwig Subject: Re: [Qemu-devel] [PATCH 2/4] block: use fdatasync instead of fsync Message-ID: <20090902003705.GA13309@lst.de> References: <20090831201627.GA4811@lst.de> <20090831201709.GB4874@lst.de> <20090901160409.GA22629@lst.de> <20090902003454.GE1321@shareable.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090902003454.GE1321@shareable.org> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jamie Lokier Cc: Blue Swirl , Christoph Hellwig , qemu-devel@nongnu.org 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. Windows 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, I'll just add a #ifndef _POSIX_SYNCHRONIZED_IO # define fdatasync(fd) fsync(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.