mirror of
https://github.com/MariaDB/server.git
synced 2025-01-27 17:33:44 +01:00
branches/zip: fil_init(): Add the parameter hash_size.
This commit is contained in:
parent
054ef0dec8
commit
684bf71d6e
4 changed files with 30 additions and 48 deletions
|
@ -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:
|
||||
|
|
|
@ -1456,64 +1456,39 @@ fil_check_adress_in_tablespace(
|
|||
return(FALSE);
|
||||
}
|
||||
|
||||
/********************************************************************
|
||||
Creates a the tablespace memory cache. */
|
||||
static
|
||||
fil_system_t*
|
||||
fil_system_create(
|
||||
/*==============*/
|
||||
/* out, own: tablespace memory cache */
|
||||
ulint hash_size, /* in: hash table size */
|
||||
ulint max_n_open) /* in: maximum number of open files; must be
|
||||
> 10 */
|
||||
{
|
||||
fil_system_t* system;
|
||||
|
||||
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;
|
||||
|
||||
system->modification_counter = 0;
|
||||
system->max_assigned_id = 0;
|
||||
|
||||
system->tablespace_version = 0;
|
||||
|
||||
UT_LIST_INIT(system->unflushed_spaces);
|
||||
UT_LIST_INIT(system->space_list);
|
||||
|
||||
return(system);
|
||||
}
|
||||
|
||||
/********************************************************************
|
||||
Initializes the tablespace memory cache. */
|
||||
UNIV_INTERN
|
||||
void
|
||||
fil_init(
|
||||
/*=====*/
|
||||
ulint hash_size, /* in: hash table size */
|
||||
ulint max_n_open) /* in: max number of open files */
|
||||
{
|
||||
ulint hash_size;
|
||||
|
||||
ut_a(fil_system == NULL);
|
||||
|
||||
if (srv_file_per_table) {
|
||||
hash_size = 50000;
|
||||
} else {
|
||||
hash_size = 5000;
|
||||
}
|
||||
ut_a(hash_size > 0);
|
||||
ut_a(max_n_open > 0);
|
||||
|
||||
fil_system = fil_system_create(hash_size, max_n_open);
|
||||
fil_system = mem_alloc(sizeof(fil_system_t));
|
||||
|
||||
mutex_create(&fil_system->mutex, SYNC_ANY_LATCH);
|
||||
|
||||
fil_system->spaces = hash_create(hash_size);
|
||||
fil_system->name_hash = hash_create(hash_size);
|
||||
|
||||
UT_LIST_INIT(fil_system->LRU);
|
||||
|
||||
fil_system->n_open = 0;
|
||||
fil_system->max_n_open = max_n_open;
|
||||
|
||||
fil_system->modification_counter = 0;
|
||||
fil_system->max_assigned_id = 0;
|
||||
|
||||
fil_system->tablespace_version = 0;
|
||||
|
||||
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();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue