summaryrefslogtreecommitdiff
path: root/src/journal/journal-verify.c
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2017-07-12 22:08:58 -0700
committerVito Caputo <vcaputo@pengaru.com>2017-07-12 23:58:48 -0700
commitb42549ad69ab51789d5b8fa9f1dfc6c2fe45f43e (patch)
tree2bbdbdb5dc96b1d370ae1f33201ceb2b12c5d84e /src/journal/journal-verify.c
parentc1edab7ad1e7ccc9be693bedfd464cd1cbffb395 (diff)
downloadsystemd-b42549ad69ab51789d5b8fa9f1dfc6c2fe45f43e.tar.gz
journal: return mapped size from mmap_cache_get()
If requested, return the actual mapping size to the caller in addition to the address. journal_file_move_to_object() often performs two successive mmap_cache_get() calls via journal_file_move_to(); one to get the object header, then another to get the entire object when it's larger than the header's size. If mmap_cache_get() returned the actual mapping's size, it's probable that the second mmap_cache_get() could be skipped when the established mapping already encompassed the desired size.
Diffstat (limited to 'src/journal/journal-verify.c')
-rw-r--r--src/journal/journal-verify.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/journal/journal-verify.c b/src/journal/journal-verify.c
index 9feb5b5ae6..3f4c38ccde 100644
--- a/src/journal/journal-verify.c
+++ b/src/journal/journal-verify.c
@@ -392,7 +392,7 @@ static int contains_uint64(MMapCache *m, MMapFileDescriptor *f, uint64_t n, uint
c = (a + b) / 2;
- r = mmap_cache_get(m, f, PROT_READ|PROT_WRITE, 0, false, c * sizeof(uint64_t), sizeof(uint64_t), NULL, (void **) &z);
+ r = mmap_cache_get(m, f, PROT_READ|PROT_WRITE, 0, false, c * sizeof(uint64_t), sizeof(uint64_t), NULL, (void **) &z, NULL);
if (r < 0)
return r;