-/* SPDX-License-Identifier: (GPL-2.0 or LGPL-2.1)
+/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
*
* lttng-abi.c
*
#include <linux/uaccess.h>
#include <linux/slab.h>
#include <linux/err.h>
-#include <wrapper/vmalloc.h> /* for wrapper_vmalloc_sync_all() */
+#include <linux/kref.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>
*/
static struct proc_dir_entry *lttng_proc_dentry;
-static const struct file_operations lttng_fops;
+
+#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;
static const struct file_operations lttng_metadata_fops;
}
}
-static const struct file_operations lttng_fops = {
+#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
+#endif /* CONFIG_COMPAT */
};
+#endif
static
int lttng_abi_create_channel(struct file *session_file,
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);
event_param->u.kprobe.symbol_name[LTTNG_KERNEL_SYM_NAME_LEN - 1] = '\0';
break;
case LTTNG_KERNEL_FUNCTION:
- event_param->u.ftrace.symbol_name[LTTNG_KERNEL_SYM_NAME_LEN - 1] = '\0';
+ WARN_ON_ONCE(1);
+ /* Not implemented. */
break;
default:
break;
sizeof(uevent_param->u.kretprobe.symbol_name));
break;
case LTTNG_KERNEL_FUNCTION:
- memcpy(uevent_param->u.ftrace.symbol_name,
- old_uevent_param->u.ftrace.symbol_name,
- sizeof(uevent_param->u.ftrace.symbol_name));
+ WARN_ON_ONCE(1);
+ /* Not implemented. */
break;
default:
break;
{
int ret = 0;
- wrapper_vmalloc_sync_all();
lttng_clock_ref();
ret = lttng_tp_mempool_init();
}
lttng_proc_dentry = proc_create_data("lttng", S_IRUSR | S_IWUSR, NULL,
- <tng_fops, NULL);
+ <tng_proc_ops, NULL);
if (!lttng_proc_dentry) {
printk(KERN_ERR "Error creating LTTng control file\n");