public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* O_DSYNC flag for open
@ 2001-03-10  7:03 Denis Perchine
  2001-03-15  3:26 ` Tom Vier
  0 siblings, 1 reply; 3+ messages in thread
From: Denis Perchine @ 2001-03-10  7:03 UTC (permalink / raw)
  To: linux-kernel

Hello,

one small question... Will O_DSYNC flag be available in Linux?
It is available at least on AIX, and HP-UX. The difference with O_SYNC is the 
same as between fsync and fdatasync.

Any comments?

-- 
Sincerely Yours,
Denis Perchine

----------------------------------
E-Mail: dyp@perchine.com
HomePage: http://www.perchine.com/dyp/
FidoNet: 2:5000/120.5
----------------------------------

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: O_DSYNC flag for open
  2001-03-10  7:03 O_DSYNC flag for open Denis Perchine
@ 2001-03-15  3:26 ` Tom Vier
  2001-03-16 12:11   ` Stephen C. Tweedie
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Vier @ 2001-03-15  3:26 UTC (permalink / raw)
  To: Denis Perchine; +Cc: linux-kernel

fdatasync() is the same as fsync(), in linux. until fdatasync() is
implimented (ie, syncs the data only), there's no reason to define O_DSYNC.
just use:

#ifndef O_DSYNC
# define O_DSYNC O_SYNC
#endif

On Sat, Mar 10, 2001 at 01:03:57PM +0600, Denis Perchine wrote:
> one small question... Will O_DSYNC flag be available in Linux?
> It is available at least on AIX, and HP-UX. The difference with O_SYNC is the 
> same as between fsync and fdatasync.

-- 
Tom Vier <thomassr@erols.com>
DSA Key id 0x27371A2C

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: O_DSYNC flag for open
  2001-03-15  3:26 ` Tom Vier
@ 2001-03-16 12:11   ` Stephen C. Tweedie
  0 siblings, 0 replies; 3+ messages in thread
From: Stephen C. Tweedie @ 2001-03-16 12:11 UTC (permalink / raw)
  To: Tom Vier; +Cc: Denis Perchine, linux-kernel, Stephen Tweedie

Hi,

On Wed, Mar 14, 2001 at 10:26:42PM -0500, Tom Vier wrote:
> fdatasync() is the same as fsync(), in linux.

No, in 2.4 fdatasync does the right thing and skips the inode flush if
only the timestamps have changed.

> until fdatasync() is
> implimented (ie, syncs the data only)

fdatasync is required to sync more than just the data: it has to sync
the inode too if any fields other than the timestamps have changed.
So, for appending to files or writing new files from scratch, fsync ==
fdatasync (because each write also changes the inode size).  Only for
updating existing files in place does fdatasync behave differently.

> #ifndef O_DSYNC
> # define O_DSYNC O_SYNC
> #endif

2.4's O_SYNC actually does a fdatasync internally.  This is also the
default behaviour of HPUX, which requires you to set a sysctl variable
if you want O_SYNC to flush timestamp changes to disk.

Cheers,
 Stephen

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-03-16 12:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-03-10  7:03 O_DSYNC flag for open Denis Perchine
2001-03-15  3:26 ` Tom Vier
2001-03-16 12:11   ` Stephen C. Tweedie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox