X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Ffd-tracker%2Ffd-tracker.c;h=a9921fa847eff9d6c361b772ad34b224ac13e932;hb=3afa94aeca5a0daae40fd7b6cc96b7e4c150c7d8;hp=6c84348755b35d2d7a9608073ab0957684e36d76;hpb=938bd42282f0ba31bf22ad23b0bd3e04e848e052;p=lttng-tools.git diff --git a/src/common/fd-tracker/fd-tracker.c b/src/common/fd-tracker/fd-tracker.c index 6c8434875..a9921fa84 100644 --- a/src/common/fd-tracker/fd-tracker.c +++ b/src/common/fd-tracker/fd-tracker.c @@ -232,7 +232,7 @@ static int fs_handle_tracked_suspend(struct fs_handle_tracked *handle) pthread_mutex_lock(&handle->lock); lttng_inode_borrow_location( handle->inode, &node_directory_handle, &path); - assert(handle->fd >= 0); + LTTNG_ASSERT(handle->fd >= 0); if (handle->in_use) { /* This handle can't be suspended as it is currently in use. */ ret = -EAGAIN; @@ -292,8 +292,8 @@ static int fs_handle_tracked_restore(struct fs_handle_tracked *handle) lttng_inode_borrow_location( handle->inode, &node_directory_handle, &path); - assert(handle->fd == -1); - assert(path); + LTTNG_ASSERT(handle->fd == -1); + LTTNG_ASSERT(path); ret = open_from_properties( node_directory_handle, path, &handle->properties); if (ret < 0) { @@ -360,7 +360,6 @@ end: return ret; } -LTTNG_HIDDEN struct fd_tracker *fd_tracker_create(const char *unlinked_file_path, unsigned int capacity) { @@ -406,7 +405,6 @@ error: return NULL; } -LTTNG_HIDDEN void fd_tracker_log(struct fd_tracker *tracker) { struct fs_handle_tracked *handle; @@ -455,7 +453,6 @@ void fd_tracker_log(struct fd_tracker *tracker) pthread_mutex_unlock(&tracker->lock); } -LTTNG_HIDDEN int fd_tracker_destroy(struct fd_tracker *tracker) { int ret = 0; @@ -480,7 +477,7 @@ int fd_tracker_destroy(struct fd_tracker *tracker) if (tracker->unsuspendable_fds) { ret = cds_lfht_destroy(tracker->unsuspendable_fds, NULL); - assert(!ret); + LTTNG_ASSERT(!ret); } lttng_inode_registry_destroy(tracker->inode_registry); @@ -491,7 +488,6 @@ end: return ret; } -LTTNG_HIDDEN struct fs_handle *fd_tracker_open_fs_handle(struct fd_tracker *tracker, struct lttng_directory_handle *directory, const char *path, @@ -609,7 +605,6 @@ static int fd_tracker_suspend_handles( return left_to_close ? -EMFILE : 0; } -LTTNG_HIDDEN int fd_tracker_open_unsuspendable_fd(struct fd_tracker *tracker, int *out_fds, const char **names, @@ -642,7 +637,7 @@ int fd_tracker_open_unsuspendable_fd(struct fd_tracker *tracker, } else { /* * There are not enough active suspendable file - * descriptors to open a new fd and still accomodate the + * descriptors to open a new fd and still accommodates the * tracker's capacity. */ WARN("Cannot open unsuspendable fd, too many unsuspendable file descriptors are opened (%u)", @@ -707,7 +702,6 @@ end_free_entries: goto end_unlock; } -LTTNG_HIDDEN int fd_tracker_close_unsuspendable_fd(struct fd_tracker *tracker, int *fds_in, unsigned int fd_count, @@ -840,7 +834,7 @@ static int fs_handle_tracked_get_fd(struct fs_handle *_handle) */ pthread_mutex_lock(&handle->tracker->lock); pthread_mutex_lock(&handle->lock); - assert(!handle->in_use); + LTTNG_ASSERT(!handle->in_use); handle->tracker->stats.uses++; if (handle->fd >= 0) { @@ -934,7 +928,7 @@ static int fs_handle_tracked_close(struct fs_handle *_handle) * isn't much the user can do about it. */ if (close(handle->fd)) { - PERROR("Failed to close the file descritptor (%d) of fs handle to %s, close() returned", + PERROR("Failed to close the file descriptor (%d) of fs handle to %s, close() returned", handle->fd, path ? path : "Unknown"); } handle->fd = -1;