The world's most popular open source database
#include "univ.i"#include "mem0mem.h"#include "sync0sync.h"Include dependency graph for hash0hash.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
| #define HASH_ASSERT_OWNED | ( | TABLE, | |||
| FOLD | ) |
Definition at line 62 of file hash0hash.h.
| #define HASH_DELETE | ( | TYPE, | |||
| NAME, | |||||
| TABLE, | |||||
| FOLD, | |||||
| DATA | ) |
Value:
do {\ hash_cell_t* cell3333;\ TYPE* struct3333;\ \ HASH_ASSERT_OWNED(TABLE, FOLD)\ \ cell3333 = hash_get_nth_cell(TABLE, hash_calc_hash(FOLD, TABLE));\ \ if (cell3333->node == DATA) {\ cell3333->node = DATA->NAME;\ } else {\ struct3333 = cell3333->node;\ \ while (struct3333->NAME != DATA) {\ \ struct3333 = struct3333->NAME;\ ut_a(struct3333);\ }\ \ struct3333->NAME = DATA->NAME;\ }\ } while (0)
Definition at line 96 of file hash0hash.h.
Referenced by buf_LRU_block_remove_hashed_page(), dict_col_remove_from_cache(), dict_col_reposition_in_cache(), dict_table_change_id_in_cache(), dict_table_remove_from_cache(), dict_table_rename_in_cache(), fil_rename_tablespace_in_mem(), fil_space_free(), lock_rec_dequeue_from_page(), lock_rec_discard(), and thr_local_free().
| #define HASH_DELETE_AND_COMPACT | ( | TYPE, | |||
| NAME, | |||||
| TABLE, | |||||
| NODE | ) |
Definition at line 123 of file hash0hash.h.
Referenced by fil_validate(), lock_get_n_rec_locks(), lock_rec_get_first_on_page(), lock_rec_get_first_on_page_addr(), lock_validate(), recv_apply_hashed_log_recs(), and recv_get_fil_addr_struct().
| #define HASH_GET_NEXT | ( | NAME, | |||
| DATA | ) | ((DATA)->NAME) |
Definition at line 129 of file hash0hash.h.
Referenced by fil_validate(), lock_get_n_rec_locks(), lock_rec_get_first_on_page(), lock_rec_get_first_on_page_addr(), lock_rec_get_next_on_page(), lock_validate(), recv_apply_hashed_log_recs(), recv_apply_log_recs_for_backup(), and recv_get_fil_addr_struct().
| #define HASH_INSERT | ( | TYPE, | |||
| NAME, | |||||
| TABLE, | |||||
| FOLD, | |||||
| DATA | ) |
Value:
do {\ hash_cell_t* cell3333;\ TYPE* struct3333;\ \ HASH_ASSERT_OWNED(TABLE, FOLD)\ \ (DATA)->NAME = NULL;\ \ cell3333 = hash_get_nth_cell(TABLE, hash_calc_hash(FOLD, TABLE));\ \ if (cell3333->node == NULL) {\ cell3333->node = DATA;\ } else {\ struct3333 = cell3333->node;\ \ while (struct3333->NAME != NULL) {\ \ struct3333 = struct3333->NAME;\ }\ \ struct3333->NAME = DATA;\ }\ } while (0)
Definition at line 68 of file hash0hash.h.
Referenced by buf_page_init(), dict_col_add_to_cache(), dict_col_reposition_in_cache(), dict_table_add_to_cache(), dict_table_change_id_in_cache(), dict_table_rename_in_cache(), fil_rename_tablespace_in_mem(), fil_space_create(), lock_rec_create(), recv_add_to_hash_table(), and thr_local_create().
| #define HASH_MIGRATE | ( | OLD_TABLE, | |||
| NEW_TABLE, | |||||
| NODE_TYPE, | |||||
| PTR_NAME, | |||||
| FOLD_FUNC | ) |
Value:
do {\ ulint i2222;\ ulint cell_count2222;\ \ cell_count2222 = hash_get_n_cells(OLD_TABLE);\ \ for (i2222 = 0; i2222 < cell_count2222; i2222++) {\ NODE_TYPE* node2222 = HASH_GET_FIRST((OLD_TABLE), i2222);\ \ while (node2222) {\ NODE_TYPE* next2222 = node2222->PTR_NAME;\ ulint fold2222 = FOLD_FUNC(node2222);\ \ HASH_INSERT(NODE_TYPE, PTR_NAME, (NEW_TABLE),\ fold2222, node2222);\ \ node2222 = next2222;\ }\ }\ } while (0)
Definition at line 226 of file hash0hash.h.
| #define HASH_SEARCH | ( | NAME, | |||
| TABLE, | |||||
| FOLD, | |||||
| DATA, | |||||
| TEST | ) |
Value:
{\
\
HASH_ASSERT_OWNED(TABLE, FOLD)\
\
(DATA) = HASH_GET_FIRST(TABLE, hash_calc_hash(FOLD, TABLE));\
\
while ((DATA) != NULL) {\
if (TEST) {\
break;\
} else {\
(DATA) = HASH_GET_NEXT(NAME, DATA);\
}\
}\
}
Definition at line 133 of file hash0hash.h.
Referenced by dict_col_add_to_cache(), dict_index_find_cols(), dict_table_add_to_cache(), dict_table_rename_in_cache(), fil_decr_pending_ibuf_merges(), fil_delete_tablespace(), fil_extend_space_to_desired_size(), fil_flush(), fil_get_space_id_for_table(), fil_inc_pending_ibuf_merges(), fil_io(), fil_mutex_enter_and_prepare_for_io(), fil_node_create(), fil_rename_tablespace(), fil_rename_tablespace_in_mem(), fil_space_create(), fil_space_for_table_exists_in_mem(), fil_space_free(), fil_space_get_ibuf_data(), fil_space_get_latch(), fil_space_get_n_reserved_extents(), fil_space_get_size(), fil_space_get_type(), fil_space_get_version(), fil_space_release_free_extents(), fil_space_reserve_free_extents(), fil_space_truncate_start(), fil_tablespace_deleted_or_being_deleted_in_mem(), fil_tablespace_exists_in_mem(), thr_local_free(), and thr_local_get().
| #define HASH_TABLE_MAGIC_N 76561114 |
| typedef struct hash_cell_struct hash_cell_t |
Definition at line 17 of file hash0hash.h.
| typedef void* hash_node_t |
Definition at line 19 of file hash0hash.h.
| typedef struct hash_table_struct hash_table_t |
Definition at line 16 of file hash0hash.h.
| UNIV_INLINE ulint hash_calc_hash | ( | ulint | fold, | |
| hash_table_t * | table | |||
| ) |
Referenced by ha_insert_for_fold(), ha_validate(), and recv_hash().
Here is the caller graph for this function:

