summaryrefslogtreecommitdiff
path: root/src/journal/mmap-cache.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-08-15 01:54:09 +0200
committerLennart Poettering <lennart@poettering.net>2012-08-16 17:10:57 +0200
commitbeec00856158b703f2125a3d936080346a8a8de1 (patch)
treefc99e938ce1cffa3ef3152e0d9ff35c9e035ca34 /src/journal/mmap-cache.c
parent07cacf5f3b80fa0dfa5dd12531881118aa3b09ca (diff)
journal: implement basic journal file verification logic
Diffstat (limited to 'src/journal/mmap-cache.c')
-rw-r--r--src/journal/mmap-cache.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/journal/mmap-cache.c b/src/journal/mmap-cache.c
index 68dbe7015b..77710ff9bf 100644
--- a/src/journal/mmap-cache.c
+++ b/src/journal/mmap-cache.c
@@ -232,7 +232,6 @@ MMapCache* mmap_cache_new(unsigned contexts_max, unsigned fds_max) {
mmap_cache_free(m);
return NULL;
}
-
memset(m->by_context, -1, m->contexts_max * sizeof(unsigned));
m->by_fd = new(FileDescriptor, m->fds_max);
@@ -334,7 +333,7 @@ static int mmap_cache_put(
if (wsize < WINDOW_SIZE) {
uint64_t delta;
- delta = (WINDOW_SIZE - wsize) / 2;
+ delta = PAGE_ALIGN((WINDOW_SIZE - wsize) / 2);
if (delta > offset)
woffset = 0;