map->filename = logname;
map->log_seq = log_seq;
map->log = log;
- g_atomic_int_set(&map->refcount, 0);
+ g_atomic_int_set(&map->mapcount, 0);
g_hash_table_insert(log->mmap_cache, GINT_TO_POINTER(log_seq), map);
if (mmap == NULL)
return;
- if (g_atomic_int_dec_and_test(&mmap->refcount)) {
+ if (g_atomic_int_dec_and_test(&mmap->mapcount)) {
g_mutex_lock(mmap->lock);
- if (g_atomic_int_get(&mmap->refcount) > 0) {
+ if (g_atomic_int_get(&mmap->mapcount) > 0) {
g_print("Unmapped log segment %d...\n", mmap->log_seq);
munmap((void *)mmap->addr, mmap->len);
mmap->addr = NULL;