+++ /dev/null
-/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
- *
- * wrapper/file.h
- *
- * wrapper around linux/file.h.
- *
- * Copyright (C) 2014 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
- */
-
-#ifndef _LTTNG_WRAPPER_FILE_H
-#define _LTTNG_WRAPPER_FILE_H
-
-#include <lttng/kernel-version.h>
-#include <linux/file.h>
-
-#if LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,19,0)
-
-static
-inline int lttng_get_unused_fd(void)
-{
- return get_unused_fd_flags(0);
-}
-
-#define lttng_f_dentry f_path.dentry
-
-#else /* #if LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,19,0) */
-
-static
-inline int lttng_get_unused_fd(void)
-{
- return get_unused_fd();
-}
-
-#define lttng_f_dentry f_dentry
-
-#endif /* #else #if LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,19,0) */
-
-#endif /* _LTTNG_WRAPPER_FILE_H */
#include <ringbuffer/iterator.h>
#include <wrapper/cpu.h>
-#include <wrapper/file.h>
+#include <linux/file.h>
#include <wrapper/uaccess.h>
#include <linux/jiffies.h>
#include <linux/delay.h>
size_t count,
loff_t *ppos)
{
- struct inode *inode = filp->lttng_f_dentry->d_inode;
+ struct inode *inode = filp->f_path.dentry->d_inode;
struct lttng_kernel_ring_buffer *buf = inode->i_private;
struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan;
size_t count,
loff_t *ppos)
{
- struct inode *inode = filp->lttng_f_dentry->d_inode;
+ struct inode *inode = filp->f_path.dentry->d_inode;
struct lttng_kernel_ring_buffer_channel *chan = inode->i_private;
const struct lttng_kernel_ring_buffer_config *config = &chan->backend.config;
#include <ringbuffer/frontend.h>
#include <wrapper/compiler_attributes.h>
#include <wrapper/poll.h>
-#include <wrapper/file.h>
#include <wrapper/kref.h>
#include <lttng/string-utils.h>
#include <lttng/abi.h>
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;
if (!event_notifier_group)
return -ENOMEM;
- event_notifier_group_fd = lttng_get_unused_fd();
+ event_notifier_group_fd = get_unused_fd_flags(0);
if (event_notifier_group_fd < 0) {
ret = event_notifier_group_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;
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;
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;
return -EINVAL;
}
- event_fd = lttng_get_unused_fd();
+ event_fd = get_unused_fd_flags(0);
if (event_fd < 0) {
ret = event_fd;
goto fd_error;
event_notifier_param->event.name[LTTNG_KERNEL_ABI_SYM_NAME_LEN - 1] = '\0';
- event_notifier_fd = lttng_get_unused_fd();
+ event_notifier_fd = get_unused_fd_flags(0);
if (event_notifier_fd < 0) {
ret = event_notifier_fd;
goto fd_error;
goto fd_error;
}
- counter_fd = lttng_get_unused_fd();
+ counter_fd = get_unused_fd_flags(0);
if (counter_fd < 0) {
ret = counter_fd;
goto fd_error;
#include <linux/seq_file.h>
#include <linux/file.h>
#include <linux/anon_inodes.h>
-#include <wrapper/file.h>
#include <linux/uaccess.h>
#include <linux/vmalloc.h>
#include <linux/dmi.h>
struct seq_file *m;
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;
#include <wrapper/irq.h>
#include <wrapper/tracepoint.h>
#include <wrapper/blkdev.h>
-#include <wrapper/file.h>
#include <wrapper/fdtable.h>
#include <wrapper/sched.h>
down_read(&mm->mmap_sem);
while (map) {
if (map->vm_file)
- ino = map->vm_file->lttng_f_dentry->d_inode->i_ino;
+ ino = map->vm_file->f_path.dentry->d_inode->i_ino;
else
ino = 0;
trace_lttng_statedump_vm_map(session, p, map, ino);
#include <lttng/bitfield.h>
#include <wrapper/tracepoint.h>
-#include <wrapper/file.h>
#include <wrapper/rcu.h>
#include <wrapper/syscall.h>
#include <wrapper/limits.h>
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;