X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Fqache.c;h=5a832bb76d19063fad33bc7c26a0a354b2b34ad9;hb=9ff2d1d3d98e39cfe57e38519427a7754d73cb6c;hp=aa5844180464bb574ac818cf396bf72342fb0f8b;hpb=1b94016651511a3d626188893cf9e47e4103c3fc;p=libucw.git diff --git a/lib/qache.c b/lib/qache.c index aa584418..5a832bb7 100644 --- a/lib/qache.c +++ b/lib/qache.c @@ -11,11 +11,10 @@ #include "lib/fastbuf.h" #include "lib/qache.h" -#include #include #include +#include #include -#include /* * The cache lives in a mmapped file of the following format: @@ -81,9 +80,9 @@ qache_msync(struct qache *q UNUSED, uns start UNUSED, uns len UNUSED) { #ifndef CONFIG_LINUX /* We don't need msyncing on Linux, since the mappings are guaranteed to be coherent */ - 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 @@ -384,7 +383,7 @@ qache_open(struct qache_params *par) q->file_name = xstrdup(par->file_name); ASSERT(par->block_size >= 8 && !(par->block_size & (par->block_size-1))); - par->cache_size = ALIGN(par->cache_size, par->block_size); + par->cache_size = ALIGN_TO(par->cache_size, par->block_size); if (par->force_reset <= 0 && qache_open_existing(q, par)) ;