|
|
| Author |
Message |
< Erlang patches mailing list ~ Patch to add a wrapper around the POSIX syscall "fdatasync" |
| Guest |
Posted: Thu Apr 22, 2010 11:14 pm |
|
|
|
Guest
|
Hello,
I created a patch which allows one to call the POSIX system call
"fdatasync". It adds a new function to the file module: file:datasync/1.
This syscall is similar to fsync except that it doesn't flush the file's
metadata (like access time for e.g.) but only its data. Therefore it avoids
extra disk seek and disk write operations.
It's used by several DBMSs, such as MySQL and SQLite, where it makes a
significant difference compared to fsync under heavy write conditions.
Some links:
http://linux.die.net/man/2/fdatasync
http://bazaar.launchpad.net/~mysql/mysql-server/mysql-5.1-telco-6.1/annotate/head%3A/mysys/my_sync.c#L61
(MySQL source)
The new exposed function simply calls fsync if the host OS doesn't implement
fdatasync.
The patch can be found at:
http://github.com/fdmanana/otp/commit/1006fb7efafe634165214f065dd8cff05a5d10c0
If something doesn't comply with your guidelines/conventions for accepting a
patch, please let me know it and I'll do the necessary adaptations.
cheers
--
Filipe David Manana,
fdmanana@gmail.com
"Reasonable men adapt themselves to the world.
Unreasonable men adapt the world to themselves.
That's why all progress depends on unreasonable men."
Post received from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Thu Apr 22, 2010 11:21 pm |
|
|
|
Guest
|
Hello,
I created a patch which allows one to call the POSIX system call
"fdatasync". It adds a new function to the file module: file:datasync/1.
This syscall is similar to fsync except that it doesn't flush the file's
metadata (like access time for e.g.) but only its data. Therefore it avoids
extra disk seek and disk write operations.
It's used by several DBMSs, such as MySQL and SQLite, where it makes a
significant difference compared to fsync under heavy write conditions.
Some links:
http://linux.die.net/man/2/fdatasync
http://bazaar.launchpad.net/~mysql/mysql-server/mysql-5.1-telco-6.1/annotate/head%3A/mysys/my_sync.c#L61
(MySQL source)
The new exposed function simply calls fsync if the host OS doesn't implement
fdatasync.
The patch can be found at:
http://github.com/fdmanana/otp/commit/1006fb7efafe634165214f065dd8cff05a5d10c0
If something doesn't comply with your guidelines/conventions for accepting a
patch, please let me know it and I'll do the necessary adaptations.
cheers
--
Filipe David Manana,
fdmanana@gmail.com
"Reasonable men adapt themselves to the world.
Unreasonable men adapt the world to themselves.
That's why all progress depends on unreasonable men."
Post received from mailinglist |
|
|
| Back to top |
|
|
|
All times are GMT
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
|
|
|