src.ctf.fs: factor out "ds_file_mmap" from "ds_file_mmap_next"
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 5 Nov 2019 22:05:50 +0000 (17:05 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 15 Nov 2019 21:10:12 +0000 (16:10 -0500)
commit0eb6c8ee24289cd8ea395911e5f0fd265fe1a43f
tree558cb04eccff180e7904db1308f33bfb24d01dd6
parentb3f4f37913a4a1a0a9ded34147bff18cccec4f55
src.ctf.fs: factor out "ds_file_mmap" from "ds_file_mmap_next"

Currently, the logic to mmap a region of a ds_file is contained in
ds_file_mmap_next.  ds_file_mmap_next is also responsible for mapping
the region immediately following the currently mapped region, if there
is a currently mapped region.

I find this double responsibility a bit confusing, especially where
ds_file_mmap_next is used in medop_seek.

This patch extracts a portion of ds_file_mmap_next to a new function
ds_file_mmap, whose job is to ensure a file offset is mapped, and to do
the needful if it isn't.

Change-Id: Ia19725d28cf9c24084a52d16c7a88f30b32ff694
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
src/plugins/ctf/fs-src/data-stream-file.c
This page took 0.024117 seconds and 4 git commands to generate.