Commit f1b9d053 authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:3734], move brt->curr_dsn to brt_header

git-svn-id: file:///svn/toku/tokudb@32890 c7de825b-a66e-492c-adef-691d508d4ae1
parent a8fb427c
...@@ -369,6 +369,8 @@ struct brt_header { ...@@ -369,6 +369,8 @@ struct brt_header {
struct toku_list live_brts; struct toku_list live_brts;
struct toku_list zombie_brts; struct toku_list zombie_brts;
struct toku_list checkpoint_before_commit_link; struct toku_list checkpoint_before_commit_link;
DSN curr_dsn;
}; };
struct brt { struct brt {
...@@ -396,8 +398,6 @@ struct brt { ...@@ -396,8 +398,6 @@ struct brt {
int (*close_db)(DB*, u_int32_t); int (*close_db)(DB*, u_int32_t);
u_int32_t close_flags; u_int32_t close_flags;
DSN curr_dsn;
struct toku_list live_brt_link; struct toku_list live_brt_link;
struct toku_list zombie_brt_link; struct toku_list zombie_brt_link;
}; };
......
...@@ -149,8 +149,8 @@ toku_assert_entire_node_in_memory(BRTNODE node) { ...@@ -149,8 +149,8 @@ toku_assert_entire_node_in_memory(BRTNODE node) {
// //
static void static void
set_new_DSN_for_node(BRTNODE node, BRT t) { set_new_DSN_for_node(BRTNODE node, BRT t) {
node->dsn = t->curr_dsn; node->dsn = t->h->curr_dsn;
t->curr_dsn++; t->h->curr_dsn++;
} }
static u_int32_t static u_int32_t
...@@ -3667,6 +3667,8 @@ brt_alloc_init_header(BRT t, TOKUTXN txn) { ...@@ -3667,6 +3667,8 @@ brt_alloc_init_header(BRT t, TOKUTXN txn) {
memset(&t->h->descriptor, 0, sizeof(t->h->descriptor)); memset(&t->h->descriptor, 0, sizeof(t->h->descriptor));
t->h->curr_dsn = MIN_DSN + 1; // start at MIN_DSN + 1, as MIN_DSN is reserved for basement nodes
r = brt_init_header(t, txn); r = brt_init_header(t, txn);
if (r != 0) goto died2; if (r != 0) goto died2;
return r; return r;
...@@ -4650,7 +4652,6 @@ int toku_brt_create(BRT *brt_ptr) { ...@@ -4650,7 +4652,6 @@ int toku_brt_create(BRT *brt_ptr) {
brt->nodesize = BRT_DEFAULT_NODE_SIZE; brt->nodesize = BRT_DEFAULT_NODE_SIZE;
brt->compare_fun = toku_builtin_compare_fun; brt->compare_fun = toku_builtin_compare_fun;
brt->update_fun = NULL; brt->update_fun = NULL;
brt->curr_dsn = 1; // start at 1, as 0 is reserved for basement nodes
int r = toku_omt_create(&brt->txns); int r = toku_omt_create(&brt->txns);
if (r!=0) { toku_free(brt); return r; } if (r!=0) { toku_free(brt); return r; }
*brt_ptr = brt; *brt_ptr = brt;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment