Kent Overstreet
06ab329c15
bcachefs: Improve pointer marking checks and error messages
...
Importantly, we don't want to use bch2_fs_inconsistent_on() for errors
that fsck can repair, becuase that will just put us in RO mode and
prevent fsck from actually fixing stuff. Probably want to get rid of it
in the future.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2023-10-22 17:08:26 -04:00
Kent Overstreet
2cbe5cfe27
bcachefs: Rework calling convention for marking overwrites
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2023-10-22 17:08:25 -04:00
Kent Overstreet
88767d65d8
bcachefs: Update path now handles triggers that generate more triggers
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2023-10-22 17:08:23 -04:00
Kent Overstreet
6e738539cd
bcachefs: Improve key marking interface
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2023-10-22 17:08:22 -04:00
Kent Overstreet
3838be7841
bcachefs: Don't use a fixed size buffer for fs_usage_deltas
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2023-10-22 17:08:22 -04:00
Kent Overstreet
6fb076e60d
bcachefs: Fix spurious inconsistency in recovery
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2023-10-22 17:08:22 -04:00
Kent Overstreet
932aa83745
bcachefs: bch2_trans_mark_update()
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2023-10-22 17:08:21 -04:00
Kent Overstreet
5e82a9a1f4
bcachefs: Write out fs usage consistently
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2023-10-22 17:08:21 -04:00
Kent Overstreet
94f651e2c7
bcachefs: Return errors from for_each_btree_key()
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2023-10-22 17:08:20 -04:00
Kent Overstreet
c6dd04f8f5
bcachefs: Mark overwrites from journal replay in initial gc
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2023-10-22 17:08:20 -04:00
Kent Overstreet
a1d58243f9
bcachefs: add ability to run gc on metadata only
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2023-10-22 17:08:20 -04:00
Kent Overstreet
36e916e13b
bcachefs: Caller now responsible for calling mark_key for gc
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2023-10-22 17:08:19 -04:00
Kent Overstreet
4d8100daa9
bcachefs: Allocate fs_usage in do_btree_insert_at()
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2023-10-22 17:08:18 -04:00
Kent Overstreet
0dc17247f1
bcachefs: kill struct btree_insert
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2023-10-22 17:08:18 -04:00
Kent Overstreet
28062d320b
bcachefs: Fix gc handling of bucket gens
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2023-10-22 17:08:16 -04:00
Kent Overstreet
ecf37a4a80
bcachefs: fs_usage_u64s()
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2023-10-22 17:08:16 -04:00
Kent Overstreet
768ac63924
bcachefs: Add a mechanism for blocking the journal
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2023-10-22 17:08:16 -04:00
Kent Overstreet
8fe826f90a
bcachefs: Convert bucket invalidation to key marking path
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2023-10-22 17:08:16 -04:00
Kent Overstreet
8777210b92
bcachefs: refactor key marking code a bit
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2023-10-22 17:08:16 -04:00
Kent Overstreet
2ecc6171a3
bcachefs: Fix double counting when gc is running
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2023-10-22 17:08:16 -04:00
Kent Overstreet
39fbc5a49f
bcachefs: gc lock no longer needed for disk reservations
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2023-10-22 17:08:16 -04:00
Kent Overstreet
76f4c7b0c3
bcachefs: Fix oldest_gen handling
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2023-10-22 17:08:15 -04:00
Kent Overstreet
3e0745e283
bcachefs: initialize fs usage summary in recovery
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2023-10-22 17:08:15 -04:00
Kent Overstreet
430735cd1a
bcachefs: Persist alloc info on clean shutdown
...
- Does not persist alloc info for stripes yet
- Also does not yet include filesystem block/sector counts yet, from
struct fs_usage
- Not made use of just yet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2023-10-22 17:08:14 -04:00
Kent Overstreet
7ef2a73a58
bcachefs: Fix check for if extent update is allocating
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2023-10-22 17:08:14 -04:00
Kent Overstreet
23f80d2b3b
bcachefs: Factor out acc_u64s()
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2023-10-22 17:08:14 -04:00
Kent Overstreet
5663a41521
bcachefs: refactor bch_fs_usage
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2023-10-22 17:08:13 -04:00
Kent Overstreet
641ab73643
bcachefs: improve/clarify ptr_disk_sectors()
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2023-10-22 17:08:13 -04:00
Kent Overstreet
9166b41db1
bcachefs: s/usage_lock/mark_lock
...
better describes what it's for, and we're going to call a new lock
usage_lock
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2023-10-22 17:08:13 -04:00
Kent Overstreet
8eb7f3ee46
bcachefs: move dirty into bucket_mark
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2023-10-22 17:08:12 -04:00
Kent Overstreet
26609b619f
bcachefs: Make bkey types globally unique
...
this lets us get rid of a lot of extra switch statements - in a lot of
places we dispatch on the btree node type, and then the key type, so
this is a nice cleanup across a lot of code.
Also improve the on disk format versioning stuff.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2023-10-22 17:08:12 -04:00
Kent Overstreet
eeb83e25bb
bcachefs: Hold usage_lock over mark_key and fs_usage_apply
...
Fixes an inconsistency at the end of gc
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2023-10-22 17:08:12 -04:00
Kent Overstreet
dfe9bfb32e
bcachefs: Stripes now properly subject to gc
...
gc now verifies the contents of the stripes radix tree, important for
persistent alloc info
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2023-10-22 17:08:12 -04:00
Kent Overstreet
9ca53b55f7
bcachefs: gc now operates on second set of bucket marks
...
This means we can now use gc to verify the allocation information -
important for testing persistant alloc info
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2023-10-22 17:08:12 -04:00
Kent Overstreet
cd575ddf57
bcachefs: Erasure coding
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2023-10-22 17:08:11 -04:00
Kent Overstreet
b35b192583
bcachefs: Move key marking out of extents.c
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2023-10-22 17:08:11 -04:00
Kent Overstreet
b092dadd55
bcachefs: Scale down number of writepoints when low on space
...
this means we don't have to reserve space for them when calculating
filesystem capacity
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2023-10-22 17:08:11 -04:00
Kent Overstreet
47799326bc
bcachefs: more key marking refactoring
...
prep work for erasure coding
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2023-10-22 17:08:10 -04:00
Kent Overstreet
5b650fd11a
bcachefs: Account for internal fragmentation better
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2023-10-22 17:08:08 -04:00
Kent Overstreet
09f3297ac9
bcachefs: kill s_alloc, use bch_data_type
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2023-10-22 17:08:08 -04:00
Kent Overstreet
a7c7a3092e
bcachefs: bch2_mark_key() now takes bch_data_type
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2023-10-22 17:08:08 -04:00
Kent Overstreet
b29e197aaf
bcachefs: Invalidate buckets when writing to alloc btree
...
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-22 17:08:08 -04:00
Kent Overstreet
b2be7c8b73
bcachefs: kill bucket mark sector count saturation
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2023-10-22 17:08:08 -04:00
Kent Overstreet
1c6fdbd8f2
bcachefs: Initial commit
...
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-22 17:08:07 -04:00