summaryrefslogtreecommitdiff
path: root/fs/bcachefs/reflink.c
AgeCommit message (Collapse)Author
2020-06-09bcachefs: Add an option to disable reflink supportKent Overstreet
Reflink might be buggy, so we're adding an option so users can help bisect what's going on. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-06-09bcachefs: 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>
2020-06-09bcachefs: Make sure we're releasing btree iteratorsKent Overstreet
This wasn't originally required, but this is the model we're moving towards. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-06-09bcachefs: 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>
2020-06-09bcachefs: Convert some enums to x-macrosKent Overstreet
Helps for preventing things from getting out of sync. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-06-09bcachefs: Kill BTREE_INSERT_ATOMICKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-06-09bcachefs: bch2_trans_reset() calls should be at the tops of loopsKent Overstreet
It needs to be called when we get -EINTR due to e.g. lock restart - this fixes a transaction iterators overflow bug. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-06-09bcachefs: bch2_check_set_feature()Kent Overstreet
New helper function for setting incompatible feature bits Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-06-09bcachefs: bkey_on_stack_reassemble()Kent Overstreet
Small helper function. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-06-09bcachefs: Rework of cut_front & cut_backKent Overstreet
This changes bch2_cut_front and bch2_cut_back so that they're able to shorten the size of the value, and it also changes the extent update path to update the accounting in the btree node when this happens. When the size of the value is shortened, they zero out the space that's no longer used, so it's interpreted as noops (as implemented in the last patch). Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-06-09bcachefs: bkey_on_stackKent Overstreet
This implements code for storing small bkeys on the stack and allocating out of a mempool if they're too big. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-06-09bcachefs: Some reflink fixesKent Overstreet
len might fit into a loff_t when aligned_len does not - make sure we use a u64 for aligned_len. Also, we weren't always extending the inode correctly. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-06-09bcachefs: Refactor bch2_trans_commit() pathKent Overstreet
2020-06-09bcachefs: Convert bch2_fpunch to bch2_extent_update()Kent Overstreet
As before - we're moving non Linux specific code out of fs-io.c. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-06-09bcachefs: Split out bchfs_extent_update()Kent Overstreet
The next few patches are going to be more moving the logic around i_size/i_sectors updates to io.c, and better separating the Linux VFS specific code from core bcachefs code, to better support the fuse port. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-06-09bcachefs: Check if extending inode differentlyKent Overstreet
In bch2_extent_update(), we have to update the inode if i_size is changing (the file is being extend) or if i_sectors is changing, but we want to avoid touching the inode if it's not necessary. Change sum_sector_overwrites() to also check if there's already data above where we're writing to - this means we're definitely not extending the file. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-06-09bcachefs: Can't be holding read locks while taking write locksKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-06-09bcachefs: Rework btree iterator lifetimesKent Overstreet
The btree_trans struct needs to memoize/cache btree iterators, so that on transaction restart we don't have to completely redo btree lookups, and so that we can do them all at once in the correct order when the transaction had to restart to avoid a deadlock. This switches the btree iterator lookups to work based on iterator position, instead of trying to match them up based on the stack trace. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-06-09bcachefs: Kill deferred btree updatesKent Overstreet
Will be replaced by cached btree iterators Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-06-09bcachefs: ReflinkKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>