*/
#include <wrapper/fdtable.h>
+#include <linux/file.h>
#include <linux/list.h>
#include <linux/module.h>
#include <linux/namei.h>
#include <linux/slab.h>
#include <linux/uaccess.h>
+#include <linux/uprobes.h>
+
#include <lttng/events.h>
#include <lttng/events-internal.h>
#include <lttng/tracer.h>
#include <wrapper/irqflags.h>
#include <ringbuffer/frontend_types.h>
-#include <wrapper/uprobes.h>
#include <wrapper/vmalloc.h>
static
* Returns the file backing the given fd. Needs to be done inside an RCU
* critical section.
*/
- file = lttng_lookup_fd_rcu(fd);
+ file = lttng_lookup_fdget_rcu(fd);
if (file == NULL) {
printk(KERN_WARNING "LTTng: Cannot access file backing the fd(%d)\n", fd);
inode = NULL;
inode = igrab(file->f_path.dentry->d_inode);
if (inode == NULL)
printk(KERN_WARNING "LTTng: Cannot grab a reference on the inode.\n");
+
error:
rcu_read_unlock();
+ if (file)
+ fput(file);
return inode;
}
goto register_error;
}
- ret = wrapper_uprobe_register(uprobe->inode,
+ ret = uprobe_register(uprobe->inode,
uprobe_handler->offset, &uprobe_handler->up_consumer);
if (ret) {
printk(KERN_WARNING "LTTng: Error registering probe on inode %lu "
* and free the struct.
*/
list_for_each_entry_safe(iter, tmp, head, node) {
- wrapper_uprobe_unregister(inode, iter->offset, &iter->up_consumer);
+ uprobe_unregister(inode, iter->offset, &iter->up_consumer);
list_del(&iter->node);
kfree(iter);
}