summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsueloverso <sue@mongodb.com>2016-06-07 22:26:44 -0400
committerMichael Cahill <michael.cahill@mongodb.com>2016-06-08 12:26:44 +1000
commit1e30ff33750b5a5885420654f6d39101b6cb8610 (patch)
tree725da5bba5f761a30e86009b865500ade35a65e6 /src
parent48bf777e1751f298756073a4ca13feabbc232066 (diff)
downloadmongo-1e30ff33750b5a5885420654f6d39101b6cb8610.tar.gz
WT-2652 Remove unnecessary wt_ftruncate call. (#2786)
Make file length the actual maximum set, not the maximum plus the header record.
Diffstat (limited to 'src')
-rw-r--r--src/log/log.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/log/log.c b/src/log/log.c
index fd2b3444398..073dc5b2025 100644
--- a/src/log/log.c
+++ b/src/log/log.c
@@ -447,12 +447,12 @@ __log_prealloc(WT_SESSION_IMPL *session, WT_FH *fh)
* writes happening concurrently, so there are no locking issues.
*/
if ((ret = __wt_fallocate(
- session, fh, WT_LOG_FIRST_RECORD, conn->log_file_max)) == 0)
+ session, fh, WT_LOG_FIRST_RECORD,
+ conn->log_file_max - WT_LOG_FIRST_RECORD)) == 0)
return (0);
WT_RET_ERROR_OK(ret, ENOTSUP);
- return (__wt_ftruncate(
- session, fh, WT_LOG_FIRST_RECORD + conn->log_file_max));
+ return (__wt_ftruncate(session, fh, conn->log_file_max));
}
/*
@@ -1029,7 +1029,6 @@ __wt_log_allocfile(
*/
WT_ERR(__log_openfile(session, true, &log_fh, WT_LOG_TMPNAME, tmp_id));
WT_ERR(__log_file_header(session, log_fh, NULL, true));
- WT_ERR(__wt_ftruncate(session, log_fh, WT_LOG_FIRST_RECORD));
WT_ERR(__log_prealloc(session, log_fh));
WT_ERR(__wt_fsync(session, log_fh, true));
WT_ERR(__wt_close(session, &log_fh));