X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fqache.c;h=3c4be273ab1c1bd0b24d100cc4439781da75a61c;hb=bd1f0b7994687ae6f327033b770713ad2085aeab;hp=050f1c9a304d3eb6409afc0d83a75981b541214e;hpb=59e023bb0dc1868bb2b58d1a648e2c9d9dbb4c0e;p=libucw.git diff --git a/lib/qache.c b/lib/qache.c index 050f1c9a..3c4be273 100644 --- a/lib/qache.c +++ b/lib/qache.c @@ -13,6 +13,7 @@ #include #include +#include #include #include @@ -82,7 +83,7 @@ qache_msync(struct qache *q UNUSED, uns start UNUSED, uns len UNUSED) /* 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 = ALIGN_TO(len, 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 @@ -383,7 +384,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)) ;