]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
bcachefs: New check_nlinks algorithm for snapshots
authorKent Overstreet <kent.overstreet@gmail.com>
Thu, 22 Apr 2021 01:08:49 +0000 (21:08 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:02 +0000 (17:09 -0400)
commitfc51b041b72a7cbffc60811ff14d25207a4f7624
treef4fc801ba371989e7dbc510a9f23203cc4ab9b24
parente3b4b48c17a0f749f2786e756714a56316a519b3
bcachefs: New check_nlinks algorithm for snapshots

With snapshots, using a radix tree for the table of link counts won't
work anymore because we also need to distinguish between inodes with
different snapshot IDs. Instead, this patch builds up a sorted array of
inodes that have hardlinks that we can binary search on - taking
advantage of the fact that with inode backpointers, the check_nlinks()
pass _only_ needs to concern itself with inodes that have hardlinks now.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/fsck.c