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

closes #4634, remove unneeded function toku_cachefile_get_worqueue_load

git-svn-id: file:///svn/toku/tokudb@45659 c7de825b-a66e-492c-adef-691d508d4ae1
parent 4234fe52
......@@ -583,11 +583,6 @@ int toku_cachetable_openf (CACHEFILE *cfptr, CACHETABLE ct, const char *fname_in
return r;
}
void toku_cachefile_get_workqueue_load (CACHEFILE UU(cf), int *n_in_queue, int *n_threads) {
*n_in_queue = 0;
*n_threads = 0;
}
//Test-only function
int toku_cachefile_set_fd (CACHEFILE cf, int fd, const char *fname_in_env) {
int r;
......
......@@ -103,8 +103,6 @@ void toku_cachetable_release_reserved_memory(CACHETABLE, uint64_t);
// cachefile operations
void toku_cachefile_get_workqueue_load (CACHEFILE, int *n_in_queue, int *n_threads);
// Does an fsync of a cachefile.
// Handles the case where cf points to /dev/null
int toku_cachefile_fsync(CACHEFILE cf);
......
......@@ -515,9 +515,9 @@ int toku_serialize_ftnode_to_memory (FTNODE node,
BOOL in_parallel,
/*out*/ size_t *n_bytes_to_write,
/*out*/ char **bytes_to_write);
int toku_serialize_ftnode_to(int fd, BLOCKNUM, FTNODE node, FTNODE_DISK_DATA* ndd, BOOL do_rebalancing, FT h, int n_workitems, int n_threads, BOOL for_checkpoint);
int toku_serialize_ftnode_to(int fd, BLOCKNUM, FTNODE node, FTNODE_DISK_DATA* ndd, BOOL do_rebalancing, FT h, BOOL for_checkpoint);
int toku_serialize_rollback_log_to (int fd, BLOCKNUM blocknum, ROLLBACK_LOG_NODE log,
FT h, int n_workitems, int n_threads,
FT h,
BOOL for_checkpoint);
int toku_deserialize_rollback_log_from (int fd, BLOCKNUM blocknum, u_int32_t fullhash, ROLLBACK_LOG_NODE *logp, FT h);
int toku_deserialize_bp_from_disk(FTNODE node, FTNODE_DISK_DATA ndd, int childnum, int fd, struct ftnode_fetch_extra* bfe);
......
......@@ -698,7 +698,7 @@ void toku_ftnode_clone_callback(
void toku_ftnode_flush_callback (
CACHEFILE cachefile,
CACHEFILE UU(cachefile),
int fd,
BLOCKNUM nodename,
void *ftnode_v,
......@@ -723,9 +723,7 @@ void toku_ftnode_flush_callback (
}
if (!h->panic) { // if the brt panicked, stop writing, otherwise try to write it.
toku_assert_entire_node_in_memory(ftnode);
int n_workitems, n_threads;
toku_cachefile_get_workqueue_load(cachefile, &n_workitems, &n_threads);
int r = toku_serialize_ftnode_to(fd, ftnode->thisnodename, ftnode, ndd, !is_clone, h, n_workitems, n_threads, for_checkpoint);
int r = toku_serialize_ftnode_to(fd, ftnode->thisnodename, ftnode, ndd, !is_clone, h, for_checkpoint);
assert_zero(r);
ftnode->layout_version_read_from_disk = FT_LAYOUT_VERSION;
}
......
......@@ -861,7 +861,7 @@ toku_serialize_ftnode_to_memory (FTNODE node,
}
int
toku_serialize_ftnode_to (int fd, BLOCKNUM blocknum, FTNODE node, FTNODE_DISK_DATA* ndd, BOOL do_rebalancing, FT h, int UU(n_workitems), int UU(n_threads), BOOL for_checkpoint) {
toku_serialize_ftnode_to (int fd, BLOCKNUM blocknum, FTNODE node, FTNODE_DISK_DATA* ndd, BOOL do_rebalancing, FT h, BOOL for_checkpoint) {
size_t n_to_write;
char *compressed_buf = NULL;
......@@ -2604,7 +2604,6 @@ serialize_uncompressed_block_to_memory(char * uncompressed_buf,
static int
toku_serialize_rollback_log_to_memory (ROLLBACK_LOG_NODE log,
int UU(n_workitems), int UU(n_threads),
enum toku_compression_method method,
/*out*/ size_t *n_bytes_to_write,
/*out*/ char **bytes_to_write) {
......@@ -2638,12 +2637,12 @@ toku_serialize_rollback_log_to_memory (ROLLBACK_LOG_NODE log,
int
toku_serialize_rollback_log_to (int fd, BLOCKNUM blocknum, ROLLBACK_LOG_NODE log,
FT h, int n_workitems, int n_threads,
FT h,
BOOL for_checkpoint) {
size_t n_to_write;
char *compressed_buf;
{
int r = toku_serialize_rollback_log_to_memory(log, n_workitems, n_threads, h->h->compression_method, &n_to_write, &compressed_buf);
int r = toku_serialize_rollback_log_to_memory(log, h->h->compression_method, &n_to_write, &compressed_buf);
if (r!=0) return r;
}
......
......@@ -33,11 +33,9 @@ void toku_rollback_flush_callback (CACHEFILE cachefile, int fd, BLOCKNUM logname
assert(log->blocknum.b==logname.b);
if (write_me && !h->panic) {
int n_workitems, n_threads;
assert(h->cf == cachefile);
toku_cachefile_get_workqueue_load(cachefile, &n_workitems, &n_threads);
r = toku_serialize_rollback_log_to(fd, log->blocknum, log, h, n_workitems, n_threads, for_checkpoint);
r = toku_serialize_rollback_log_to(fd, log->blocknum, log, h, for_checkpoint);
if (r) {
if (h->panic==0) {
char *e = strerror(r);
......
......@@ -360,7 +360,7 @@ test_prefetching(void) {
assert(size == 100);
}
FTNODE_DISK_DATA ndd = NULL;
r = toku_serialize_ftnode_to(fd, make_blocknum(20), &sn, &ndd, TRUE, brt->ft, 1, 1, FALSE);
r = toku_serialize_ftnode_to(fd, make_blocknum(20), &sn, &ndd, TRUE, brt->ft, FALSE);
assert(r==0);
test_prefetch_read(fd, brt, brt_h);
......
......@@ -305,7 +305,7 @@ test_serialize_nonleaf(void) {
assert(size == 100);
}
FTNODE_DISK_DATA ndd = NULL;
r = toku_serialize_ftnode_to(fd, make_blocknum(20), &sn, &ndd, TRUE, brt->ft, 1, 1, FALSE);
r = toku_serialize_ftnode_to(fd, make_blocknum(20), &sn, &ndd, TRUE, brt->ft, FALSE);
assert(r==0);
test1(fd, brt_h, &dn);
......@@ -397,7 +397,7 @@ test_serialize_leaf(void) {
assert(size == 100);
}
FTNODE_DISK_DATA ndd = NULL;
r = toku_serialize_ftnode_to(fd, make_blocknum(20), &sn, &ndd, TRUE, brt->ft, 1, 1, FALSE);
r = toku_serialize_ftnode_to(fd, make_blocknum(20), &sn, &ndd, TRUE, brt->ft, FALSE);
assert(r==0);
test1(fd, brt_h, &dn);
......
......@@ -142,7 +142,7 @@ test_serialize_leaf(int valsize, int nelts, double entropy) {
struct timeval t[2];
gettimeofday(&t[0], NULL);
FTNODE_DISK_DATA ndd = NULL;
r = toku_serialize_ftnode_to(fd, make_blocknum(20), sn, &ndd, TRUE, brt->ft, 1, 1, FALSE);
r = toku_serialize_ftnode_to(fd, make_blocknum(20), sn, &ndd, TRUE, brt->ft, FALSE);
assert(r==0);
gettimeofday(&t[1], NULL);
double dt;
......@@ -276,7 +276,7 @@ test_serialize_nonleaf(int valsize, int nelts, double entropy) {
struct timeval t[2];
gettimeofday(&t[0], NULL);
FTNODE_DISK_DATA ndd = NULL;
r = toku_serialize_ftnode_to(fd, make_blocknum(20), &sn, &ndd, TRUE, brt->ft, 1, 1, FALSE);
r = toku_serialize_ftnode_to(fd, make_blocknum(20), &sn, &ndd, TRUE, brt->ft, FALSE);
assert(r==0);
gettimeofday(&t[1], NULL);
double dt;
......
......@@ -191,12 +191,12 @@ static void write_sn_to_disk(int fd, FT_HANDLE brt, FTNODE sn, FTNODE_DISK_DATA*
PAIR_ATTR attr;
toku_ftnode_clone_callback(sn, &cloned_node_v, &attr, FALSE, brt->ft);
FTNODE cloned_node = cast_to_typeof(cloned_node) cloned_node_v;
r = toku_serialize_ftnode_to(fd, make_blocknum(20), cloned_node, src_ndd, FALSE, brt->ft, 1, 1, FALSE);
r = toku_serialize_ftnode_to(fd, make_blocknum(20), cloned_node, src_ndd, FALSE, brt->ft, FALSE);
assert(r==0);
toku_ftnode_free(&cloned_node);
}
else {
r = toku_serialize_ftnode_to(fd, make_blocknum(20), sn, src_ndd, TRUE, brt->ft, 1, 1, FALSE);
r = toku_serialize_ftnode_to(fd, make_blocknum(20), sn, src_ndd, TRUE, brt->ft, FALSE);
assert(r==0);
}
}
......
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