actions: Expose lttng_action_type_string internally
[lttng-tools.git] / src / common / fd-tracker / inode.h
... / ...
CommitLineData
1/*
2 * Copyright (C) 2020 Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 */
7
8#ifndef FD_TRACKER_INODE_H
9#define FD_TRACKER_INODE_H
10
11#include <common/compat/directory-handle.h>
12#include <stdbool.h>
13
14struct lttng_inode;
15struct lttng_inode_registry;
16struct lttng_unlinked_file_directory;
17struct lttng_directory_handle;
18
19/*
20 * The unlinked file pool is protected by the fd-tracker's lock.
21 *
22 * NOTE: the unlinked file pool can use a single file desriptor when unlinked
23 * files are present in the pool. This file descriptor is not accounted-for
24 * by the fd-tracker. Users of the fd-tracker should account for this extra
25 * file descriptor.
26 */
27LTTNG_HIDDEN
28struct lttng_unlinked_file_pool *lttng_unlinked_file_pool_create(
29 const char *path);
30
31LTTNG_HIDDEN
32void lttng_unlinked_file_pool_destroy(
33 struct lttng_unlinked_file_pool *pool);
34
35/* The inode registry is protected by the fd-tracker's lock. */
36LTTNG_HIDDEN
37struct lttng_inode_registry *lttng_inode_registry_create(void);
38
39LTTNG_HIDDEN
40struct lttng_inode *lttng_inode_registry_get_inode(
41 struct lttng_inode_registry *registry,
42 struct lttng_directory_handle *handle,
43 const char *path,
44 int fd,
45 struct lttng_unlinked_file_pool *pool);
46
47LTTNG_HIDDEN
48void lttng_inode_registry_destroy(struct lttng_inode_registry *registry);
49
50LTTNG_HIDDEN
51void lttng_inode_borrow_location(struct lttng_inode *inode,
52 const struct lttng_directory_handle **out_directory_handle,
53 const char **out_path);
54
55/* Returns a new reference to the inode's location directory handle. */
56LTTNG_HIDDEN
57struct lttng_directory_handle *lttng_inode_get_location_directory_handle(
58 struct lttng_inode *inode);
59
60LTTNG_HIDDEN
61int lttng_inode_rename(struct lttng_inode *inode,
62 struct lttng_directory_handle *old_directory_handle,
63 const char *old_path,
64 struct lttng_directory_handle *new_directory_handle,
65 const char *new_path,
66 bool overwrite);
67
68LTTNG_HIDDEN
69int lttng_inode_unlink(struct lttng_inode *inode);
70
71LTTNG_HIDDEN
72void lttng_inode_put(struct lttng_inode *inode);
73
74#endif /* FD_TRACKER_INODE_H */
This page took 0.023168 seconds and 5 git commands to generate.