]> git.hungrycats.org Git - linux/commit
gfs2: finish_xmote cleanup
authorAndreas Gruenbacher <agruenba@redhat.com>
Fri, 12 Apr 2024 17:16:58 +0000 (19:16 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 May 2024 07:49:14 +0000 (09:49 +0200)
commit19f3d0ce67ea684eda548a631bd86a8f0cdb25d0
treeb1b4bb39af9548793c4777643e67937b51753dba
parente42e8a24d7f02d28763d16ca7ec5fc6d1f142af0
gfs2: finish_xmote cleanup

[ Upstream commit 1cd28e15864054f3c48baee9eecda1c0441c48ac ]

Currently, function finish_xmote() takes and releases the glock
spinlock.  However, all of its callers immediately take that spinlock
again, so it makes more sense to take the spin lock before calling
finish_xmote() already.

With that, thaw_glock() is the only place that sets the GLF_HAVE_REPLY
flag outside of the glock spinlock, but it also takes that spinlock
immediately thereafter.  Change that to set the bit when the spinlock is
already held.  This allows to switch from test_and_clear_bit() to
test_bit() and clear_bit() in glock_work_func().

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Stable-dep-of: 9947a06d29c0 ("gfs2: do_xmote fixes")
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/gfs2/glock.c