summaryrefslogtreecommitdiffstats
path: root/src/lib/fsync-mode.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/fsync-mode.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lib/fsync-mode.h b/src/lib/fsync-mode.h
new file mode 100644
index 0000000..5873614
--- /dev/null
+++ b/src/lib/fsync-mode.h
@@ -0,0 +1,14 @@
+#ifndef FSYNC_MODE_H
+#define FSYNC_MODE_H
+
+enum fsync_mode {
+ /* fsync when it's necessary for data safety. */
+ FSYNC_MODE_OPTIMIZED = 0,
+ /* never fsync (in case of a crash can lose data) */
+ FSYNC_MODE_NEVER,
+ /* fsync after all writes. this is necessary with NFS to avoid
+ write failures being delayed until file is close(). */
+ FSYNC_MODE_ALWAYS
+};
+
+#endif