- len += (start % PAGE_SIZE);
- start -= start % PAGE_SIZE;
- len = ALIGN(len, PAGE_SIZE);
+ len += (start % CPU_PAGE_SIZE);
+ start -= start % CPU_PAGE_SIZE;
+ len = ALIGN_TO(len, CPU_PAGE_SIZE);
if (msync(q->mmap_data + start, len, MS_ASYNC | MS_INVALIDATE) < 0)
log(L_ERROR, "Cache %s: msync failed: %m", q->file_name);
#endif
if (msync(q->mmap_data + start, len, MS_ASYNC | MS_INVALIDATE) < 0)
log(L_ERROR, "Cache %s: msync failed: %m", q->file_name);
#endif
h.num_blocks = par->cache_size >> h.block_shift;
h.format_id = par->format_id;
h.entry_table_start = sizeof(h);
h.num_blocks = par->cache_size >> h.block_shift;
h.format_id = par->format_id;
h.entry_table_start = sizeof(h);
log(L_INFO, "Cache %s: created (%d bytes, %d slots, %d buckets)", q->file_name, par->cache_size, h.max_entries, h.hash_size);
if ((q->mmap_data = mmap(NULL, par->cache_size, PROT_READ | PROT_WRITE, MAP_SHARED, q->fd, 0)) == MAP_FAILED)
log(L_INFO, "Cache %s: created (%d bytes, %d slots, %d buckets)", q->file_name, par->cache_size, h.max_entries, h.hash_size);
if ((q->mmap_data = mmap(NULL, par->cache_size, PROT_READ | PROT_WRITE, MAP_SHARED, q->fd, 0)) == MAP_FAILED)
q->file_name = xstrdup(par->file_name);
ASSERT(par->block_size >= 8 && !(par->block_size & (par->block_size-1)));
q->file_name = xstrdup(par->file_name);
ASSERT(par->block_size >= 8 && !(par->block_size & (par->block_size-1)));
if (par->force_reset <= 0 && qache_open_existing(q, par))
;
else if (par->force_reset < 0)
if (par->force_reset <= 0 && qache_open_existing(q, par))
;
else if (par->force_reset < 0)