xfs: break up xfs_buf_find() into individual pieces
authorDave Chinner <dchinner@redhat.com>
Thu, 14 Jul 2022 02:02:46 +0000 (12:02 +1000)
committerDave Chinner <david@fromorbit.com>
Thu, 14 Jul 2022 02:02:46 +0000 (12:02 +1000)
commitde67dc575434dca8d60b1e181ed5dd296392ffce
tree7cbd0f2e80bd660b3875ea40015950f1c78da36b
parent85c73bf726e41be276bcad3325d9a8aef10be289
xfs: break up xfs_buf_find() into individual pieces

xfs_buf_find() is made up of three main parts: lookup, insert and
locking. The interactions with xfs_buf_get_map() require it to be
called twice - once for a pure lookup, and again on lookup failure
so the insert path can be run. We want to simplify this down a lot,
so split it into a fast path lookup, a slow path insert and a "lock
the found buffer" helper. This will then let us integrate these
operations more effectively into xfs_buf_get_map() in future
patches.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
fs/xfs/xfs_buf.c