diff options
Diffstat (limited to 'src/third_party/wiredtiger/src/block/block_slvg.c')
-rw-r--r-- | src/third_party/wiredtiger/src/block/block_slvg.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/third_party/wiredtiger/src/block/block_slvg.c b/src/third_party/wiredtiger/src/block/block_slvg.c index 8a632e892b4..857f15d7848 100644 --- a/src/third_party/wiredtiger/src/block/block_slvg.c +++ b/src/third_party/wiredtiger/src/block/block_slvg.c @@ -104,11 +104,14 @@ __wt_block_salvage_next( WT_DECL_RET; WT_FH *fh; wt_off_t max, offset; - uint32_t allocsize, checksum, size; + uint32_t allocsize, checksum, logid, size; uint8_t *endp; *eofp = 0; + /* FIXME: salvage across all chunks in a log-structured tree. */ + logid = 0; + fh = block->fh; allocsize = block->allocsize; WT_ERR(__wt_scr_alloc(session, allocsize, &tmp)); @@ -137,19 +140,19 @@ __wt_block_salvage_next( * otherwise, move past it. */ if (!__wt_block_offset_invalid(block, offset, size) && - __wt_block_read_off(session, block, tmp, offset, size, checksum) == 0) + __wt_block_read_off(session, block, tmp, logid, offset, size, checksum) == 0) break; /* Free the allocation-size block. */ __wt_verbose(session, WT_VERB_SALVAGE, "skipping %" PRIu32 "B at file offset %" PRIuMAX, allocsize, (uintmax_t)offset); - WT_ERR(__wt_block_off_free(session, block, offset, (wt_off_t)allocsize)); + WT_ERR(__wt_block_off_free(session, block, logid, offset, (wt_off_t)allocsize)); block->slvg_off += allocsize; } /* Re-create the address cookie that should reference this block. */ endp = addr; - WT_ERR(__wt_block_addr_to_buffer(block, &endp, offset, size, checksum)); + WT_ERR(__wt_block_addr_to_buffer(block, &endp, logid, offset, size, checksum)); *addr_sizep = WT_PTRDIFF(endp, addr); done: @@ -167,7 +170,7 @@ __wt_block_salvage_valid( WT_SESSION_IMPL *session, WT_BLOCK *block, uint8_t *addr, size_t addr_size, bool valid) { wt_off_t offset; - uint32_t size, checksum; + uint32_t size, logid, checksum; WT_UNUSED(addr_size); @@ -175,11 +178,11 @@ __wt_block_salvage_valid( * Crack the cookie. If the upper layer took the block, move past it; if the upper layer * rejected the block, move past an allocation size chunk and free it. */ - WT_RET(__wt_block_buffer_to_addr(block, addr, &offset, &size, &checksum)); + WT_RET(__wt_block_buffer_to_addr(block, addr, &logid, &offset, &size, &checksum)); if (valid) block->slvg_off = offset + size; else { - WT_RET(__wt_block_off_free(session, block, offset, (wt_off_t)block->allocsize)); + WT_RET(__wt_block_off_free(session, block, logid, offset, (wt_off_t)block->allocsize)); block->slvg_off = offset + block->allocsize; } |