summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/conn/conn_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/third_party/wiredtiger/src/conn/conn_api.c')
-rw-r--r--src/third_party/wiredtiger/src/conn/conn_api.c52
1 files changed, 14 insertions, 38 deletions
diff --git a/src/third_party/wiredtiger/src/conn/conn_api.c b/src/third_party/wiredtiger/src/conn/conn_api.c
index 5727399c301..d9f93e8bdce 100644
--- a/src/third_party/wiredtiger/src/conn/conn_api.c
+++ b/src/third_party/wiredtiger/src/conn/conn_api.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2017 MongoDB, Inc.
+ * Copyright (c) 2014-2018 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -1286,35 +1286,6 @@ err: API_END_RET(session, ret);
}
/*
- * __conn_calibrate_ticks --
- * Calibrate a ratio from rdtsc ticks to nanoseconds.
- */
-static void
-__conn_calibrate_ticks(WT_SESSION_IMPL *session)
-{
-#if (defined __i386) || (defined __amd64)
- struct timespec start, stop;
- uint64_t diff_nsec, diff_tsc, tsc_start, tsc_stop;
- volatile uint64_t i;
-
- __wt_epoch(session, &start);
- tsc_start = __wt_rdtsc(session);
- /*
- * This needs to be CPU intensive and large enough.
- */
- for (i = 0; i < WT_MILLION; i++)
- ;
- tsc_stop = __wt_rdtsc(session);
- __wt_epoch(session, &stop);
- diff_nsec = WT_TIMEDIFF_NS(stop, start);
- diff_tsc = tsc_stop - tsc_start;
- S2C(session)->tsc_nsec_ratio = (double)diff_tsc/(double)diff_nsec;
-#else
- S2C(session)->tsc_nsec_ratio = 1.0;
-#endif
-}
-
-/*
* __conn_config_append --
* Append an entry to a config stack.
*/
@@ -2259,6 +2230,16 @@ __conn_chk_file_system(WT_SESSION_IMPL *session, bool readonly)
}
WT_CONN_SET_FILE_SYSTEM_REQ(fs_size);
+ /*
+ * The lower-level API for returning the first matching entry was added
+ * later and not documented because it's an optimization for high-end
+ * filesystems doing logging, specifically pre-allocating log files.
+ * Check for the API and fall back to the standard API if not available.
+ */
+ if (conn->file_system->fs_directory_list_single == NULL)
+ conn->file_system->fs_directory_list_single =
+ conn->file_system->fs_directory_list;
+
return (0);
}
@@ -2305,7 +2286,7 @@ wiredtiger_dummy_session_init(
*/
int
wiredtiger_open(const char *home, WT_EVENT_HANDLER *event_handler,
- const char *config, WT_CONNECTION **wt_connp)
+ const char *config, WT_CONNECTION **connectionp)
{
static const WT_CONNECTION stdc = {
__conn_async_flush,
@@ -2353,7 +2334,7 @@ wiredtiger_open(const char *home, WT_EVENT_HANDLER *event_handler,
const char *cfg[] = {
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL };
- *wt_connp = NULL;
+ *connectionp = NULL;
conn = NULL;
session = NULL;
@@ -2682,11 +2663,6 @@ wiredtiger_open(const char *home, WT_EVENT_HANDLER *event_handler,
WT_ERR(__conn_write_base_config(session, cfg));
/*
- * Calibrate the ratio of rdtsc ticks to nanoseconds.
- */
- __conn_calibrate_ticks(session);
-
- /*
* Check on the turtle and metadata files, creating them if necessary
* (which avoids application threads racing to create the metadata file
* later). Once the metadata file exists, get a reference to it in
@@ -2703,7 +2679,7 @@ wiredtiger_open(const char *home, WT_EVENT_HANDLER *event_handler,
WT_ERR(__wt_connection_workers(session, cfg));
WT_STATIC_ASSERT(offsetof(WT_CONNECTION_IMPL, iface) == 0);
- *wt_connp = &conn->iface;
+ *connectionp = &conn->iface;
err: /* Discard the scratch buffers. */
__wt_scr_free(session, &encbuf);