gfs2: Instantiate glocks ouside of glock state engine
authorAndreas Gruenbacher <agruenba@redhat.com>
Sat, 11 Jun 2022 03:04:11 +0000 (05:04 +0200)
committerAndreas Gruenbacher <agruenba@redhat.com>
Wed, 29 Jun 2022 14:53:22 +0000 (16:53 +0200)
commit53d69132958f7e144973d02ad0f0798386219efd
tree56f2531bbc4fdbfb3e7fe72c6b511dfe816083b5
parentbdff777cbb582da52cf4b536adc0815a41b407ed
gfs2: Instantiate glocks ouside of glock state engine

Instantiate glocks outside of the glock state engine: there is no real
reason for instantiating them inside the glock state engine; it only
complicates the code.

Instead, instantiate them in gfs2_glock_wait() and gfs2_glock_async_wait()
using the new gfs2_glock_holder_ready() helper.  On top of that, the only
other place that acquires a glock without using gfs2_glock_wait() or
gfs2_glock_async_wait() is gfs2_upgrade_iopen_glock(), so call
gfs2_glock_holder_ready() there as well.

If a dinode has a pending truncate, the glock-specific instantiate function
for inodes wakes up the truncate function in the quota daemon.  Waiting for
the completion of the truncate was previously done by the glock state
engine, but we now need to wait in inode_go_instantiate().

This also means that gfs2_instantiate() will now no longer return any
"special" error codes.

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