Commit 2225a617 authored by marko's avatar marko

branches/zip: fil_init(): Add the parameter hash_size.

parent 1d229939
......@@ -9,6 +9,11 @@
* data/data0type.c, handler/ha_innodb.cc, include/ha_prototypes.h:
Declare innobase_get_at_most_n_mbchars() in ha_prototypes.h.
2009-03-20 The InnoDB Team
* fil/fil0fil.h, fil/fil0fil.c, srv/srv0start.c:
Add the parameter hash_size to fil_init().
2009-03-20 The InnoDB Team
* fil/fil0fil.c:
......
......@@ -1457,63 +1457,38 @@ fil_check_adress_in_tablespace(
}
/********************************************************************
Creates a the tablespace memory cache. */
static
fil_system_t*
fil_system_create(
/*==============*/
/* out, own: tablespace memory cache */
Initializes the tablespace memory cache. */
UNIV_INTERN
void
fil_init(
/*=====*/
ulint hash_size, /* in: hash table size */
ulint max_n_open) /* in: maximum number of open files; must be
> 10 */
ulint max_n_open) /* in: max number of open files */
{
fil_system_t* system;
ut_a(fil_system == NULL);
ut_a(hash_size > 0);
ut_a(max_n_open > 0);
system = mem_alloc(sizeof(fil_system_t));
mutex_create(&system->mutex, SYNC_ANY_LATCH);
system->spaces = hash_create(hash_size);
system->name_hash = hash_create(hash_size);
UT_LIST_INIT(system->LRU);
system->n_open = 0;
system->max_n_open = max_n_open;
fil_system = mem_alloc(sizeof(fil_system_t));
system->modification_counter = 0;
system->max_assigned_id = 0;
mutex_create(&fil_system->mutex, SYNC_ANY_LATCH);
system->tablespace_version = 0;
fil_system->spaces = hash_create(hash_size);
fil_system->name_hash = hash_create(hash_size);
UT_LIST_INIT(system->unflushed_spaces);
UT_LIST_INIT(system->space_list);
UT_LIST_INIT(fil_system->LRU);
return(system);
}
fil_system->n_open = 0;
fil_system->max_n_open = max_n_open;
/********************************************************************
Initializes the tablespace memory cache. */
UNIV_INTERN
void
fil_init(
/*=====*/
ulint max_n_open) /* in: max number of open files */
{
ulint hash_size;
ut_a(fil_system == NULL);
fil_system->modification_counter = 0;
fil_system->max_assigned_id = 0;
if (srv_file_per_table) {
hash_size = 50000;
} else {
hash_size = 5000;
}
fil_system->tablespace_version = 0;
fil_system = fil_system_create(hash_size, max_n_open);
UT_LIST_INIT(fil_system->unflushed_spaces);
UT_LIST_INIT(fil_system->space_list);
}
/***********************************************************************
......
......@@ -263,6 +263,7 @@ UNIV_INTERN
void
fil_init(
/*=====*/
ulint hash_size, /* in: hash table size */
ulint max_n_open); /* in: max number of open files */
/***********************************************************************
Opens all log files and system tablespace data files. They stay open until the
......
......@@ -1273,7 +1273,8 @@ innobase_start_or_create_for_mysql(void)
SRV_MAX_N_PENDING_SYNC_IOS);
}
fil_init(srv_max_n_open_files);
fil_init(srv_file_per_table ? 50000 : 5000,
srv_max_n_open_files);
ret = buf_pool_init();
......
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