X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Ffd-tracker%2Finode.h;h=d3c0ed2bf2239ecb889e5cd186c9bd71c01e72d2;hp=41e947011f2a0c189658ebf8da106c4facde718a;hb=f7c3ffd79ddcece895eb0de616001d549aced5fc;hpb=9a1a997f2f22b556f63437d911b98c7b522b38e4 diff --git a/src/common/fd-tracker/inode.h b/src/common/fd-tracker/inode.h index 41e947011..d3c0ed2bf 100644 --- a/src/common/fd-tracker/inode.h +++ b/src/common/fd-tracker/inode.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 - Jérémie Galarneau + * Copyright (C) 2020 - Jérémie Galarneau * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License, version 2 only, as @@ -18,26 +18,52 @@ #ifndef FD_TRACKER_INODE_H #define FD_TRACKER_INODE_H +#include #include struct lttng_inode; struct lttng_inode_registry; +struct lttng_unlinked_file_directory; + +/* + * The unlinked file pool is protected by the fd-tracker's lock. + * + * NOTE: the unlinked file pool can use a single file desriptor when unlinked + * files are present in the pool. This file descriptor is not accounted-for + * by the fd-tracker. Users of the fd-tracker should account for this extra + * file descriptor. + */ +struct lttng_unlinked_file_pool *lttng_unlinked_file_pool_create( + const char *path); + +void lttng_unlinked_file_pool_destroy( + struct lttng_unlinked_file_pool *pool); /* The inode registry is protected by the fd-tracker's lock. */ struct lttng_inode_registry *lttng_inode_registry_create(void); struct lttng_inode *lttng_inode_registry_get_inode( struct lttng_inode_registry *registry, + struct lttng_directory_handle *handle, + const char *path, int fd, - const char *path); + struct lttng_unlinked_file_pool *pool); void lttng_inode_registry_destroy(struct lttng_inode_registry *registry); -const char *lttng_inode_get_path(const struct lttng_inode *inode); +void lttng_inode_get_location(struct lttng_inode *inode, + const struct lttng_directory_handle **out_directory_handle, + const char **out_path); + int lttng_inode_rename(struct lttng_inode *inode, + struct lttng_directory_handle *old_directory_handle, + const char *old_path, + struct lttng_directory_handle *new_directory_handle, const char *new_path, bool overwrite); -int lttng_inode_defer_unlink(struct lttng_inode *inode); + +int lttng_inode_unlink(struct lttng_inode *inode); + void lttng_inode_put(struct lttng_inode *inode); #endif /* FD_TRACKER_INODE_H */