kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ha...@apache.org
Subject [1/2] kudu git commit: env: properly use fdatasync on Linux
Date Thu, 25 Jan 2018 00:19:54 GMT
Repository: kudu
Updated Branches:
  refs/heads/master f755f8aa5 -> f62e4cd0e


env: properly use fdatasync on Linux

A previous commit attempted to make env OSX-compatible by checking
whether fdatasync was defined and using fsync in the case that it was
not. However, that commit was buggy since it used #ifndef. fdatasync is
never a preprocessor macro, so it never was "defined" and we always
ended up using fsync regardless of the FLAGS_env_use_fsync value.

Change-Id: I366df37670ec241cbee6dcfe0efa56af7189e9a2
Reviewed-on: http://gerrit.cloudera.org:8080/9128
Reviewed-by: Dan Burkert <dan@cloudera.com>
Tested-by: Kudu Jenkins


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/a0d348ad
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/a0d348ad
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/a0d348ad

Branch: refs/heads/master
Commit: a0d348adcbfca5bae3191f40f31dc918808b01ad
Parents: f755f8a
Author: Todd Lipcon <todd@apache.org>
Authored: Wed Jan 24 15:12:26 2018 -0800
Committer: Todd Lipcon <todd@apache.org>
Committed: Thu Jan 25 00:08:02 2018 +0000

----------------------------------------------------------------------
 src/kudu/util/env_posix.cc | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/a0d348ad/src/kudu/util/env_posix.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/env_posix.cc b/src/kudu/util/env_posix.cc
index 28559e7..ddd94aa 100644
--- a/src/kudu/util/env_posix.cc
+++ b/src/kudu/util/env_posix.cc
@@ -113,13 +113,9 @@ typedef struct xfs_flock64 {
 #define XFS_IOC_UNRESVSP64      _IOW ('X', 43, struct xfs_flock64)
 #endif
 
-// For platforms without fdatasync (like OS X)
-#ifndef fdatasync
+// OSX does not have fdatasync or fread_unlocked.
+#ifdef __APPLE__
 #define fdatasync fsync
-#endif
-
-// For platforms without unlocked_stdio (like OS X)
-#ifndef fread_unlocked
 #define fread_unlocked fread
 #endif
 


Mime
View raw message