This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] [PATCH 2.6.37-rc5-tip 4/20] 4: uprobes: Adding and remove a uprobe in a rb tree.


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;
> +} 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]