summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/block/block_write.c
diff options
context:
space:
mode:
authorAndrew Morton <andrew.morton@mongodb.com>2023-05-16 22:21:25 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-05-17 00:50:01 +0000
commit376eae9eefe9f752d8d9b5189528f1353c019e54 (patch)
tree8780daf7a9ebd0ed2e8c1b25bf81571b3bb89911 /src/third_party/wiredtiger/src/block/block_write.c
parente94168acd89dba4faef5e43f970633a781e8cba2 (diff)
downloadmongo-376eae9eefe9f752d8d9b5189528f1353c019e54.tar.gz
Import wiredtiger: 04dcc362042b8cc35fdd8de8343be3a15d4fa47c from branch mongodb-master
ref: d310d6330e..04dcc36204 for: 7.1.0-rc0 WT-10898 Add assertions for owning a spinlock
Diffstat (limited to 'src/third_party/wiredtiger/src/block/block_write.c')
-rw-r--r--src/third_party/wiredtiger/src/block/block_write.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/third_party/wiredtiger/src/block/block_write.c b/src/third_party/wiredtiger/src/block/block_write.c
index 75ddd53001b..b2ba9a35ee3 100644
--- a/src/third_party/wiredtiger/src/block/block_write.c
+++ b/src/third_party/wiredtiger/src/block/block_write.c
@@ -83,16 +83,18 @@ __wt_block_discard(WT_SESSION_IMPL *session, WT_BLOCK *block, size_t added_size)
}
/*
- * __wt_block_extend --
+ * __block_extend --
* Extend the file.
*/
static inline int
-__wt_block_extend(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_FH *fh, wt_off_t offset,
+__block_extend(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_FH *fh, wt_off_t offset,
size_t align_size, bool *release_lockp)
{
WT_DECL_RET;
WT_FILE_HANDLE *handle;
+ WT_ASSERT_SPINLOCK_OWNED(session, &block->live_lock);
+
/*
* The locking in this function is messy: by definition, the live system is locked when we're
* called, but that lock may have been acquired by our caller or our caller's caller. If our
@@ -272,7 +274,7 @@ __block_write_off(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_ITEM *buf, uint3
}
ret = __wt_block_alloc(session, block, &offset, (wt_off_t)align_size);
if (ret == 0)
- ret = __wt_block_extend(session, block, fh, offset, align_size, &local_locked);
+ ret = __block_extend(session, block, fh, offset, align_size, &local_locked);
if (local_locked)
__wt_spin_unlock(session, &block->live_lock);
WT_RET(ret);