On Wed, Sep 13, 2023 at 12:22:03PM +0100, Edward Cree wrote:
On 12/09/2023 17:36, Russell King (Oracle) wrote:
quoted
On Tue, Sep 12, 2023 at 03:21:37PM +0100, edward.cree@amd.com wrote:
quoted
+ struct idr rss_ctx;
https://docs.kernel.org/core-api/idr.html
"The IDR interface is deprecated; please use the XArray instead."
IDR is a wrapper around XArray these days, right?
Yes, but a bad one.
When I looked into the equivalent to use XArray directly it looked much
more complicated for flexibility that really isn't needed here.
No, it's no more complex to use. There are a lot of _other_ things
you can do with it, but every IDR call has an equivalent XArray call.
And as a bonus you get a spinlock protecting you!
Is there an explanation you can point me at of why this extremely
convenient wrapper is deprecated?
Because why have two APIs for the same thing? One day, I will be finished
with important projects and then I'll go back to eradicating the users
of the IDR.