summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@wiredtiger.com>2013-02-26 14:54:29 +1100
committerMichael Cahill <michael.cahill@wiredtiger.com>2013-02-26 14:54:29 +1100
commitfc9b6445c48746a6a284f73c0a15b3896904bd95 (patch)
tree483cb99928181815cf02d43c53df14095a02f6c2 /src/include
parent1dde6b081ce1702d913debfb626ecfc7eaa1d60b (diff)
downloadmongo-fc9b6445c48746a6a284f73c0a15b3896904bd95.tar.gz
Add a reference count to tables, only free if the table is not in use.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/extern.h7
-rw-r--r--src/include/packing.i2
-rw-r--r--src/include/schema.h17
3 files changed, 15 insertions, 11 deletions
diff --git a/src/include/extern.h b/src/include/extern.h
index b135db9ab95..2e26cd7c4dd 100644
--- a/src/include/extern.h
+++ b/src/include/extern.h
@@ -954,13 +954,16 @@ extern int __wt_schema_get_table(WT_SESSION_IMPL *session,
size_t namelen,
int ok_incomplete,
WT_TABLE **tablep);
+extern void __wt_schema_release_table(WT_SESSION_IMPL *session,
+ WT_TABLE *table);
extern void __wt_schema_destroy_colgroup(WT_SESSION_IMPL *session,
WT_COLGROUP *colgroup);
extern void __wt_schema_destroy_index(WT_SESSION_IMPL *session, WT_INDEX *idx);
extern void __wt_schema_destroy_table(WT_SESSION_IMPL *session,
WT_TABLE *table);
-extern int __wt_schema_remove_table( WT_SESSION_IMPL *session, WT_TABLE *table);
-extern int __wt_schema_close_tables(WT_SESSION_IMPL *session);
+extern void __wt_schema_remove_table( WT_SESSION_IMPL *session,
+ WT_TABLE *table);
+extern void __wt_schema_close_tables(WT_SESSION_IMPL *session);
extern int __wt_schema_colgroup_name(WT_SESSION_IMPL *session,
WT_TABLE *table,
const char *cgname,
diff --git a/src/include/packing.i b/src/include/packing.i
index 5276a9516d1..8113db8c5d2 100644
--- a/src/include/packing.i
+++ b/src/include/packing.i
@@ -74,7 +74,7 @@ next: if (pack->cur == pack->end)
} else {
pv->havesize = 0;
pv->size = 1;
- }
+ }
pv->type = *pack->cur++;
pack->repeats = 0;
diff --git a/src/include/schema.h b/src/include/schema.h
index 20bdcb82b86..68eb046e815 100644
--- a/src/include/schema.h
+++ b/src/include/schema.h
@@ -5,12 +5,12 @@
* See the file LICENSE for redistribution information.
*/
-/* Character constants for projection plans. */
-#define WT_PROJ_KEY 'k' /* Go to key in cursor <arg>. */
-#define WT_PROJ_NEXT 'n' /* Process the next item (<arg> repeats). */
-#define WT_PROJ_REUSE 'r' /* Reuse the previous item (<arg> repeats). */
-#define WT_PROJ_SKIP 's' /* Skip a column in the cursor (<arg> repeats). */
-#define WT_PROJ_VALUE 'v' /* Go to the value in cursor <arg>. */
+/* Character constants for projection plans */
+#define WT_PROJ_KEY 'k' /* Go to key in cursor <arg> */
+#define WT_PROJ_NEXT 'n' /* Process the next item (<arg> repeats) */
+#define WT_PROJ_REUSE 'r' /* Reuse the previous item (<arg> repeats) */
+#define WT_PROJ_SKIP 's' /* Skip a column in the cursor (<arg> repeats) */
+#define WT_PROJ_VALUE 'v' /* Go to the value in cursor <arg> */
struct __wt_colgroup {
const char *name; /* Logical name */
@@ -32,7 +32,7 @@ struct __wt_index {
const char *key_plan; /* Key projection plan */
const char *value_plan; /* Value projection plan */
- int need_value; /* Index must have a non-empty value. */
+ int need_value; /* Index must have a non-empty value */
};
/*
@@ -57,7 +57,8 @@ struct __wt_table {
int cg_complete, idx_complete, is_simple;
u_int ncolgroups, nindices, nkey_columns;
- uint32_t schema_gen; /* Cached schema generation number. */
+ uint32_t refcnt; /* Number of open cursors */
+ uint32_t schema_gen; /* Cached schema generation number */
};
/*