]> mj.ucw.cz Git - libucw.git/blobdiff - lib/partmap.c
Added a library module for distributing work between threads.
[libucw.git] / lib / partmap.c
index 49f12322492d60fc261260ebeec148aa28182e96..8dba8f8fcffe6ec891978d919db7430acf934cbd 100644 (file)
@@ -71,7 +71,7 @@ partmap_load(struct partmap *p, sh_off_t start, uns size)
   sh_off_t win_start = start/PAGE_SIZE * PAGE_SIZE;
   size_t win_len = PARTMAP_WINDOW;
   if ((sh_off_t) (win_start+win_len) > p->file_size)
-    win_len = ALIGN(p->file_size - win_start, PAGE_SIZE);
+    win_len = ALIGN_TO(p->file_size - win_start, PAGE_SIZE);
   if ((sh_off_t) (win_start+win_len) < end)
     die("partmap_map: Window is too small for mapping %d bytes", size);
   p->start_map = sh_mmap(NULL, win_len, p->writeable ? (PROT_READ | PROT_WRITE) : PROT_READ, MAP_SHARED, p->fd, win_start);