From: Michael Jeanson Date: Fri, 18 Nov 2022 16:52:46 +0000 (-0500) Subject: Drop 'linux/file.h' wrapper X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=2a059b14c2cbbf828ebc2fc6db643cf81b51abed;p=lttng-modules.git Drop 'linux/file.h' wrapper Change-Id: I1f4e0630be4af0f8af98655c7771974f41d73517 Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- diff --git a/include/wrapper/file.h b/include/wrapper/file.h deleted file mode 100644 index 1ffaf2e7..00000000 --- a/include/wrapper/file.h +++ /dev/null @@ -1,38 +0,0 @@ -/* 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 - */ - -#ifndef _LTTNG_WRAPPER_FILE_H -#define _LTTNG_WRAPPER_FILE_H - -#include -#include - -#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 */ diff --git a/src/lib/ringbuffer/ring_buffer_iterator.c b/src/lib/ringbuffer/ring_buffer_iterator.c index 60c95ca6..b0af7df7 100644 --- a/src/lib/ringbuffer/ring_buffer_iterator.c +++ b/src/lib/ringbuffer/ring_buffer_iterator.c @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include #include @@ -743,7 +743,7 @@ ssize_t lib_ring_buffer_file_read(struct file *filp, 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; @@ -768,7 +768,7 @@ ssize_t channel_file_read(struct file *filp, 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; diff --git a/src/lttng-abi.c b/src/lttng-abi.c index 472541a2..caec803f 100644 --- a/src/lttng-abi.c +++ b/src/lttng-abi.c @@ -37,7 +37,6 @@ #include #include #include -#include #include #include #include @@ -99,7 +98,7 @@ int lttng_abi_create_session(void) 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; @@ -141,7 +140,7 @@ int lttng_abi_create_event_notifier_group(void) 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; @@ -174,7 +173,7 @@ int lttng_abi_tracepoint_list(void) 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; @@ -214,7 +213,7 @@ int lttng_abi_syscall_list(void) 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; @@ -497,7 +496,7 @@ 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; @@ -1603,7 +1602,7 @@ int lttng_abi_create_stream_fd(struct file *channel_file, void *stream_priv, 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; @@ -1868,7 +1867,7 @@ int lttng_abi_create_event(struct file *channel_file, 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; @@ -2102,7 +2101,7 @@ int lttng_abi_create_event_notifier(struct file *event_notifier_group_file, 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; @@ -2249,7 +2248,7 @@ long lttng_abi_event_notifier_group_create_error_counter( 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; diff --git a/src/lttng-events.c b/src/lttng-events.c index dab3a0e1..472440e1 100644 --- a/src/lttng-events.c +++ b/src/lttng-events.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -1769,7 +1768,7 @@ int lttng_session_list_tracker_ids(struct lttng_kernel_session *session, 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; diff --git a/src/lttng-statedump-impl.c b/src/lttng-statedump-impl.c index 4a465980..6cd97658 100644 --- a/src/lttng-statedump-impl.c +++ b/src/lttng-statedump-impl.c @@ -42,7 +42,6 @@ #include #include #include -#include #include #include @@ -510,7 +509,7 @@ void lttng_enumerate_task_vm_maps(struct lttng_kernel_session *session, 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); diff --git a/src/lttng-syscalls.c b/src/lttng-syscalls.c index 9cd11ea6..d93df2e1 100644 --- a/src/lttng-syscalls.c +++ b/src/lttng-syscalls.c @@ -25,7 +25,6 @@ #include #include -#include #include #include #include @@ -1297,7 +1296,7 @@ int lttng_abi_syscall_list(void) 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;