Fix: Add f_dentry wrapper for 3.19+ kernels
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sun, 28 Dec 2014 13:49:25 +0000 (08:49 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sun, 28 Dec 2014 13:53:20 +0000 (08:53 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
lib/ringbuffer/ring_buffer_iterator.c
lttng-statedump-impl.c
wrapper/file.h

index 290466f870110ba45b778266a4ccca9b7967407c..24e3dbb36a39882eeae8a53011f5ebd3303271ab 100644 (file)
@@ -26,6 +26,7 @@
  */
 
 #include "../../wrapper/ringbuffer/iterator.h"
+#include "../../wrapper/file.h"
 #include <linux/jiffies.h>
 #include <linux/delay.h>
 #include <linux/module.h>
@@ -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;
 
index e0d74f6f9e5b257a0636e0b9bebad94b962b7209..2c7fc17853b1b3310faeca057f83db0d8bdc6682 100644 (file)
@@ -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 <linux/irq.h>
@@ -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);
index 2440745c67240269ac432641b50517ebe821bfc0..37c8c9ba3518175afa53110ad303bcf2e8448728 100644 (file)
@@ -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 */
This page took 0.028321 seconds and 4 git commands to generate.