Make lttng_directory_handle reference countable
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 29 Nov 2019 20:42:24 +0000 (15:42 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 13 Dec 2019 00:44:54 +0000 (19:44 -0500)
commitcbf53d23cecaca9c6ec71582663c4a8254a9f285
treecefeff6bf482bd7d8bc4f67f83b20d30ebff7c24
parent5c1f54d1d586f61a92704753411bd82c5c928218
Make lttng_directory_handle reference countable

Currently, the lttng_directory_handle API assumes that the caller has
exclusive ownership of the lttng_directory_handle. Directory handles
are passed by reference and populated by an "init" method and
finalized using the "fini" method.

In order to allow multiple references to a path or directory file
descriptor in follow-up patches, the API is moved to a model where
directory handles are dynamically allocated and released using the
"put" method.

No change in behaviour is intended by this change beyond adapting the
API.

The objective of the change is to make it easier to implement copy
operations of trace chunks that are configured to use an fd-tracker
and reduce the number of open file descriptors when
lttng_directory_handles are copied.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Ibc8e97ea9e949adafef44533c30b61e3a9fa1f7d
15 files changed:
src/bin/lttng-relayd/main.c
src/bin/lttng-relayd/session.c
src/bin/lttng-relayd/session.h
src/bin/lttng-sessiond/consumer.c
src/bin/lttng-sessiond/session.c
src/common/compat/directory-handle.c
src/common/compat/directory-handle.h
src/common/consumer/consumer.c
src/common/kernel-consumer/kernel-consumer.c
src/common/runas.c
src/common/trace-chunk.c
src/common/trace-chunk.h
src/common/ust-consumer/ust-consumer.c
src/common/utils.c
tests/unit/test_directory_handle.c
This page took 0.026739 seconds and 4 git commands to generate.