diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2021-03-03 00:35:30 +0100 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 23:08:58 +0200 |
commit | ab2a29ccffd0e9fe62afb8bbd45e1709f9726942 (patch) | |
tree | 506bd3b3614eaf0dd3ee9f94af28c4a81117cf00 /fs/bcachefs/dirent.h | |
parent | bcachefs: Start using bpos.snapshot field (diff) | |
download | linux-ab2a29ccffd0e9fe62afb8bbd45e1709f9726942.tar.xz 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/dirent.h')
-rw-r--r-- | fs/bcachefs/dirent.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/bcachefs/dirent.h b/fs/bcachefs/dirent.h index 34769371dd13..e1d8ce377d43 100644 --- a/fs/bcachefs/dirent.h +++ b/fs/bcachefs/dirent.h @@ -31,7 +31,7 @@ static inline unsigned dirent_val_u64s(unsigned len) int bch2_dirent_create(struct btree_trans *, u64, const struct bch_hash_info *, u8, - const struct qstr *, u64, int); + const struct qstr *, u64, u64 *, int); int bch2_dirent_delete_at(struct btree_trans *, const struct bch_hash_info *, @@ -46,8 +46,8 @@ enum bch_rename_mode { int bch2_dirent_rename(struct btree_trans *, u64, struct bch_hash_info *, u64, struct bch_hash_info *, - const struct qstr *, u64 *, - const struct qstr *, u64 *, + const struct qstr *, u64 *, u64 *, + const struct qstr *, u64 *, u64 *, enum bch_rename_mode); struct btree_iter * |