Browse Source

Make fdatasync a wrapper for fsync, for now. Assuming no apps rely on data-only sync for correctness.

Don Porter 7 years ago
parent
commit
d3d3c0116a

+ 1 - 0
LibOS/shim/include/shim_table.h

@@ -394,6 +394,7 @@ int shim_do_msgrcv (int msqid, void * msgp, size_t msgsz, long msgtyp,
 int shim_do_msgctl (int msqid, int cmd, struct msqid_ds * buf);
 int shim_do_fcntl (int fd, int cmd, unsigned long arg);
 int shim_do_fsync (int fd);
+int shim_do_fdatasync (int fd);
 int shim_do_truncate (const char * path, loff_t length);
 int shim_do_ftruncate (int fd, loff_t length);
 size_t shim_do_getdents (int fd, struct linux_dirent * buf, size_t count);

+ 3 - 1
LibOS/shim/src/shim_syscalls.c

@@ -420,7 +420,9 @@ SHIM_SYSCALL_PASSTHROUGH (flock, 2, int, int, fd, int, cmd)
 /* fsync: sys/shim_open.c */
 DEFINE_SHIM_SYSCALL (fsync, 1, shim_do_fsync, int, int, fd)
 
-SHIM_SYSCALL_PASSTHROUGH (fdatasync, 1, int, int, fd)
+/* fdatasync: sys/shim_open.c */
+DEFINE_SHIM_SYSCALL (fdatasync, 1, shim_do_fdatasync, int, int, fd)
+
 
 /* truncate: sys/shim_open.c */
 DEFINE_SHIM_SYSCALL (truncate, 2, shim_do_truncate, int, const char *, path,

+ 7 - 0
LibOS/shim/src/sys/shim_open.c

@@ -481,6 +481,13 @@ out:
     return ret;
 }
 
+// DEP 10/20/16: Assuming fsync >> fdatasync for now
+//  and no app depends on only syncing data for correctness.
+int shim_do_fdatasync (int fd)
+{
+    return shim_do_fsync(fd);
+}
+
 int shim_do_truncate (const char * path, loff_t length)
 {
     struct shim_dentry * dent = NULL;