]> mj.ucw.cz Git - libucw.git/blobdiff - lib/qache.c
CPU_PAGE_SIZE ported from mainline.
[libucw.git] / lib / qache.c
index 3802c3f6a1372ed6e59075ffdd77c3e897d8f9d8..5a832bb76d19063fad33bc7c26a0a354b2b34ad9 100644 (file)
@@ -13,8 +13,8 @@
 
 #include <unistd.h>
 #include <fcntl.h>
+#include <sys/stat.h>
 #include <sys/mman.h>
-#include <sys/user.h>
 
 /*
  *  The cache lives in a mmapped file of the following format:
@@ -80,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_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