• Kent Overstreet's avatar
    bcachefs: Inode backpointers · ab2a29cc
    Kent Overstreet authored
    This patch adds two new inode fields, bi_dir and bi_dir_offset, that
    point back to the inode's dirent.
    
    Since we're only adding fields for a single backpointer, files that have
    been hardlinked won't necessarily have valid backpointers: we also add a
    new inode flag, BCH_INODE_BACKPTR_UNTRUSTED, that's set if an inode has
    ever had multiple links to it. That's ok, because we only really need
    this functionality for directories, which can never have multiple
    hardlinks - when we add subvolumes, we'll need a way to enemurate and
    print subvolumes, and this will let us reconstruct a path to a subvolume
    root given a subvolume root inode.
    Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
    Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
    ab2a29cc
inode.c 15.5 KB