fd-tracker: refactor: extract fs_handle interface from fd_tracker
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 21 Jan 2020 00:44:07 +0000 (19:44 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 30 Jan 2020 06:55:34 +0000 (01:55 -0500)
commitf5ea02416c656bba136e742788f2d5ae12b98278
tree0d52b13233dd150cf4a74813f4c2ab7b1d9df585
parentb13a2b17db29cbc8808e8bb149de1692b94729d3
fd-tracker: refactor: extract fs_handle interface from fd_tracker

Make the fs_handle interface a proper abstract interface containing
overridable callbacks. The objective of this refactor is to make it
possible for lttng_trace_chunk to return fs_handles which are tracked
by an fd_tracker (or not) depending on the execution context (which
daemon).

In effect, the relay daemon will provide a trace chunk with an
fd_tracker to use and then rely on the fs_handle interface to track
the use of file descriptors.

The other daemons using the lttng_trace_chunk interface will use a
dummy implementation of fs_handle which basically directly returns the
underlying file descriptor and performs the unlink/close operations
directly.

This makes is possible to share code interacting with files between
the various daemons without carrying a plethora of optional parameters
in every util.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Iaafa0f4442442bdfdaf220ce33a966978877df23
src/common/Makefile.am
src/common/fd-tracker/fd-tracker.c
src/common/fs-handle-internal.h [new file with mode: 0644]
src/common/fs-handle.c [new file with mode: 0644]
src/common/fs-handle.h [new file with mode: 0644]
This page took 0.024977 seconds and 4 git commands to generate.