summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/block/block_open.c
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@mongodb.com>2015-08-28 16:02:38 +1000
committerMichael Cahill <michael.cahill@mongodb.com>2015-08-28 16:02:38 +1000
commita7338c436160e259d0b20058f0a9ae4b442ca102 (patch)
treebfc887ab328328c72face3d1afc99530a89584ff /src/third_party/wiredtiger/src/block/block_open.c
parentf51b43f0fbabe121c18387d8bfbb187a2c6efdee (diff)
downloadmongo-a7338c436160e259d0b20058f0a9ae4b442ca102.tar.gz
Import wiredtiger-wiredtiger-2.6.1-633-g0cccab3.tar.gz from wiredtiger branch mongodb-3.2
Diffstat (limited to 'src/third_party/wiredtiger/src/block/block_open.c')
-rw-r--r--src/third_party/wiredtiger/src/block/block_open.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/src/third_party/wiredtiger/src/block/block_open.c b/src/third_party/wiredtiger/src/block/block_open.c
index c005b226bfc..cfb5b000092 100644
--- a/src/third_party/wiredtiger/src/block/block_open.c
+++ b/src/third_party/wiredtiger/src/block/block_open.c
@@ -158,9 +158,9 @@ __wt_block_configure_first_fit(WT_BLOCK *block, int on)
* as long as any operation wants it.
*/
if (on)
- (void)WT_ATOMIC_ADD4(block->allocfirst, 1);
+ (void)__wt_atomic_add32(&block->allocfirst, 1);
else
- (void)WT_ATOMIC_SUB4(block->allocfirst, 1);
+ (void)__wt_atomic_sub32(&block->allocfirst, 1);
}
/*
@@ -398,21 +398,19 @@ err: __wt_scr_free(session, &buf);
void
__wt_block_stat(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_DSRC_STATS *stats)
{
+ WT_UNUSED(session);
+
/*
- * We're looking inside the live system's structure, which normally
- * requires locking: the chances of a corrupted read are probably
- * non-existent, and it's statistics information regardless, but it
- * isn't like this is a common function for an application to call.
+ * Reading from the live system's structure normally requires locking,
+ * but it's an 8B statistics read, there's no need.
*/
- __wt_spin_lock(session, &block->live_lock);
- WT_STAT_SET(stats, allocation_size, block->allocsize);
- WT_STAT_SET(stats, block_checkpoint_size, block->live.ckpt_size);
- WT_STAT_SET(stats, block_magic, WT_BLOCK_MAGIC);
- WT_STAT_SET(stats, block_major, WT_BLOCK_MAJOR_VERSION);
- WT_STAT_SET(stats, block_minor, WT_BLOCK_MINOR_VERSION);
- WT_STAT_SET(stats, block_reuse_bytes, block->live.avail.bytes);
- WT_STAT_SET(stats, block_size, block->fh->size);
- __wt_spin_unlock(session, &block->live_lock);
+ stats->allocation_size = block->allocsize;
+ stats->block_checkpoint_size = (int64_t)block->live.ckpt_size;
+ stats->block_magic = WT_BLOCK_MAGIC;
+ stats->block_major = WT_BLOCK_MAJOR_VERSION;
+ stats->block_minor = WT_BLOCK_MINOR_VERSION;
+ stats->block_reuse_bytes = (int64_t)block->live.avail.bytes;
+ stats->block_size = block->fh->size;
}
/*
@@ -426,7 +424,7 @@ __wt_block_manager_size(
wt_off_t filesize;
WT_RET(__wt_filesize_name(session, filename, &filesize));
- WT_STAT_SET(stats, block_size, filesize);
+ stats->block_size = filesize;
return (0);
}