summaryrefslogtreecommitdiff
path: root/fs/bcachefs/dirent.c
AgeCommit message (Collapse)Author
2021-05-20bcachefs: Fix inode backpointers in RENAME_OVERWRITEKent Overstreet
When we delete the dirent an inode points to, we need to zero out the backpointer fields - this was missed in the RENAME_OVERWRITE case. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2021-05-19bcachefs: Move some dirent checks to bch2_dirent_invalid()Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2021-05-19bcachefs: Inode backpointersKent Overstreet
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>
2021-05-19bcachefs: Require all btree iterators to be freedKent Overstreet
We keep running into occasional bugs with btree transaction iterators overflowing - this will make those bugs more visible. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2021-04-27bcachefs: Rename BTREE_ID enums for consistency with other enumsKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2021-04-27bcachefs: Rename KEY_TYPE_whiteout -> KEY_TYPE_hash_whiteoutKent Overstreet
Snapshots are going to need a different whiteout key type. Also, switch to using BCH_BKEY_TYPES() to define the bkey value accessors. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2021-04-27bcachefs: Print out d_type in dirent_to_text()Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2021-04-27bcachefs: Kill TRANS_RESET_MEM|TRANS_RESET_ITERSKent Overstreet
All iterators should be released now with bch2_trans_iter_put(), so TRANS_RESET_ITERS shouldn't be needed anymore, and TRANS_RESET_MEM is always used. Also convert more code to __bch2_trans_do(). Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2021-04-27bcachefs: Don't call trans_iter_put() on error pointerKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2021-04-27bcachefs: Split out btree_trigger_flagsKent Overstreet
The trigger flags really belong with individual btree_insert_entries, not the transaction commit flags - this splits out those flags and unifies them with the BCH_BUCKET_MARK flags. Todo - split out btree_trigger.c from buckets.c Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2021-04-27bcachefs: Convert all bch2_trans_commit() users to BTREE_INSERT_ATOMICKent Overstreet
BTREE_INSERT_ATOMIC should really be the default mode, and there's not that much code that doesn't need it - so this is prep work for getting rid of the flag. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2021-04-27bcachefs: Initial commitKent Overstreet
Forked from drivers/md/bcache, now a full blown COW multi device filesystem with a long list of features - https://bcachefs.org Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>