From: Mathieu Desnoyers Date: Sun, 28 Dec 2014 13:49:25 +0000 (-0500) Subject: Fix: Add f_dentry wrapper for 3.19+ kernels X-Git-Tag: v2.6.0~7 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=b1d7664607a672ce9b8aab6d0e4c1ce282d80571;p=lttng-modules.git Fix: Add f_dentry wrapper for 3.19+ kernels Signed-off-by: Mathieu Desnoyers --- diff --git a/lib/ringbuffer/ring_buffer_iterator.c b/lib/ringbuffer/ring_buffer_iterator.c index 290466f8..24e3dbb3 100644 --- a/lib/ringbuffer/ring_buffer_iterator.c +++ b/lib/ringbuffer/ring_buffer_iterator.c @@ -26,6 +26,7 @@ */ #include "../../wrapper/ringbuffer/iterator.h" +#include "../../wrapper/file.h" #include #include #include @@ -691,7 +692,7 @@ ssize_t lib_ring_buffer_file_read(struct file *filp, size_t count, loff_t *ppos) { - struct inode *inode = filp->f_dentry->d_inode; + struct inode *inode = filp->lttng_f_dentry->d_inode; struct lib_ring_buffer *buf = inode->i_private; struct channel *chan = buf->backend.chan; @@ -716,7 +717,7 @@ ssize_t channel_file_read(struct file *filp, size_t count, loff_t *ppos) { - struct inode *inode = filp->f_dentry->d_inode; + struct inode *inode = filp->lttng_f_dentry->d_inode; struct channel *chan = inode->i_private; const struct lib_ring_buffer_config *config = &chan->backend.config; diff --git a/lttng-statedump-impl.c b/lttng-statedump-impl.c index e0d74f6f..2c7fc178 100644 --- a/lttng-statedump-impl.c +++ b/lttng-statedump-impl.c @@ -56,6 +56,7 @@ #include "wrapper/irq.h" #include "wrapper/tracepoint.h" #include "wrapper/genhd.h" +#include "wrapper/file.h" #ifdef CONFIG_LTTNG_HAS_LIST_IRQ #include @@ -327,7 +328,7 @@ void lttng_enumerate_task_vm_maps(struct lttng_session *session, down_read(&mm->mmap_sem); while (map) { if (map->vm_file) - ino = map->vm_file->f_dentry->d_inode->i_ino; + ino = map->vm_file->lttng_f_dentry->d_inode->i_ino; else ino = 0; trace_lttng_statedump_vm_map(session, p, map, ino); diff --git a/wrapper/file.h b/wrapper/file.h index 2440745c..37c8c9ba 100644 --- a/wrapper/file.h +++ b/wrapper/file.h @@ -34,6 +34,8 @@ inline int lttng_get_unused_fd(void) return get_unused_fd_flags(0); } +#define lttng_f_dentry f_path.dentry + #else /* #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) */ static @@ -42,6 +44,8 @@ inline int lttng_get_unused_fd(void) return get_unused_fd(); } +#define lttng_f_dentry f_dentry + #endif /* #else #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) */ #endif /* _LTTNG_WRAPPER_FILE_H */