X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Ffd-tracker%2Finode.h;fp=src%2Fcommon%2Ffd-tracker%2Finode.h;h=6c2406dc61a91f744284cec3edc9ed1170325fc1;hb=e0e72660f16b5cba852b9dc2dddd4ecaf96c42f1;hp=0000000000000000000000000000000000000000;hpb=9d16fc7fa401926b800c18124756d75b11b5b806;p=lttng-tools.git diff --git a/src/common/fd-tracker/inode.h b/src/common/fd-tracker/inode.h new file mode 100644 index 000000000..6c2406dc6 --- /dev/null +++ b/src/common/fd-tracker/inode.h @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2018 - 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 + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 51 + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef FD_TRACKER_INODE_H +#define FD_TRACKER_INODE_H + +#include + +struct lttng_inode; +struct lttng_inode_registry; + +/* 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, int fd, + const char *path); + +void lttng_inode_registry_destroy(struct lttng_inode_registry *registry); + +const char *lttng_inode_get_path(const struct lttng_inode *inode); +int lttng_inode_rename(struct lttng_inode *inode, const char *new_path, + bool overwrite); +int lttng_inode_defer_unlink(struct lttng_inode *inode); +void lttng_inode_put(struct lttng_inode *inode); + +#endif /* FD_TRACKER_INODE_H */