bcachefs: bch2_btree_path_upgrade() checks nodes_locked, not uptodate
authorKent Overstreet <kent.overstreet@linux.dev>
Thu, 11 Apr 2024 02:19:40 +0000 (22:19 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Wed, 8 May 2024 21:29:19 +0000 (17:29 -0400)
commit5d8c9d94283ff170e74f13b501c3f264365621b5
tree696f0da04ed3d1db03758b6a12548d551fa7ca6e
parentf2d9823f46b4aebbe2d6a7f1a76158536c6291a8
bcachefs: bch2_btree_path_upgrade() checks nodes_locked, not uptodate

In the key cache fill path, we use path_upgrade() on a path that isn't
uptodate yet but should be locked.

This change makes bch2_btree_path_upgrade() slightly looser so we can
use it in key cache upgrade, instead of the __ version.

Also, make the related assert - that path->uptodate implies nodes_locked
- slightly clearer.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/btree_locking.c
fs/bcachefs/btree_locking.h