From: Robert Spalek Date: Mon, 3 Nov 2003 17:13:06 +0000 (+0000) Subject: page_size -> PAGE_SIZE X-Git-Tag: holmes-import~1169 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=0c9206b091c4f8101f6687c1a53ca3618d2acfcd;p=libucw.git page_size -> PAGE_SIZE --- diff --git a/lib/partmap.c b/lib/partmap.c index 756fdb63..d3892ff5 100644 --- a/lib/partmap.c +++ b/lib/partmap.c @@ -17,6 +17,7 @@ #include #include #include +#include struct partmap { int fd; @@ -32,14 +33,9 @@ struct partmap { #define PARTMAP_WINDOW 16777216 #endif -static uns page_size; - struct partmap * partmap_open(byte *name, int writeable) { - if (!page_size) - page_size = getpagesize(); - struct partmap *p = xmalloc_zero(sizeof(struct partmap)); p->fd = sh_open(name, writeable ? O_RDWR : O_RDONLY); @@ -76,7 +72,7 @@ partmap_map(struct partmap *p, sh_off_t start, uns size) uns win = PARTMAP_WINDOW; ASSERT(win >= size); sh_off_t end = start + size; - start = start/page_size * page_size; + start = start/PAGE_SIZE * PAGE_SIZE; if (start+win > p->file_size) win = p->file_size - start; if (start+win < end)