bcachefs: BCH_SNAPSHOT_DELETED -> BCH_SNAPSHOT_WILL_DELETE
authorKent Overstreet <kent.overstreet@linux.dev>
Fri, 2 May 2025 16:33:17 +0000 (12:33 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Thu, 22 May 2025 00:14:44 +0000 (20:14 -0400)
commit08d14d90a42a96f409ef3bb1fd073ca0a6bace27
tree7adc65384a8cd64d740c7b8d33382b57fac78604
parent3f8e97726557f2130c2992bf214c9e936b4a0877
bcachefs: BCH_SNAPSHOT_DELETED -> BCH_SNAPSHOT_WILL_DELETE

We're going to be speeding up snapshot deletion, by only having it
process the extents/dirents/xattrs btrees if an inode of a given
snapshot ID was present.

This raises the possibility of 'bkey_in_missing_snapshot' errors popping
up, if we ever accidentally don't do the corresponding inode update, or
if the new algorithm has bugs.

So we'll want to be able to differentiate more definitively between
'snapshot went missing' (and perhaps needs to be reconstructed), and
'key in snapshot that was deleted'.

So instead of deleting snapshot IDs, we'll be adding a new deleted flag
and leaving them permanently.

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