ctf: remove ctf_fs_ds_file::msg_iter field
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 4 Nov 2019 20:17:10 +0000 (15:17 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Fri, 15 Nov 2019 18:08:11 +0000 (13:08 -0500)
commit6d54260a276ca4284cafe05d45e84f6d6cc7bce4
tree2c1487a6328a3394e1b34664e02c1375dca3c787
parent1505f33a1a42c691890dff61aea9762b43d1bca2
ctf: remove ctf_fs_ds_file::msg_iter field

I find it strange that ctf_fs_ds_file objects knows about the
ctf_msg_iter that iterates on it.  The ctf_fs_ds_file object just
represents some data that is accessible (a data stream file and the
portion currently mmap-ed), but I don't think it should know anything
about the iterating operation.

This patch removes the msg_iter field of ctf_fs_ds_file and adjusts the
code accordingly.

I think this change makes the code a bit clearer when we create
ctf_msg_iter objects.  Currently, we create the msg_iter first with a
NULL medium ops data, then create the ctf_fs_ds_file.  In
ctf_fs_ds_file_create, it sets the ctf_msg_iter's medium ops data to the
ctf_fs_ds_file.

With this patch, we create the ctf_fs_ds_file first.  Then, when we
create the ctf_msg_iter, we can pass the ctf_fs_ds_file as the medium
ops data directly when we create the ctf_msg_iter.

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