int pvfs2_mmap_ra_cache_initialize(void) { int ret = -1; if (!MMAP_RA_CACHE_INITIALIZED()) { s_key_to_data_table = qhash_init( hash_key_compare, hash_key, DEFAULT_MMAP_RA_CACHE_HTABLE_SIZE); if (!s_key_to_data_table) { goto return_error; } gossip_debug(GOSSIP_MMAP_RCACHE_DEBUG, "mmap_ra_cache_initialized\n"); ret = 0; } else { gossip_debug(GOSSIP_MMAP_RCACHE_DEBUG, "mmap readahead cache already " "initalized. returning success\n"); ret = 0; } return_error: return ret; }
int id_gen_safe_initialize() { if (!ID_GEN_SAFE_INITIALIZED()) { s_id_gen_safe_table = qhash_init( hash_key_compare, hash_key, DEFAULT_ID_GEN_SAFE_TABLE_SIZE); if (!s_id_gen_safe_table) { return -ENOMEM; } } s_id_gen_safe_init_count++; return 0; }
int trove_handle_mgmt_initialize() { /* due to weird trove_initialize usages; this will always succeed unless the hash table initialization really fails. */ int ret = 0; gen_mutex_lock(&trove_handle_mutex); if (s_fsid_to_ledger_table == NULL) { s_fsid_to_ledger_table = qhash_init(hash_fsid_compare, hash_fsid,67); ret = (s_fsid_to_ledger_table ? 0 : -1); } gen_mutex_unlock(&trove_handle_mutex); return ret; }