summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Bostic <keith.bostic@wiredtiger.com>2011-12-28 19:44:41 +0000
committerKeith Bostic <keith.bostic@wiredtiger.com>2011-12-28 19:44:41 +0000
commit9a24a9608d115cd5ae8706af1bbf2a41db82a509 (patch)
tree2c459ec671385084e3b12790edfe526c4d01c79a
parentba28e8f3513be24b4c82f7101aac99d7dca23f51 (diff)
downloadmongo-9a24a9608d115cd5ae8706af1bbf2a41db82a509.tar.gz
Minor shuffling between the block-manager and the engine.
-rw-r--r--src/block/block_alloc.c3
-rw-r--r--src/block/block_open.c4
-rw-r--r--src/btree/bt_stat.c3
-rw-r--r--src/include/block.h21
-rw-r--r--src/include/btree.h9
5 files changed, 20 insertions, 20 deletions
diff --git a/src/block/block_alloc.c b/src/block/block_alloc.c
index ce7901a828c..6024fbc670a 100644
--- a/src/block/block_alloc.c
+++ b/src/block/block_alloc.c
@@ -597,6 +597,9 @@ __wt_block_stat(WT_SESSION_IMPL *session, WT_BLOCK *block)
WT_BSTAT_SET(session, file_freelist_bytes, block->freelist_bytes);
WT_BSTAT_SET(session, file_freelist_entries, block->freelist_entries);
WT_BSTAT_SET(session, file_size, block->fh->file_size);
+ WT_BSTAT_SET(session, file_magic, WT_BLOCK_MAGIC);
+ WT_BSTAT_SET(session, file_major, WT_BTREE_MAJOR_VERSION);
+ WT_BSTAT_SET(session, file_minor, WT_BTREE_MINOR_VERSION);
}
#ifdef HAVE_VERBOSE
diff --git a/src/block/block_open.c b/src/block/block_open.c
index 0017538d4aa..ff953b2025d 100644
--- a/src/block/block_open.c
+++ b/src/block/block_open.c
@@ -211,7 +211,7 @@ __desc_read(WT_SESSION_IMPL *session, WT_BLOCK *block, int salvage)
* may have entered the wrong file name, and is now frantically pounding
* their interrupt key.
*/
- if (desc->magic != WT_BTREE_MAGIC)
+ if (desc->magic != WT_BLOCK_MAGIC)
goto err;
if (desc->majorv > WT_BTREE_MAJOR_VERSION ||
(desc->majorv == WT_BTREE_MAJOR_VERSION &&
@@ -259,7 +259,7 @@ __wt_desc_init(WT_SESSION_IMPL *session, WT_FH *fh)
memset(buf, 0, sizeof(buf));
desc = (WT_BLOCK_DESC *)buf;
- desc->magic = WT_BTREE_MAGIC;
+ desc->magic = WT_BLOCK_MAGIC;
desc->majorv = WT_BTREE_MAJOR_VERSION;
desc->minorv = WT_BTREE_MINOR_VERSION;
diff --git a/src/btree/bt_stat.c b/src/btree/bt_stat.c
index 8f7a7257c55..ac3b2505e05 100644
--- a/src/btree/bt_stat.c
+++ b/src/btree/bt_stat.c
@@ -32,9 +32,6 @@ __wt_btree_stat_init(WT_SESSION_IMPL *session)
WT_BSTAT_SET(session, file_maxintlitem, btree->maxintlitem);
WT_BSTAT_SET(session, file_maxleafpage, btree->maxleafpage);
WT_BSTAT_SET(session, file_maxleafitem, btree->maxleafitem);
- WT_BSTAT_SET(session, file_magic, WT_BTREE_MAGIC);
- WT_BSTAT_SET(session, file_major, WT_BTREE_MAJOR_VERSION);
- WT_BSTAT_SET(session, file_minor, WT_BTREE_MINOR_VERSION);
page = NULL;
while ((ret = __wt_tree_np(session, &page, 0, 1)) == 0 && page != NULL)
diff --git a/src/include/block.h b/src/include/block.h
index 69845f5a92e..2c665af98f3 100644
--- a/src/include/block.h
+++ b/src/include/block.h
@@ -11,15 +11,6 @@
#define WT_BM_MAX_ADDR_COOKIE 255 /* Maximum address cookie */
/*
- * The minimum btree leaf and internal page sizes are 512B, the maximum 512MB.
- * (The maximum of 512MB is enforced by the software, it could be set as high
- * as 4GB.)
- */
-#define WT_BTREE_ALLOCATION_SIZE_MIN 512
-#define WT_BTREE_ALLOCATION_SIZE_MAX (128 * WT_MEGABYTE)
-#define WT_BTREE_PAGE_SIZE_MAX (512 * WT_MEGABYTE)
-
-/*
* The file's description is written into the first 512B of the file, which
* means we can use an offset of 0 as an invalid offset.
*/
@@ -71,21 +62,21 @@ struct __wt_block {
* The file's description.
*/
struct __wt_block_desc {
-#define WT_BTREE_MAGIC 120897
+#define WT_BLOCK_MAGIC 120897
uint32_t magic; /* 00-03: Magic number */
#define WT_BTREE_MAJOR_VERSION 0
uint16_t majorv; /* 04-05: Major version */
#define WT_BTREE_MINOR_VERSION 1
uint16_t minorv; /* 06-07: Minor version */
- uint32_t cksum; /* 08-11: Checksum */
+ uint32_t cksum; /* 08-11: Description block checksum */
+ uint32_t unused; /* 12-15: Padding */
#define WT_BLOCK_FREELIST_MAGIC 071002
- uint32_t free_size; /* 12-15: Free list page length */
- uint32_t free_cksum; /* 16-19: Free list page checksum */
+ uint64_t free_offset; /* 16-23: Free list page address */
+ uint32_t free_size; /* 24-27: Free list page length */
+ uint32_t free_cksum; /* 28-31: Free list page checksum */
- uint32_t unused; /* 20-23: Padding */
- uint64_t free_offset; /* 24-31: Free list page address */
/*
* We maintain page LSN's for the file in the non-transactional case
diff --git a/src/include/btree.h b/src/include/btree.h
index 6b9cf6be26c..105833f8035 100644
--- a/src/include/btree.h
+++ b/src/include/btree.h
@@ -99,6 +99,15 @@ struct __wt_salvage_cookie {
};
/*
+ * The minimum btree leaf and internal page sizes are 512B, the maximum 512MB.
+ * (The maximum of 512MB is enforced by the software, it could be set as high
+ * as 4GB.)
+ */
+#define WT_BTREE_ALLOCATION_SIZE_MIN 512
+#define WT_BTREE_ALLOCATION_SIZE_MAX (128 * WT_MEGABYTE)
+#define WT_BTREE_PAGE_SIZE_MAX (512 * WT_MEGABYTE)
+
+/*
* Split page size calculation -- we don't want to repeatedly split every time
* a new entry is added, so we split to a smaller-than-maximum page size.
*/