From ee6094ccce26e369d86e45c0f689161e3c7ce719 Mon Sep 17 00:00:00 2001 From: Zardosht Kasheff Date: Wed, 17 Apr 2013 00:00:29 -0400 Subject: [PATCH] [t:4875], move toku_calculate_root_offset_pointer to brt_header.c git-svn-id: file:///svn/toku/tokudb@43457 c7de825b-a66e-492c-adef-691d508d4ae1 --- newbrt/brt-internal.h | 3 +-- newbrt/brt.c | 7 +------ newbrt/brt_header.c | 6 ++++++ newbrt/brt_header.h | 1 + 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/newbrt/brt-internal.h b/newbrt/brt-internal.h index e63517425b2..a5638d00a27 100644 --- a/newbrt/brt-internal.h +++ b/newbrt/brt-internal.h @@ -392,7 +392,7 @@ struct brt_header { TXNID root_xid_that_created; struct toku_list live_brts; OMT txns; // transactions that are using this header - bool pinned_by_checkpoint; //Keep this heaer around for checkpoint, like a transaction + bool pinned_by_checkpoint; //Keep this header around for checkpoint, like a transaction brt_compare_func compare_fun; brt_update_func update_fun; @@ -541,7 +541,6 @@ extern int toku_brtnode_pe_callback (void *brtnode_pv, PAIR_ATTR old_attr, PAIR_ extern BOOL toku_brtnode_pf_req_callback(void* brtnode_pv, void* read_extraargs); int toku_brtnode_pf_callback(void* brtnode_pv, void* UU(disk_data), void* read_extraargs, int fd, PAIR_ATTR* sizep); extern int toku_brtnode_cleaner_callback( void *brtnode_pv, BLOCKNUM blocknum, u_int32_t fullhash, void *extraargs); -extern CACHEKEY* toku_calculate_root_offset_pointer (struct brt_header* h, u_int32_t *root_hash); static inline CACHETABLE_WRITE_CALLBACK get_write_callbacks_for_node(struct brt_header* h) { CACHETABLE_WRITE_CALLBACK wc; diff --git a/newbrt/brt.c b/newbrt/brt.c index e7ff26a6ea0..10136531e7f 100644 --- a/newbrt/brt.c +++ b/newbrt/brt.c @@ -2567,11 +2567,6 @@ static void push_something_at_root (struct brt_header *h, BRTNODE *nodep, BRT_MS } } -CACHEKEY* toku_calculate_root_offset_pointer (struct brt_header* h, u_int32_t *roothash) { - *roothash = toku_cachetable_hash(h->cf, h->root_blocknum); - return &h->root_blocknum; -} - int toku_brt_root_put_cmd (struct brt_header *h, BRT_MSG_S * cmd) // Effect: @@ -3184,7 +3179,7 @@ int toku_update_descriptor(struct brt_header * h, DESCRIPTOR d, int fd) { int r = 0; DISKOFF offset; - //4 for checksum + // 4 for checksum toku_realloc_descriptor_on_disk(h->blocktable, toku_serialize_descriptor_size(d)+4, &offset, h); r = toku_serialize_descriptor_contents_to_fd(fd, d, offset); if (r) { diff --git a/newbrt/brt_header.c b/newbrt/brt_header.c index 8325fa3f841..1c56efd9dd1 100644 --- a/newbrt/brt_header.c +++ b/newbrt/brt_header.c @@ -873,3 +873,9 @@ toku_brtheader_remove_txn_ref(struct brt_header* h, TOKUTXN txn) { } } +CACHEKEY* toku_calculate_root_offset_pointer (struct brt_header* h, u_int32_t *roothash) { + *roothash = toku_cachetable_hash(h->cf, h->root_blocknum); + return &h->root_blocknum; +} + + diff --git a/newbrt/brt_header.h b/newbrt/brt_header.h index 8c07f4af242..b9c1fdd92ae 100644 --- a/newbrt/brt_header.h +++ b/newbrt/brt_header.h @@ -58,5 +58,6 @@ toku_brtheader_maybe_add_txn_ref(struct brt_header* h, TOKUTXN txn); void toku_brtheader_remove_txn_ref(struct brt_header* h, TOKUTXN txn); +CACHEKEY* toku_calculate_root_offset_pointer (struct brt_header* h, u_int32_t *root_hash); #endif