Re: fdatasync() patch for FreeBSD

  • From: <tpgww@xxxxxxxxxxx>
  • To: emelfm2@xxxxxxxxxxxxx
  • Date: Fri, 24 Jul 2009 17:23:17 +1000

On Fri, 24 Jul 2009 08:07:56 +0200
Marcus von Appen <mva@xxxxxxxxxxxx> wrote:

> in the recent SVN trunk and emelfm2 0.6.2 release, you are using a
> fdatasync() call to flush a file after writing.

This is in response to the recent spate of exchanges about ext4 performance 
optimisation, and the associated risk of data loss if a system crash happens at 
a bad time.

 FreeBSD does not have a
> that call implemented and according to the POSIX specs it does not
> differ much from the fsync() call.
> Can e2_fs_writeflush() be changed to use fsync() instead (or #ifdef'd
> for FreeBSD) without any impact on the rest of the writing behaviour?

Sure. IIRC, the difference is that fsync() includes an extra trip to disk 
(after the file content has been flushed), to update inode data. In e2, no 
material performance hit.

> Attached you'll find a patch for src/filesystem/e2_fs.c, which unbreaks
> the FreeBSD build.

Added to svn with #ifdef __E2BSD__


Users can unsubscribe from the list by sending email to 
emelfm2-request@xxxxxxxxxxxxx with 'unsubscribe' in the subject field or by 
logging into the web interface.

Other related posts: