diff options
author | cee1 <fykcee1@gmail.com> | 2011-03-18 10:03:41 +0800 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2011-03-28 21:42:31 +0200 |
commit | 37f85e66e8f396b6f758e063531b95531aef628e (patch) | |
tree | 4c914f49c19d6712b76fc1be5f58929a2aa9d5bc /src/readahead-collect.c | |
parent | f9276855a1d270b6c3f857cdaf2c4b49920c2228 (diff) |
util: detect page size runtime.
Some architectures support multiple machine types with diffenent
page sizes, and some machine types even support multiple
page sizes themselves.
Diffstat (limited to 'src/readahead-collect.c')
-rw-r--r-- | src/readahead-collect.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/readahead-collect.c b/src/readahead-collect.c index ca8227135e..693729598e 100644 --- a/src/readahead-collect.c +++ b/src/readahead-collect.c @@ -119,9 +119,10 @@ static int pack_file(FILE *pack, const char *fn, bool on_btrfs) { goto finish; } - pages = l / PAGE_SIZE; + pages = l / page_size(); vec = alloca(pages); + memset(vec, 0, pages); if (mincore(start, l, vec) < 0) { log_warning("mincore(%s) failed: %m", fn); r = -errno; |