| hash_table_t* hash_create | ( | ulint | n | ) |
Definition at line 77 of file hash0hash.c.
References hash_table_struct::adaptive, hash_table_struct::array, FALSE, hash_get_nth_cell(), HASH_TABLE_MAGIC_N, hash_table_struct::heap, hash_table_struct::heaps, hash_table_struct::magic_n, mem_alloc, hash_table_struct::mutexes, hash_table_struct::n_cells, hash_table_struct::n_mutexes, hash_cell_struct::node, NULL, ut_find_prime(), and ut_malloc().
Referenced by buf_pool_init(), dict_init(), fil_system_create(), ha_create(), lock_sys_create(), recv_sys_empty_hash(), recv_sys_init(), and thr_local_init().
00079 : created table */ 00080 ulint n) /* in: number of array cells */ 00081 { 00082 hash_cell_t* array; 00083 ulint prime; 00084 hash_table_t* table; 00085 ulint i; 00086 hash_cell_t* cell; 00087 00088 prime = ut_find_prime(n); 00089 00090 table = mem_alloc(sizeof(hash_table_t)); 00091 00092 array = ut_malloc(sizeof(hash_cell_t) * prime); 00093 00094 table->adaptive = FALSE; 00095 table->array = array; 00096 table->n_cells = prime; 00097 table->n_mutexes = 0; 00098 table->mutexes = NULL; 00099 table->heaps = NULL; 00100 table->heap = NULL; 00101 table->magic_n = HASH_TABLE_MAGIC_N; 00102 00103 /* Initialize the cell array */ 00104 00105 for (i = 0; i < prime; i++) { 00106 00107 cell = hash_get_nth_cell(table, i); 00108 cell->node = NULL; 00109 } 00110 00111 return(table); 00112 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void hash_create_mutexes | ( | hash_table_t * | table, | |
| ulint | n_mutexes, | |||
| ulint | sync_level | |||
| ) |
Definition at line 132 of file hash0hash.c.
References mem_alloc, mutex_create, hash_table_struct::mutexes, hash_table_struct::n_mutexes, ut_2_power_up(), and ut_a.
Referenced by ha_create().
00134 : hash table */ 00135 ulint n_mutexes, /* in: number of mutexes, must be a 00136 power of 2 */ 00137 ulint sync_level) /* in: latching order level of the 00138 mutexes: used in the debug version */ 00139 { 00140 ulint i; 00141 00142 ut_a(n_mutexes == ut_2_power_up(n_mutexes)); 00143 00144 table->mutexes = mem_alloc(n_mutexes * sizeof(mutex_t)); 00145 00146 for (i = 0; i < n_mutexes; i++) { 00147 mutex_create(table->mutexes + i, sync_level); 00148 } 00149 00150 table->n_mutexes = n_mutexes; 00151 }
Here is the call graph for this function:

