[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: |
Jamie Lokier |
Subject: |
Re: [Qemu-devel] [PATCH 2/4] block: use fdatasync instead of fsync |
Date: |
Wed, 2 Sep 2009 01:34:54 +0100 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
Christoph Hellwig wrote:
> On Tue, Sep 01, 2009 at 06:59:46PM +0300, Blue Swirl wrote:
> > On Mon, Aug 31, 2009 at 11:17 PM, Christoph Hellwig<address@hidden> 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. ??So use fdatasync instead of fsync to implement
> > > the flush operations.
> >
> > > - ?? ??fsync(s->fd);
> > > + ?? ??fdatasync(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.
>
> Oh, okay. Kinda sad that people still don't implement useful inteface
> that have been in Posix for a long time.
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).
-- Jamie