Commit d9988c26 authored by Yoni Fogel's avatar Yoni Fogel

Closes #1557 Blocktable now has 1 lock per brt

git-svn-id: file:///svn/toku/tokudb@10254 c7de825b-a66e-492c-adef-691d508d4ae1
parent 99a83723
This diff is collapsed.
......@@ -11,9 +11,6 @@ struct block_translation_pair {
DISKOFF size; // set to 0xFFFFFFFFFFFFFFFF for free
};
void toku_blocktable_lock_init(void);
void toku_blocktable_lock_destroy(void);
void toku_block_realloc(BLOCK_TABLE bt, BLOCKNUM b, u_int64_t size, u_int64_t *offset, int *dirty);
void toku_block_alloc(BLOCK_TABLE bt, u_int64_t size, u_int64_t *offset);
void toku_block_free(BLOCK_TABLE bt, u_int64_t offset);
......@@ -50,8 +47,8 @@ u_int64_t toku_block_get_translated_blocknum_limit(BLOCK_TABLE bt);
void toku_block_memcpy_translation_table(BLOCK_TABLE bt, size_t n, void *p);
//Unlocked/multi ops
void toku_block_lock_for_multiple_operations(void);
void toku_block_unlock_for_multiple_operations(void);
void toku_block_lock_for_multiple_operations(BLOCK_TABLE bt);
void toku_block_unlock_for_multiple_operations(BLOCK_TABLE bt);
void toku_block_realloc_translation_unlocked(BLOCK_TABLE bt);
void toku_block_wbuf_free_blocks_unlocked(BLOCK_TABLE bt, struct wbuf *wbuf);
......
......@@ -731,7 +731,7 @@ int toku_serialize_brt_header_to (int fd, struct brt_header *h) {
int rr = 0;
if (h->panic) return h->panic;
lock_for_pwrite();
toku_block_lock_for_multiple_operations();
toku_block_lock_for_multiple_operations(h->blocktable);
struct wbuf w_main;
unsigned int size_main = toku_serialize_brt_header_size (h);
{
......@@ -750,7 +750,7 @@ int toku_serialize_brt_header_to (int fd, struct brt_header *h) {
&size_translation, &address_translation);
size_translation = w_translation.size;
}
toku_block_unlock_for_multiple_operations();
toku_block_unlock_for_multiple_operations(h->blocktable);
{
//Actual Write main header
ssize_t nwrote;
......
......@@ -4426,7 +4426,6 @@ static void toku_brt_lock_init(void) {
toku_pwrite_lock_init();
toku_logger_lock_init();
toku_graceful_lock_init();
toku_blocktable_lock_init();
toku_leaflock_init();
}
......@@ -4434,7 +4433,6 @@ static void toku_brt_lock_destroy(void) {
toku_pwrite_lock_destroy();
toku_logger_lock_destroy();
toku_graceful_lock_destroy();
toku_blocktable_lock_destroy();
toku_leaflock_destroy();
}
......
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