lkml.org 
[lkml]   [2011]   [Jan]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC] [PATCH 2.6.37-rc5-tip 4/20] 4: uprobes: Adding and remove a uprobe in a rb tree.
From
Date
On Thu, 2010-12-16 at 15:28 +0530, Srikar Dronamraju wrote:
> +/* Acquires uprobes_mutex */

Requires? afaict uprobes_mutex isn't actually used anywhere in this
patch.

Its use is added in the next patch.

> +static struct uprobe *uprobes_add(struct inode *inode,
> + unsigned long offset)
> +{
> + struct uprobe *uprobe, *cur_uprobe;
> +
> + __iget(inode);
> + uprobe = kzalloc(sizeof(struct uprobe), GFP_KERNEL);
> +
> + if (!uprobe) {
> + iput(inode);
> + return NULL;
> + }
> + uprobe->inode = inode;
> + uprobe->offset = offset;
> +
> + /* add to uprobes_tree, sorted on inode:offset */
> + cur_uprobe = insert_uprobe_rb_node(uprobe);
> +
> + /* a uprobe exists for this inode:offset combination*/
> + if (cur_uprobe) {
> + kfree(uprobe);
> + uprobe = cur_uprobe;
> + iput(inode);
> + } else
> + init_rwsem(&uprobe->consumer_rwsem);
> +
> + return uprobe;
> +}


\
 
 \ /
  Last update: 2011-01-25 13:19    [W:0.146 / U:10.120 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site