bcachefs: Push c->mark_lock usage down to where it is needed
authorKent Overstreet <kent.overstreet@gmail.com>
Sun, 28 Nov 2021 19:31:19 +0000 (14:31 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:18 +0000 (17:09 -0400)
commit58e1ea4bcb057388636b0098524d6e0647eb40c2
tree5ceb724ebe5e88fea1a99fe5e90bdaee6eda4aea
parent502cfb3591ec1f3d133c7eb281b8b93ca2bb2768
bcachefs: Push c->mark_lock usage down to where it is needed

This changes the bch2_mark_key() and related paths to take mark lock
where it is needed, instead of taking it in the upper transaction commit
path - by pushing down locking we'll be able to handle fsck errors
locally instead of requiring a separate check in the btree_gc code for
replicas being marked.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
fs/bcachefs/btree_gc.c
fs/bcachefs/btree_update_leaf.c
fs/bcachefs/buckets.c
fs/bcachefs/buckets.h
fs/bcachefs/ec.c