fd-tracker: restore suspended handles from their inode's path
In order to support session rotations and, to a lesser degree, the
"clear" command, the fd-tracker internals (lttng_inode and fs_handle)
need to recover from files being renamed while the handle to it is
suspended.
This refactor introduces a "location" to the lttng_inode which is
updated anytime an unlink or rename is performed on an fs_handle.
Keep in mind that multiple independent fs_handles can refer to the
same lttng_inode (a unique tuple of device id and inode number).
This location is used to restore the fs_handle whenever it is needed.
Moreover, since the session rotation/clear operations sometimes rely
on directories having been emptied after rename/unlink, the current
scheme of renaming unlinked files to the form
"filename-deleted-suffix" no longer works.
The renaming scheme is replaced by a new "unlinked file pool", which
is an hidden directory at the base of the output directory which
contains the files which were unlinked to which
references (fs_handles) are still being held. The API of the
fd-tracker itself had to be changed slightly and the tests are adapted
as a consequence. New tests targeting this new behaviour are also
added.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I9b1344da1966c85bdd6b51838507d3208e1d9a42
This page took 0.02726 seconds and 5 git commands to generate.