bcachefs: Add support for dirents that point to subvolumes
authorKent Overstreet <kent.overstreet@gmail.com>
Tue, 16 Mar 2021 04:46:26 +0000 (00:46 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:12 +0000 (17:09 -0400)
commitb9e1adf57988fb4632b86c43fde1551a24299b86
tree3f6d8942ede2c864a84cb66501bf80d7682c60a7
parent14b393ee768e8339b9c64f82df24e8c081bdbff9
bcachefs: Add support for dirents that point to subvolumes

Dirents currently always point to inodes. Subvolumes add a new type of
dirent, with d_type DT_SUBVOL, that instead points to an entry in the
subvolumes btree, and the subvolume has a pointer to the root inode.

This patch adds bch2_dirent_read_target() to get the inode (and
potentially subvolume) a dirent points to, and changes existing code to
use that instead of reading from d_inum directly.

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