Commit b904eec0 authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul

Make all external symbols in brt-verify.o start with toku_. Addresses #8

git-svn-id: file:///svn/tokudb@679 c7de825b-a66e-492c-adef-691d508d4ae1
parent 529339d3
...@@ -252,11 +252,11 @@ static void test_multiple_files_of_size (int size) { ...@@ -252,11 +252,11 @@ static void test_multiple_files_of_size (int size) {
snprintf(val, 100, "Val%d", i); snprintf(val, 100, "Val%d", i);
brt_insert(t1, fill_dbt(&k, key, 1+strlen(key)), fill_dbt(&v, val, 1+strlen(val)), null_db, null_txn); brt_insert(t1, fill_dbt(&k, key, 1+strlen(key)), fill_dbt(&v, val, 1+strlen(val)), null_db, null_txn);
} }
//verify_brt(t0); //toku_verify_brt(t0);
//dump_brt(t0); //dump_brt(t0);
//dump_brt(t1); //dump_brt(t1);
verify_brt(t0); toku_verify_brt(t0);
verify_brt(t1); toku_verify_brt(t1);
r = close_brt(t0); assert(r==0); r = close_brt(t0); assert(r==0);
r = close_brt(t1); assert(r==0); r = close_brt(t1); assert(r==0);
...@@ -508,7 +508,7 @@ static void test_read_what_was_written (void) { ...@@ -508,7 +508,7 @@ static void test_read_what_was_written (void) {
assert(strcmp(v.data,"there")==0); assert(strcmp(v.data,"there")==0);
} }
assert(verify_brt(brt)==0); assert(toku_verify_brt(brt)==0);
/* Now put a bunch (NVALS) of things in. */ /* Now put a bunch (NVALS) of things in. */
{ {
...@@ -519,12 +519,12 @@ static void test_read_what_was_written (void) { ...@@ -519,12 +519,12 @@ static void test_read_what_was_written (void) {
snprintf(key, 100, "key%d", i); snprintf(key, 100, "key%d", i);
snprintf(val, 100, "val%d", i); snprintf(val, 100, "val%d", i);
if (i<600) { if (i<600) {
int verify_result=verify_brt(brt);; int verify_result=toku_verify_brt(brt);;
assert(verify_result==0); assert(verify_result==0);
} }
brt_insert(brt, fill_dbt(&k, key, strlen(key)+1), fill_dbt(&v, val, strlen(val)+1), null_db, null_txn); brt_insert(brt, fill_dbt(&k, key, strlen(key)+1), fill_dbt(&v, val, strlen(val)+1), null_db, null_txn);
if (i<600) { if (i<600) {
int verify_result=verify_brt(brt); int verify_result=toku_verify_brt(brt);
if (verify_result) { if (verify_result) {
dump_brt(brt); dump_brt(brt);
assert(0); assert(0);
...@@ -549,7 +549,7 @@ static void test_read_what_was_written (void) { ...@@ -549,7 +549,7 @@ static void test_read_what_was_written (void) {
printf("Now read them out\n"); printf("Now read them out\n");
//show_brt_blocknumbers(brt); //show_brt_blocknumbers(brt);
verify_brt(brt); toku_verify_brt(brt);
//dump_brt(brt); //dump_brt(brt);
/* See if we can read them all out again. */ /* See if we can read them all out again. */
......
...@@ -53,7 +53,7 @@ static void verify_parent_fingerprint (BRTNODE node) { ...@@ -53,7 +53,7 @@ static void verify_parent_fingerprint (BRTNODE node) {
} }
} }
int verify_brtnode (BRT brt, DISKOFF off, bytevec lorange, ITEMLEN lolen, bytevec hirange, ITEMLEN hilen, int recurse, BRTNODE parent_brtnode) { int toku_verify_brtnode (BRT brt, DISKOFF off, bytevec lorange, ITEMLEN lolen, bytevec hirange, ITEMLEN hilen, int recurse, BRTNODE parent_brtnode) {
int result=0; int result=0;
BRTNODE node; BRTNODE node;
void *node_v; void *node_v;
...@@ -106,7 +106,7 @@ int verify_brtnode (BRT brt, DISKOFF off, bytevec lorange, ITEMLEN lolen, byteve ...@@ -106,7 +106,7 @@ int verify_brtnode (BRT brt, DISKOFF off, bytevec lorange, ITEMLEN lolen, byteve
if (hirange) assert(toku_keycompare(node->u.n.childkeys[i-1], node->u.n.childkeylens[i-1], hirange, hilen)<=0); if (hirange) assert(toku_keycompare(node->u.n.childkeys[i-1], node->u.n.childkeylens[i-1], hirange, hilen)<=0);
} }
if (recurse) { if (recurse) {
result|=verify_brtnode(brt, node->u.n.children[i], result|=toku_verify_brtnode(brt, node->u.n.children[i],
(i==0) ? lorange : node->u.n.childkeys[i-1], (i==0) ? lorange : node->u.n.childkeys[i-1],
(i==0) ? lolen : node->u.n.childkeylens[i-1], (i==0) ? lolen : node->u.n.childkeylens[i-1],
(i==node->u.n.n_children-1) ? hirange : node->u.n.childkeys[i], (i==node->u.n.n_children-1) ? hirange : node->u.n.childkeys[i],
...@@ -120,7 +120,7 @@ int verify_brtnode (BRT brt, DISKOFF off, bytevec lorange, ITEMLEN lolen, byteve ...@@ -120,7 +120,7 @@ int verify_brtnode (BRT brt, DISKOFF off, bytevec lorange, ITEMLEN lolen, byteve
return result; return result;
} }
int verify_brt (BRT brt) { int toku_verify_brt (BRT brt) {
int r; int r;
CACHEKEY *rootp; CACHEKEY *rootp;
if ((r = toku_read_and_pin_brt_header(brt->cf, &brt->h))) { if ((r = toku_read_and_pin_brt_header(brt->cf, &brt->h))) {
...@@ -128,7 +128,7 @@ int verify_brt (BRT brt) { ...@@ -128,7 +128,7 @@ int verify_brt (BRT brt) {
return r; return r;
} }
rootp = toku_calculate_root_offset_pointer(brt); rootp = toku_calculate_root_offset_pointer(brt);
if ((r=verify_brtnode(brt, *rootp, 0, 0, 0, 0, 1, null_brtnode))) goto died0; if ((r=toku_verify_brtnode(brt, *rootp, 0, 0, 0, 0, 1, null_brtnode))) goto died0;
if ((r = toku_unpin_brt_header(brt))!=0) return r; if ((r = toku_unpin_brt_header(brt))!=0) return r;
return 0; return 0;
} }
...@@ -1941,7 +1941,7 @@ int brt_delete(BRT brt, DBT *key, DB *db) { ...@@ -1941,7 +1941,7 @@ int brt_delete(BRT brt, DBT *key, DB *db) {
return r; return r;
} }
int verify_brtnode (BRT brt, DISKOFF off, bytevec lorange, ITEMLEN lolen, bytevec hirange, ITEMLEN hilen, int recurse, BRTNODE parent_brtnode); int toku_verify_brtnode (BRT brt, DISKOFF off, bytevec lorange, ITEMLEN lolen, bytevec hirange, ITEMLEN hilen, int recurse, BRTNODE parent_brtnode);
int dump_brtnode (BRT brt, DISKOFF off, int depth, bytevec lorange, ITEMLEN lolen, bytevec hirange, ITEMLEN hilen, BRTNODE parent_brtnode) { int dump_brtnode (BRT brt, DISKOFF off, int depth, bytevec lorange, ITEMLEN lolen, bytevec hirange, ITEMLEN hilen, BRTNODE parent_brtnode) {
int result=0; int result=0;
...@@ -1953,7 +1953,7 @@ int dump_brtnode (BRT brt, DISKOFF off, int depth, bytevec lorange, ITEMLEN lole ...@@ -1953,7 +1953,7 @@ int dump_brtnode (BRT brt, DISKOFF off, int depth, bytevec lorange, ITEMLEN lole
printf("%s:%d pin %p\n", __FILE__, __LINE__, node_v); printf("%s:%d pin %p\n", __FILE__, __LINE__, node_v);
node=node_v; node=node_v;
node->parent_brtnode = parent_brtnode; node->parent_brtnode = parent_brtnode;
result=verify_brtnode(brt, off, lorange, lolen, hirange, hilen, 0, parent_brtnode); result=toku_verify_brtnode(brt, off, lorange, lolen, hirange, hilen, 0, parent_brtnode);
printf("%*sNode=%p\n", depth, "", node); printf("%*sNode=%p\n", depth, "", node);
if (node->height>0) { if (node->height>0) {
printf("%*sNode %lld nodesize=%d height=%d n_children=%d n_bytes_in_hashtables=%d keyrange=%s %s\n", printf("%*sNode %lld nodesize=%d height=%d n_children=%d n_bytes_in_hashtables=%d keyrange=%s %s\n",
......
...@@ -43,7 +43,7 @@ void brt_flush (BRT); /* fsync and clear the caches. */ ...@@ -43,7 +43,7 @@ void brt_flush (BRT); /* fsync and clear the caches. */
int brt_create_cachetable(CACHETABLE *t, long cachesize, LSN initial_lsn, TOKULOGGER); int brt_create_cachetable(CACHETABLE *t, long cachesize, LSN initial_lsn, TOKULOGGER);
extern int brt_debug_mode; extern int brt_debug_mode;
int verify_brt (BRT brt); int toku_verify_brt (BRT brt);
int show_brt_blocknumbers(BRT); int show_brt_blocknumbers(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