X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcommon%2Ffd-tracker%2Finode.c;h=727f6141aba4d78de12bf77ec3f688ef6c8bf92f;hb=dd95933f8371a8c81ffc1dc5b306f2263f1ff808;hp=28825b106c6f2c69051e4de96e5cac26e8af7652;hpb=f7c3ffd79ddcece895eb0de616001d549aced5fc;p=lttng-tools.git diff --git a/src/common/fd-tracker/inode.c b/src/common/fd-tracker/inode.c index 28825b106..727f6141a 100644 --- a/src/common/fd-tracker/inode.c +++ b/src/common/fd-tracker/inode.c @@ -1,18 +1,8 @@ /* - * Copyright (C) 2020 - 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 - * published by the Free Software Foundation. + * SPDX-License-Identifier: GPL-2.0-only * - * 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. */ #include @@ -290,7 +280,19 @@ void lttng_inode_put(struct lttng_inode *inode) urcu_ref_put(&inode->ref, lttng_inode_release); } -void lttng_inode_get_location(struct lttng_inode *inode, +struct lttng_directory_handle *lttng_inode_get_location_directory_handle( + struct lttng_inode *inode) +{ + if (inode->location.directory_handle) { + const bool reference_acquired = lttng_directory_handle_get( + inode->location.directory_handle); + + assert(reference_acquired); + } + return inode->location.directory_handle; +} + +void lttng_inode_borrow_location(struct lttng_inode *inode, const struct lttng_directory_handle **out_directory_handle, const char **out_path) {