X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=src%2Fprobes%2Flttng-uprobes.c;h=edded1e960aee6a508020bb527b1912c62ce1c91;hb=c35f268c4169db55bd65c95472442cd4d00eb53f;hp=a3cef0bf101e26fe27c3416f5d823ff3be023254;hpb=4697aac7ad1bdb932a843d93076418f4048baad3;p=lttng-modules.git diff --git a/src/probes/lttng-uprobes.c b/src/probes/lttng-uprobes.c index a3cef0bf..edded1e9 100644 --- a/src/probes/lttng-uprobes.c +++ b/src/probes/lttng-uprobes.c @@ -10,17 +10,19 @@ */ #include +#include #include #include #include #include #include +#include + #include #include #include #include #include -#include #include static @@ -152,7 +154,7 @@ static struct inode *get_inode_from_fd(int fd) * 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; @@ -163,8 +165,11 @@ static struct inode *get_inode_from_fd(int fd) 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; } @@ -201,7 +206,7 @@ int lttng_uprobes_add_callsite(struct lttng_uprobe *uprobe, 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 " @@ -280,7 +285,7 @@ void lttng_uprobes_unregister(struct inode *inode, struct list_head *head) * 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); }