gfs2: Clean up function may_grant
authorAndreas Gruenbacher <agruenba@redhat.com>
Mon, 9 Aug 2021 22:43:55 +0000 (00:43 +0200)
committerAndreas Gruenbacher <agruenba@redhat.com>
Wed, 20 Oct 2021 17:33:08 +0000 (19:33 +0200)
commit6144464937fe1e6135b13a30502a339d549bf093
tree3484777082fadb7fd12622226fae8f8ca75a2644
parent2eb7509a05443048fb4df60b782de3f03c6c298b
gfs2: Clean up function may_grant

Pass the first current glock holder into function may_grant and
deobfuscate the logic there.

While at it, switch from BUG_ON to GLOCK_BUG_ON in may_grant.  To make
that build cleanly, de-constify the may_grant arguments.

We're now using function find_first_holder in do_promote, so move the
function's definition above do_promote.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/glock.c