reorder initialization code so that the i/o backend stuff happens all at once

This commit is contained in:
Sears Russell 2009-12-09 19:56:19 +00:00
parent cd8c63889d
commit dfe83a215d

View file

@ -68,6 +68,13 @@ int Tinit() {
stasis_operation_table_init(); stasis_operation_table_init();
stasis_transaction_table = stasis_transaction_table_init();
stasis_dirty_page_table = stasis_dirty_page_table_init();
stasis_page_init(stasis_dirty_page_table);
// XXX move into stasis_log_safe_writes_factory()
stasis_log_file = 0; stasis_log_file = 0;
if(LOG_TO_FILE == stasis_log_type) { if(LOG_TO_FILE == stasis_log_type) {
@ -84,11 +91,6 @@ int Tinit() {
assert(stasis_log_file != NULL); assert(stasis_log_file != NULL);
} }
stasis_transaction_table = stasis_transaction_table_init();
stasis_dirty_page_table = stasis_dirty_page_table_init();
stasis_page_init(stasis_dirty_page_table);
stasis_buffer_manager = stasis_buffer_manager_factory(stasis_log_file, stasis_dirty_page_table); stasis_buffer_manager = stasis_buffer_manager_factory(stasis_log_file, stasis_dirty_page_table);
stasis_dirty_page_table_set_buffer_manager(stasis_dirty_page_table, stasis_buffer_manager); // xxx circular dependency. stasis_dirty_page_table_set_buffer_manager(stasis_dirty_page_table, stasis_buffer_manager); // xxx circular dependency.