Here is the caller graph for this function:

| UNIV_INLINE mem_heap_t* hash_get_heap | ( | hash_table_t * | table, | |
| ulint | fold | |||
| ) |
| UNIV_INLINE mutex_t* hash_get_mutex | ( | hash_table_t * | table, | |
| ulint | fold | |||
| ) |
Referenced by ha_delete(), ha_insert_for_fold(), ha_remove_all_nodes_to_page(), ha_search_and_update_if_found(), hash_mutex_enter(), and hash_mutex_exit().
Here is the caller graph for this function:

| UNIV_INLINE ulint hash_get_mutex_no | ( | hash_table_t * | table, | |
| ulint | fold | |||
| ) |
| UNIV_INLINE ulint hash_get_n_cells | ( | hash_table_t * | table | ) |
Referenced by btr_search_validate(), fil_validate(), ha_print_info(), ha_validate(), lock_get_n_rec_locks(), lock_validate(), recv_apply_hashed_log_recs(), and recv_apply_log_recs_for_backup().
Here is the caller graph for this function:

| UNIV_INLINE hash_cell_t* hash_get_nth_cell | ( | hash_table_t * | table, | |
| ulint | n | |||
| ) |
Referenced by btr_search_validate(), ha_insert_for_fold(), ha_print_info(), ha_validate(), hash_create(), and recv_apply_log_recs_for_backup().
Here is the caller graph for this function:

| UNIV_INLINE mem_heap_t* hash_get_nth_heap | ( | hash_table_t * | table, | |
| ulint | i | |||
| ) |
| UNIV_INLINE mutex_t* hash_get_nth_mutex | ( | hash_table_t * | table, | |
| ulint | i | |||
| ) |
| void hash_mutex_enter | ( | hash_table_t * | table, | |
| ulint | fold | |||
| ) |
Definition at line 20 of file hash0hash.c.
References hash_get_mutex(), and mutex_enter.
00022 : hash table */ 00023 ulint fold) /* in: fold */ 00024 { 00025 mutex_enter(hash_get_mutex(table, fold)); 00026 }
Here is the call graph for this function:

| void hash_mutex_enter_all | ( | hash_table_t * | table | ) |
Definition at line 44 of file hash0hash.c.
References mutex_enter, hash_table_struct::mutexes, and hash_table_struct::n_mutexes.
00046 : hash table */ 00047 { 00048 ulint i; 00049 00050 for (i = 0; i < table->n_mutexes; i++) { 00051 00052 mutex_enter(table->mutexes + i); 00053 } 00054 }
| void hash_mutex_exit | ( | hash_table_t * | table, | |
| ulint | fold | |||
| ) |
Definition at line 32 of file hash0hash.c.
References hash_get_mutex(), and mutex_exit().
00034 : hash table */ 00035 ulint fold) /* in: fold */ 00036 { 00037 mutex_exit(hash_get_mutex(table, fold)); 00038 }
Here is the call graph for this function:

| void hash_mutex_exit_all | ( | hash_table_t * | table | ) |
Definition at line 60 of file hash0hash.c.
References mutex_exit(), hash_table_struct::mutexes, and hash_table_struct::n_mutexes.
00062 : hash table */ 00063 { 00064 ulint i; 00065 00066 for (i = 0; i < table->n_mutexes; i++) { 00067 00068 mutex_exit(table->mutexes + i); 00069 } 00070 }
Here is the call graph for this function:

| void hash_table_free | ( | hash_table_t * | table | ) |
Definition at line 118 of file hash0hash.c.
References hash_table_struct::array, mem_free, hash_table_struct::mutexes, NULL, ut_a, and ut_free().
Referenced by recv_sys_empty_hash(), and recv_sys_free().
00120 : hash table */ 00121 { 00122 ut_a(table->mutexes == NULL); 00123 00124 ut_free(table->array); 00125 mem_free(table); 00126 }
Here is the call graph for this function:

Here is the caller graph for this function:

1.4.7

