X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Fqache.c;h=eeea2b6b01d7ad121cef2ebbdfbe5317e87c6f38;hb=f635f4d406f772b54455331cdf23cc10a361392a;hp=3c4be273ab1c1bd0b24d100cc4439781da75a61c;hpb=746d103cd9a52a9c564af6a46151567d6a2a81a9;p=libucw.git diff --git a/lib/qache.c b/lib/qache.c index 3c4be273..eeea2b6b 100644 --- a/lib/qache.c +++ b/lib/qache.c @@ -9,13 +9,14 @@ #include "lib/lib.h" #include "lib/bitops.h" #include "lib/fastbuf.h" +#include "lib/ff-binary.h" #include "lib/qache.h" +#include #include #include #include #include -#include /* * The cache lives in a mmapped file of the following format: @@ -81,9 +82,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_TO(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