Re: [PATCH v2 2/4] radix-tree: allow more lock types with radix_tree_deref_slot_protected()

From: Andy Shevchenko

Date: Mon Jun 22 2026 - 06:23:38 EST


On Mon, Jun 22, 2026 at 10:52:01AM +0200, Wolfram Sang wrote:
> The 'treelock' parameter is type-checked to be of spinlock_t. The lock
> to protect the tree might be something else, though. E.g. the hwspinlock
> subsystem uses a mutex. 'treelock' is simply passed onto
> lockdep_is_held() which supports way more lock types by using a #define
> instead of an inline function. Use the same approach for
> radix_tree_deref_slot_protected() to support more lock types, too.

A pity we should use a macro, but I understand why.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>

--
With Best Regards,
Andy Shevchenko