Commit 0781c381 authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:4875], move some more stuff over to brt_header.c, make some functions static

git-svn-id: file:///svn/toku/tokudb@43426 c7de825b-a66e-492c-adef-691d508d4ae1
parent 8bb40a17
......@@ -7,6 +7,7 @@
#include <brt-flusher.h>
#include <brt-flusher-internal.h>
#include <brt-cachetable-wrappers.h>
#include <brt_header.h>
/* Status is intended for display to humans to help understand system behavior.
* It does not need to be perfectly thread-safe.
......
......@@ -7,6 +7,7 @@
#include <brt-flusher-internal.h>
#include <brt-cachetable-wrappers.h>
#include <brt-internal.h>
#include <brt_header.h>
// Member Descirption:
// 1. highest_pivot_key - this is the key that corresponds to the
......
......@@ -948,9 +948,6 @@ void brtnode_put_cmd (
OMT live_root_txns
);
void toku_reset_root_xid_that_created(struct brt_header* h, TXNID new_root_xid_that_created);
// Reset the root_xid_that_created field to the given value.
// This redefines which xid created the dictionary.
void toku_flusher_thread_set_callback(void (*callback_f)(int, void*), void* extra);
#endif
......@@ -5839,20 +5839,6 @@ int toku_brt_strerror_r(int error, char *buf, size_t buflen)
}
}
void
toku_reset_root_xid_that_created(struct brt_header* h, TXNID new_root_xid_that_created) {
// Reset the root_xid_that_created field to the given value.
// This redefines which xid created the dictionary.
// hold lock around setting and clearing of dirty bit
// (see cooperative use of dirty bit in toku_brtheader_begin_checkpoint())
toku_brtheader_lock (h);
h->root_xid_that_created = new_root_xid_that_created;
h->dirty = 1;
toku_brtheader_unlock (h);
}
#include <valgrind/helgrind.h>
void __attribute__((__constructor__)) toku_brt_helgrind_ignore(void);
void
......
......@@ -33,11 +33,8 @@ int toku_brt_change_descriptor(BRT t, const DBT* old_descriptor, const DBT* new_
int toku_update_descriptor(struct brt_header * h, DESCRIPTOR d, int fd);
// Note: See the locking discussion in brt.c for toku_brt_change_descriptor and toku_update_descriptor.
int toku_dictionary_redirect (const char *dst_fname_in_env, BRT old_brt, TOKUTXN txn) __attribute__ ((warn_unused_result));
// See the brt.c file for what this toku_redirect_brt does
int toku_dictionary_redirect_abort(struct brt_header *old_h, struct brt_header *new_h, TOKUTXN txn) __attribute__ ((warn_unused_result));
u_int32_t toku_serialize_descriptor_size(const DESCRIPTOR desc);
int toku_brt_create(BRT *) __attribute__ ((warn_unused_result));
int toku_brt_set_flags(BRT, unsigned int flags) __attribute__ ((warn_unused_result));
......
This diff is collapsed.
......@@ -21,15 +21,9 @@ void toku_brtheader_destroy_treelock(struct brt_header* h);
void toku_brtheader_grab_treelock(struct brt_header* h);
void toku_brtheader_release_treelock(struct brt_header* h);
int toku_brtheader_close (CACHEFILE cachefile, int fd, void *header_v, char **error_string, BOOL oplsn_valid, LSN oplsn) __attribute__((__warn_unused_result__));
int toku_brtheader_begin_checkpoint (LSN checkpoint_lsn, void *header_v) __attribute__((__warn_unused_result__));
int toku_brtheader_checkpoint (CACHEFILE cachefile, int fd, void *header_v) __attribute__((__warn_unused_result__));
int toku_brtheader_end_checkpoint (CACHEFILE cachefile, int fd, void *header_v) __attribute__((__warn_unused_result__));
int toku_create_new_brtheader(BRT t, CACHEFILE cf, TOKUTXN txn);
void toku_brtheader_free (struct brt_header *h);
int toku_brt_alloc_init_header(BRT t, TOKUTXN txn);
int toku_read_brt_header_and_store_in_cachefile (BRT brt, CACHEFILE cf, LSN max_acceptable_lsn, struct brt_header **header, BOOL* was_open);
void toku_brtheader_note_brt_open(BRT live);
......@@ -50,4 +44,10 @@ toku_brt_header_init(
enum toku_compression_method compression_method
);
int toku_dictionary_redirect_abort(struct brt_header *old_h, struct brt_header *new_h, TOKUTXN txn) __attribute__ ((warn_unused_result));
int toku_dictionary_redirect (const char *dst_fname_in_env, BRT old_brt, TOKUTXN txn);
void toku_reset_root_xid_that_created(struct brt_header* h, TXNID new_root_xid_that_created);
// Reset the root_xid_that_created field to the given value.
// This redefines which xid created the dictionary.
#endif
......@@ -25,6 +25,7 @@
#include "dbufio.h"
#include "leafentry.h"
#include "log-internal.h"
#include "brt_header.h"
// to turn on tracing,
// cd .../newbrt
......
......@@ -3940,7 +3940,7 @@ toku_cachefile_get_cachetable(CACHEFILE cf) {
return cf->cachetable;
}
//Only called by toku_brtheader_end_checkpoint
//Only called by brtheader_end_checkpoint
//Must have access to cf->fd (must be protected)
int
toku_cachefile_fsync(CACHEFILE cf) {
......
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