]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/journal/journal-file.c
journal: return mapped size from mmap_cache_get()
authorVito Caputo <vcaputo@pengaru.com>
Thu, 13 Jul 2017 05:08:58 +0000 (22:08 -0700)
committerVito Caputo <vcaputo@pengaru.com>
Thu, 13 Jul 2017 06:58:48 +0000 (23:58 -0700)
commitb42549ad69ab51789d5b8fa9f1dfc6c2fe45f43e
tree2bbdbdb5dc96b1d370ae1f33201ceb2b12c5d84e
parentc1edab7ad1e7ccc9be693bedfd464cd1cbffb395
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.
src/journal/journal-file.c
src/journal/journal-verify.c
src/journal/mmap-cache.c
src/journal/mmap-cache.h
src/journal/test-mmap-cache.c