int fd;
char *name;
struct cds_lfht_node tracker_node;
+ struct rcu_head rcu_head;
};
static struct {
(void *) key);
}
+static
+void delete_unsuspendable_fd(struct rcu_head *head)
+{
+ struct unsuspendable_fd *fd = caa_container_of(head,
+ struct unsuspendable_fd, rcu_head);
+
+ free(fd->name);
+ free(fd);
+}
+
static
void unsuspendable_fd_destroy(struct unsuspendable_fd *entry)
{
if (!entry) {
return;
}
- free(entry->name);
- free(entry);
+ call_rcu(&entry->rcu_head, delete_unsuspendable_fd);
}
static
goto error_destroy;
}
- /*
- * Clear the create flag from the open flags as it would make no sense
- * to use it when restoring a fs handle.
- */
- properties.flags &= ~O_CREAT;
handle->properties = properties;
properties.path = NULL;
pthread_mutex_unlock(&handle->lock);
}
+int fs_handle_unlink(struct fs_handle *handle)
+{
+ int ret;
+
+ pthread_mutex_lock(&handle->tracker->lock);
+ pthread_mutex_lock(&handle->lock);
+ ret = lttng_inode_defer_unlink(handle->inode);
+ pthread_mutex_unlock(&handle->lock);
+ pthread_mutex_unlock(&handle->tracker->lock);
+ return ret;
+}
+
int fs_handle_close(struct fs_handle *handle)
{
int ret = 0;