[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/4] block: use fdatasync instead of fsync
From: |
Blue Swirl |
Subject: |
Re: [Qemu-devel] [PATCH 2/4] block: use fdatasync instead of fsync |
Date: |
Wed, 2 Sep 2009 17:02:32 +0300 |
On Wed, Sep 2, 2009 at 3:37 AM, Christoph Hellwig<address@hidden> 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. 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.
I'd use a real function, like qemu_fdatasync(). Especially if the
Windows equivalent will be complex.