gfs2: finish_xmote cleanup
authorAndreas Gruenbacher <agruenba@redhat.com>
Fri, 12 Apr 2024 17:16:58 +0000 (19:16 +0200)
committerAndreas Gruenbacher <agruenba@redhat.com>
Wed, 24 Apr 2024 17:48:20 +0000 (19:48 +0200)
commit1cd28e15864054f3c48baee9eecda1c0441c48ac
tree53915029bc33af767064766ab8f324e2fcb076a3
parenta3730c5ec57b033ba6e437f7881a894d57b28a4a
gfs2: finish_xmote cleanup

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>
fs/gfs2/glock.c