summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-10-22bcachefs: BTREE_INSERT_JOURNAL_RES_FULL is no longer possibleKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22bcachefs: extent_squash() can no longer failKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22bcachefs: make struct btree_iter a bit smallerKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22bcachefs: lift ordering restriction on 0 size extentsKent Overstreet
This lifts the restriction that 0 size extents must not overlap with other extents, which means we can now sort extents and non extents the same way, and will let us simplify a bunch of other stuff as well. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22bcachefs: extent unit testsKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22bcachefs: bkey_written()Kent Overstreet
also cleanups of btree node offsets Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22bcachefs: improved rw_aux_tree_bsearch()Kent Overstreet
shouldn't be any reason for an actual binary search here Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22bcachefs: Factor out btree_key_can_insert()Kent Overstreet
working on getting rid of all the reasons bch2_insert_fixup_extent() can fail/stop partway, which is needed for other refactorings. One of the reasons we could have to bail out is if we're splitting a compressed extent we might need to add to our disk reservation - but we can check that before actually starting the insert. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22bcachefs: BCH_SB_RESERVE_BYTESKent Overstreet
Add an option, gc_reserve_bytes, to set the copygc reserve as a size instead of a percent Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22bcachefs: Better calculation of copygc thresholdKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22bcachefs: Change how replicated data is accountedKent Overstreet
Due to compression, the different replicas of a replicated extent don't necessarily have to take up the same amount of space - so replicated data sector counts shouldn't be stored divided by the number of replicas. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22bcachefs: Account for internal fragmentation betterKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22bcachefs: kill s_alloc, use bch_data_typeKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22bcachefs: bch2_mark_key() now takes bch_data_typeKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22bcachefs: Fix an assertion in the btree node merge pathKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22bcachefs: Fix locking in allocator threadKent Overstreet
gc lock must be held while invalidating buckets - fixes "1f7a95698e bcachefs: Invalidate buckets when writing to alloc btree" Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22bcachefs: fix bch2_val_to_text()Kent Overstreet
was returning wrong value Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22bcachefs: minor fsync fixKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22bcachefs: Assorted journal refactoringKent Overstreet
Also improve error reporting - only return an error from bch2_journal_flush_seq() if we had an error writing that entry (i.e. not if there was an error with a newer entry). Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22bcachefs: fix last_seq_ondiskKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22bcachefs: fix mtime/ctime update on truncateKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22bcachefs: fix fsync after createKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22bcachefs: fix nbuckets usage on device resizeKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22bcachefs: Invalidate buckets when writing to alloc btreeKent Overstreet
Prep work for persistent alloc information. Refactoring also lets us make free_inc much smaller, which means a lot fewer buckets stranded on freelists. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22bcachefs: kill bucket mark sector count saturationKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22bcachefs: don't call bch2_bucket_seq_cleanup from journal_buf_switchKent Overstreet
journal_buf_switch is called from the foreground when getting a journal reservation and thus is somewhat latency sensitive; bch2_bucket_seq_cleanup has to run infrequently but is a bit expensive when it does run. Call it from the journal write path instead, and punt the journal write to worqueue context. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22bcachefs: Fix an assertionKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22bcachefs: fix rename + fsyncKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22bcachefs: Use ei_update_lock consistentlyKent Overstreet
This is prep work for using deferred btree updates for inode updates - the way inodes are done now we're relying on btree locking for ei_inode and ei_update_lock could probably be removed, but it'll actually be needed when we switch to deferred updates. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22bcachefs: bch2_trans_update() now takes struct btree_insert_entryKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22bcachefs: Fix mtime/ctime updatesKent Overstreet
Also make inode flags consistent with how the rest of the inode is updated Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22bcachefs: Simplify bch2_write_inode_trans, fix lockdep splatKent Overstreet
ei_update_lock isn't currently needed for write inode (but it will be needed again when deferred btree updates are used for inode updates) Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22bcachefs: add bch_verbose() statements for shutdownKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22bcachefs: Fix a use after free in the journal codeKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22bcachefs: Fix device addKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22bcachefs: trace transaction restartsKent Overstreet
exceptionally crappy "tracing", but it's a start at documenting the places restarts can be triggered Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22bcachefs: Convert raw uses of bch2_btree_iter_link() to new transactionsKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22bcachefs: Only check inode i_nlink during full fsckKent Overstreet
Now that all filesystem operatinos that manipulate the filesystem heirachy and i_nlink are fully atomic, we can add a feature bit to indicate i_nlink doesn't need to be checked. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22bcachefs: Initial commitKent Overstreet
Initially forked from drivers/md/bcache, bcachefs is a new copy-on-write filesystem with every feature you could possibly want. Website: https://bcachefs.org Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22MAINTAINERS: Add entry for bcachefsKent Overstreet
bcachefs is a new copy-on-write filesystem; add a MAINTAINERS entry for it. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-19objtool: Add bcachefs noreturnsKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-19lib/generic-radix-tree.c: Add peek_prev()Kent Overstreet
This patch adds genradix_peek_prev(), genradix_iter_rewind(), and genradix_for_each_reverse(), for iterating backwards over a generic radix tree. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-19lib/generic-radix-tree.c: Don't overflow in peek()Kent Overstreet
When we started spreading new inode numbers throughout most of the 64 bit inode space, that triggered some corner case bugs, in particular some integer overflows related to the radix tree code. Oops. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2023-10-19MAINTAINERS: Add entry for generic-radix-treeKent Overstreet
lib/generic-radix-tree.c is a simple radix tree that supports storing arbitrary types. Add a maintainers entry for it. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-19closures: Add a missing includeKent Overstreet
Fixes building in userspace. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-19closures: closure_nr_remaining()Kent Overstreet
Factor out a new helper, which returns the number of events outstanding. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-19closures: closure_wait_event()Kent Overstreet
Like wait_event() - except, because it uses closures and closure waitlists it doesn't have the restriction on modifying task state inside the condition check, like wait_event() does. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Acked-by: Coly Li <colyli@suse.de>
2023-10-19MAINTAINERS: Add entry for closuresKent Overstreet
closures, from bcache, are async widgets with a variety of uses. bcachefs also uses them, so they're being moved to lib/; mark them as maintained. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> Acked-by: Coly Li <colyli@suse.de> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-19bcache: move closures to lib/Kent Overstreet
Prep work for bcachefs - being a fork of bcache it also uses closures Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> Acked-by: Coly Li <colyli@suse.de> Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
2023-10-19locking: export contention tracepoints for bcachefs six locksBrian Foster
The bcachefs implementation of six locks is intended to land in generic locking code in the long term, but has been pulled into the bcachefs subsystem for internal use for the time being. This code lift breaks the bcachefs module build as six locks depend a couple of the generic locking tracepoints. Export these tracepoint symbols for bcachefs. Signed-off-by: Brian Foster <bfoster@redhat.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>