Re: [PATCH v2 0/5] Remove the XFS mrlock

Mateusz Guzik
2023-10-08T20:32:03Z

On 10/7/23, Matthew Wilcox (Oracle) <willy@infradead.org> wrote:
> I'm sympathetic to "this will warn twice and dump much the same
> information if you have lockdep enabled". Perhaps somebody has a
> suggestion for not doing that?
>

Well the obvious idea is that lockdep could provide a macro indicating
what's up.

Then you would:
static inline void rwsem_assert_held(const struct rw_semaphore *sem)
{
if (lockdep_works)
lockdep_assert_held(sem);
else
__rwsem_assert_held(sem);
}

Am I missing something? If this is not feasible to achieve, then the
proposed routines need a comment justifying the state.

--
Mateusz Guzik <mjguzik gmail.com>