#include <linux/uaccess.h>
#include <linux/slab.h>
#include <linux/err.h>
-#include <wrapper/ringbuffer/vfs.h>
-#include <wrapper/ringbuffer/backend.h>
-#include <wrapper/ringbuffer/frontend.h>
-#include <wrapper/poll.h>
-#include <wrapper/file.h>
-#include <wrapper/kref.h>
-#include <lttng-string-utils.h>
-#include <lttng-abi.h>
-#include <lttng-abi-old.h>
-#include <lttng-events.h>
-#include <lttng-tracer.h>
-#include <lttng-tp-mempool.h>
-#include <lib/ringbuffer/frontend_types.h>
+#include <linux/kref.h>
+#include <ringbuffer/vfs.h>
+#include <ringbuffer/backend.h>
+#include <ringbuffer/frontend.h>
+#include <lttng/lttng-string-utils.h>
+#include <lttng/lttng-abi.h>
+#include <lttng/lttng-abi-old.h>
+#include <lttng/lttng-events.h>
+#include <lttng/lttng-tracer.h>
+#include <lttng/lttng-tp-mempool.h>
+#include <ringbuffer/frontend_types.h>
/*
* This is LTTng's own personal way to create a system call as an external
static struct proc_dir_entry *lttng_proc_dentry;
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0))
static const struct proc_ops lttng_proc_ops;
-#else
-static const struct file_operations lttng_proc_ops;
-#endif
static const struct file_operations lttng_session_fops;
static const struct file_operations lttng_channel_fops;
session = lttng_session_create();
if (!session)
return -ENOMEM;
- session_fd = lttng_get_unused_fd();
+ session_fd = get_unused_fd_flags(0);
if (session_fd < 0) {
ret = session_fd;
goto fd_error;
struct file *tracepoint_list_file;
int file_fd, ret;
- file_fd = lttng_get_unused_fd();
+ file_fd = get_unused_fd_flags(0);
if (file_fd < 0) {
ret = file_fd;
goto fd_error;
struct file *syscall_list_file;
int file_fd, ret;
- file_fd = lttng_get_unused_fd();
+ file_fd = get_unused_fd_flags(0);
if (file_fd < 0) {
ret = file_fd;
goto fd_error;
}
}
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0))
static const struct proc_ops lttng_proc_ops = {
.proc_ioctl = lttng_ioctl,
#ifdef CONFIG_COMPAT
.proc_compat_ioctl = lttng_ioctl,
#endif /* CONFIG_COMPAT */
};
-#else
-static const struct file_operations lttng_proc_ops = {
- .owner = THIS_MODULE,
- .unlocked_ioctl = lttng_ioctl,
-#ifdef CONFIG_COMPAT
- .compat_ioctl = lttng_ioctl,
-#endif /* CONFIG_COMPAT */
-};
-#endif
static
int lttng_abi_create_channel(struct file *session_file,
int chan_fd;
int ret = 0;
- chan_fd = lttng_get_unused_fd();
+ chan_fd = get_unused_fd_flags(0);
if (chan_fd < 0) {
ret = chan_fd;
goto fd_error;
unsigned int mask = 0;
if (filp->f_mode & FMODE_READ) {
- poll_wait_set_exclusive(wait);
poll_wait(filp, &stream->read_wait, wait);
finalized = stream->finalized;
int stream_fd, ret;
struct file *stream_file;
- stream_fd = lttng_get_unused_fd();
+ stream_fd = get_unused_fd_flags(0);
if (stream_fd < 0) {
ret = stream_fd;
goto fd_error;
goto notransport;
}
- if (!lttng_kref_get(&session->metadata_cache->refcount)) {
- ret = -EOVERFLOW;
- goto kref_error;
- }
-
+ kref_get(&session->metadata_cache->refcount);
ret = lttng_abi_create_stream_fd(channel_file, stream_priv,
<tng_metadata_ring_buffer_file_operations);
if (ret < 0)
fd_error:
kref_put(&session->metadata_cache->refcount, metadata_cache_destroy);
-kref_error:
module_put(metadata_stream->transport->owner);
notransport:
kfree(metadata_stream);
default:
break;
}
- event_fd = lttng_get_unused_fd();
+ event_fd = get_unused_fd_flags(0);
if (event_fd < 0) {
ret = event_fd;
goto fd_error;
unsigned int mask = 0;
if (file->f_mode & FMODE_READ) {
- poll_wait_set_exclusive(wait);
poll_wait(file, channel->ops->get_hp_wait_queue(channel->chan),
wait);