summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/btree/bt_io.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/third_party/wiredtiger/src/btree/bt_io.c')
-rw-r--r--src/third_party/wiredtiger/src/btree/bt_io.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/third_party/wiredtiger/src/btree/bt_io.c b/src/third_party/wiredtiger/src/btree/bt_io.c
index 4339de6f25c..8053417f838 100644
--- a/src/third_party/wiredtiger/src/btree/bt_io.c
+++ b/src/third_party/wiredtiger/src/btree/bt_io.c
@@ -117,7 +117,7 @@ __wt_bt_read(WT_SESSION_IMPL *session,
*/
if (ret != 0 ||
result_len != dsk->mem_size - WT_BLOCK_COMPRESS_SKIP) {
- fail_msg = "block decryption failed";
+ fail_msg = "block decompression failed";
goto corrupt;
}
} else
@@ -168,7 +168,8 @@ err: __wt_scr_free(session, &tmp);
*/
int
__wt_bt_write(WT_SESSION_IMPL *session, WT_ITEM *buf,
- uint8_t *addr, size_t *addr_sizep, bool checkpoint, bool compressed)
+ uint8_t *addr, size_t *addr_sizep,
+ bool checkpoint, bool checkpoint_io, bool compressed)
{
WT_BM *bm;
WT_BTREE *btree;
@@ -181,7 +182,7 @@ __wt_bt_write(WT_SESSION_IMPL *session, WT_ITEM *buf,
size_t dst_len, len, result_len, size, src_len;
int compression_failed; /* Extension API, so not a bool. */
uint8_t *dst, *src;
- bool data_cksum, encrypted;
+ bool data_checksum, encrypted;
btree = S2BT(session);
bm = btree->bm;
@@ -343,26 +344,28 @@ __wt_bt_write(WT_SESSION_IMPL *session, WT_ITEM *buf,
* Checksum the data if the buffer isn't compressed or checksums are
* configured.
*/
- data_cksum = true; /* -Werror=maybe-uninitialized */
+ data_checksum = true; /* -Werror=maybe-uninitialized */
switch (btree->checksum) {
case CKSUM_ON:
- data_cksum = true;
+ data_checksum = true;
break;
case CKSUM_OFF:
- data_cksum = false;
+ data_checksum = false;
break;
case CKSUM_UNCOMPRESSED:
- data_cksum = !compressed;
+ data_checksum = !compressed;
break;
}
/* Call the block manager to write the block. */
WT_ERR(checkpoint ?
- bm->checkpoint(bm, session, ip, btree->ckpt, data_cksum) :
- bm->write(bm, session, ip, addr, addr_sizep, data_cksum));
+ bm->checkpoint(bm, session, ip, btree->ckpt, data_checksum) :
+ bm->write(
+ bm, session, ip, addr, addr_sizep, data_checksum, checkpoint_io));
WT_STAT_FAST_CONN_INCR(session, cache_write);
WT_STAT_FAST_DATA_INCR(session, cache_write);
+ S2C(session)->cache->bytes_written += dsk->mem_size;
WT_STAT_FAST_CONN_INCRV(session, cache_bytes_write, dsk->mem_size);
WT_STAT_FAST_DATA_INCRV(session, cache_bytes_write, dsk->mem_size);