[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: [dm-devel] idr_get_new_exact ?
- From: Roland Dreier <rdreier cisco com>
- To: Ohad Ben-Cohen <ohad wizery com>
- Cc: akpm linux-foundation org, Steve Wise <swise chelsio com>, linux-ppp vger kernel org, linux-kernel vger kernel org, linux-raid vger kernel org, linux-rdma vger kernel org, dm-devel redhat com, Paul Mackerras <paulus samba org>, linux-i2c vger kernel org, "Ben Dooks \(embedded platforms\)" <ben-linux fluff org>, netdev vger kernel org, "Jean Delvare \(PC drivers, core\)" <khali linux-fr org>, Sean Hefty <sean hefty intel com>, Roland Dreier <rolandd cisco com>, Hal Rosenstock <hal rosenstock gmail com>
- Subject: Re: [dm-devel] idr_get_new_exact ?
- Date: Mon, 20 Sep 2010 13:35:42 -0700
> Occasionally, drivers care about the value that idr associates with
> their pointers.
>
> Today we have idr_get_new_above() which allocates a new idr entry
> above or equal to a given starting id, but sometimes drivers need to
> force an exact value.
>
> To overcome this small API gap, drivers are wrapping idr_get_new_above
> and then either BUG_ON() or just call idr_remove() and returns -EBUSY
> when idr allocates them an id which is different than their requested
> value.
Looks fine to me as an improvement over the status quo, but I wonder how
many of these places could use the radix_tree stuff instead? If you're
not using the ability of the idr code to assign an id for you, then it
seems the radix_tree API is a better fit.
- R.
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]