aboutsummaryrefslogtreecommitdiff
path: root/fs/bcachefs/inode.h
diff options
context:
space:
mode:
authorGravatar Kent Overstreet <kent.overstreet@gmail.com> 2021-03-02 18:35:30 -0500
committerGravatar Kent Overstreet <kent.overstreet@linux.dev> 2023-10-22 17:08:58 -0400
commitab2a29ccffd0e9fe62afb8bbd45e1709f9726942 (patch)
tree506bd3b3614eaf0dd3ee9f94af28c4a81117cf00 /fs/bcachefs/inode.h
parentbcachefs: Start using bpos.snapshot field (diff)
downloadlinux-ab2a29ccffd0e9fe62afb8bbd45e1709f9726942.tar.gz
linux-ab2a29ccffd0e9fe62afb8bbd45e1709f9726942.tar.bz2
linux-ab2a29ccffd0e9fe62afb8bbd45e1709f9726942.zip
bcachefs: Inode backpointers
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: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/inode.h')
-rw-r--r--fs/bcachefs/inode.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/bcachefs/inode.h b/fs/bcachefs/inode.h
index 1caf036ae928..6bad6dfb7989 100644
--- a/fs/bcachefs/inode.h
+++ b/fs/bcachefs/inode.h
@@ -69,7 +69,8 @@ void bch2_inode_init(struct bch_fs *, struct bch_inode_unpacked *,
uid_t, gid_t, umode_t, dev_t,
struct bch_inode_unpacked *);
-int bch2_inode_create(struct btree_trans *, struct bch_inode_unpacked *);
+struct btree_iter *bch2_inode_create(struct btree_trans *,
+ struct bch_inode_unpacked *);
int bch2_inode_rm(struct bch_fs *, u64, bool);