]> www.infradead.org Git - users/jedix/linux-maple.git/commit
dlm: move lkb xarray lookup out of lock
authorAlexander Aring <aahringo@redhat.com>
Fri, 2 Aug 2024 17:26:46 +0000 (13:26 -0400)
committerDavid Teigland <teigland@redhat.com>
Thu, 8 Aug 2024 20:15:08 +0000 (15:15 -0500)
commitc846f732b97aa30ab91c03b0337cc0c8e27b24df
tree3e19b6dea753ed6d119126338ee0ed4944609861
parent5be323b0c64dbecdc33b43012f927e6af82d62d3
dlm: move lkb xarray lookup out of lock

This patch moves the xarray lookup functionality for the lkb out of the
ls_lkbxa_lock read lock handling. We can do that as the xarray should be
possible to access lockless in case of reader like xa_load(). We confirm
under ls_lkbxa_lock that the lkb is still part of the data structure and
take a reference when its still part of ls_lkbxa to avoid being freed
after doing the lookup. To do a check if the lkb is still part of the
ls_lkbxa data structure we use a kref_read() as the last put will remove
it from the ls_lkbxa data structure and any reference taken means it is
still part of ls_lkbxa.

A similar approach was done with the DLM rsb rhashtable just with a flag
instead of the refcounter because the refcounter has a slightly
different meaning.

Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
fs/dlm/dlm_internal.h
fs/dlm/lock.c
fs/dlm/memory.c