summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Bostic <keith.bostic@mongodb.com>2016-06-20 10:28:51 -0400
committerGitHub <noreply@github.com>2016-06-20 10:28:51 -0400
commitad46083878dc37238a5a29365a078ff2d29a2060 (patch)
tree5b501c3679b8262f1f80f122e6ae1e62a23dfe1e
parent55aa7926f29c141431ac4f23bfb5678044c40488 (diff)
downloadmongo-ad46083878dc37238a5a29365a078ff2d29a2060.tar.gz
WT-2692 Fix race in file system example (#2815)
Commit 62575b5 broke in-memory support, it didn't include either WT_FILE_HANDLE.lock or WT_FILE_HANDLE.sync. Add stub functions; I don't think we call either of them enough that it's going to be a performance problem.
-rw-r--r--src/os_common/os_fs_inmemory.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/os_common/os_fs_inmemory.c b/src/os_common/os_fs_inmemory.c
index 592aa6e4ce6..09c2e08db83 100644
--- a/src/os_common/os_fs_inmemory.c
+++ b/src/os_common/os_fs_inmemory.c
@@ -300,6 +300,20 @@ __im_file_close(WT_FILE_HANDLE *file_handle, WT_SESSION *wt_session)
}
/*
+ * __im_file_lock --
+ * Lock/unlock a file.
+ */
+static int
+__im_file_lock(
+ WT_FILE_HANDLE *file_handle, WT_SESSION *wt_session, bool lock)
+{
+ WT_UNUSED(file_handle);
+ WT_UNUSED(wt_session);
+ WT_UNUSED(lock);
+ return (0);
+}
+
+/*
* __im_file_read --
* POSIX pread.
*/
@@ -361,6 +375,18 @@ __im_file_size(
}
/*
+ * __im_file_sync --
+ * In-memory sync.
+ */
+static int
+__im_file_sync(WT_FILE_HANDLE *file_handle, WT_SESSION *wt_session)
+{
+ WT_UNUSED(file_handle);
+ WT_UNUSED(wt_session);
+ return (0);
+}
+
+/*
* __im_file_truncate --
* POSIX ftruncate.
*/
@@ -492,8 +518,10 @@ __im_file_open(WT_FILE_SYSTEM *file_system, WT_SESSION *wt_session,
WT_FILE_HANDLE_INSERT(im_fs, im_fh, bucket);
file_handle->close = __im_file_close;
+ file_handle->fh_lock = __im_file_lock;
file_handle->fh_read = __im_file_read;
file_handle->fh_size = __im_file_size;
+ file_handle->fh_sync = __im_file_sync;
file_handle->fh_truncate = __im_file_truncate;
file_handle->fh_write = __im_file_write;