• Kent Overstreet's avatar
    bcachefs: Don't run bch2_delete_dead_snapshots() unnecessarily · b0b5bbf9
    Kent Overstreet authored
    Be a bit more careful about when bch2_delete_dead_snapshots needs to
    run: it only needs to run synchronously if we're running fsck, and it
    only needs to run at all if we have snapshot nodes to delete or if fsck
    has noticed that it needs to run.
    
    Also:
      Rename BCH_FS_HAVE_DELETED_SNAPSHOTS -> BCH_FS_NEED_DELETE_DEAD_SNAPSHOTS
    
      Kill bch2_delete_dead_snapshots_hook(), move functionality to
      bch2_mark_snapshot()
    
      Factor out bch2_check_snapshot_needs_deletion(), to explicitly check
      if we need to be running snapshot deletion.
    Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
    b0b5bbf9
bcachefs.h 34.2 KB