Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1739196
| From | Gargi Sharma <gs051095@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 2/4] idr: Add a function idr_get() |
| Date | 2017-09-25 19:50 +0200 |
| Message-ID | <utFG1-198-11@gated-at.bofh.it> (permalink) |
| References | <utB9n-6tv-9@gated-at.bofh.it> <utB9o-6tv-19@gated-at.bofh.it> <utCoN-7tX-15@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Mon, Sep 25, 2017 at 7:42 PM, Oleg Nesterov <oleg@redhat.com> wrote:
> On 09/25, Gargi Sharma wrote:
>>
>> idr_get(namespace, id) returns a NULL if id is not present
>> in the idr tree or returns the pointer to the struct if id is
>> present in the idr tree. With this function in the idr library,
>> code for pid allocation can be simplified by calling this function
>> instead of looking through the pidhash.
>
> Could you explain why find_pid_ns() can't use idr_find() ?
It can. I missed this macro from the IDR library. Will change this
and drop this patch in the next version.
Thanks!
Gargi
>
>> +void * idr_get(struct idr *idr, int *id)
>> +{
>> + struct radix_tree_node *node;
>> + void __rcu **slot = NULL;
>> +
>> + __radix_tree_lookup(&idr->idr_rt, *id, &node, &slot);
>
> so why it takes "int *", not just "int" ?
>
> Oleg.
>
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH 2/4] idr: Add a function idr_get() Gargi Sharma <gs051095@gmail.com> - 2017-09-25 15:00 +0200
Re: [PATCH 2/4] idr: Add a function idr_get() Rik van Riel <riel@surriel.com> - 2017-09-25 15:30 +0200
Re: [PATCH 2/4] idr: Add a function idr_get() Christoph Hellwig <hch@infradead.org> - 2017-09-25 15:50 +0200
Re: [PATCH 2/4] idr: Add a function idr_get() Oleg Nesterov <oleg@redhat.com> - 2017-09-25 16:20 +0200
Re: [PATCH 2/4] idr: Add a function idr_get() Gargi Sharma <gs051095@gmail.com> - 2017-09-25 19:50 +0200
csiph-web