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)
committerSimon Marchi <simon.marchi@efficios.com>
Fri, 15 Nov 2019 18:08:12 +0000 (13:08 -0500)
commit127e2341231d859921e076a37a70166e85e59596
tree69975686277c0cdf99c0c768bf5b31a02bdd3956
parent3073da6664aa036a96fa3e78d35d53c76a23448b
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.024009 seconds and 4 git commands to generate.