Kent Overstreet
ed1646ca74
bcachefs: Improve c version of __bkey_cmp_bits
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22 17:08:14 -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
5e5d9bdbb8
bcachefs: Fix fifo overflow in allocator startup
...
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
dbaee46846
bcachefs: fix error message in device remove path
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22 17:08:14 -04:00
Kent Overstreet
919dbbd18b
bcachefs: dio arithmetic improvements
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22 17:08:14 -04:00
Kent Overstreet
b030f691da
bcachefs: Fix some reserve calculations
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22 17:08:14 -04:00
Kent Overstreet
0519b72dd2
bcachefs: Add a workqueue for journal reclaim
...
journal reclaim writes btree nodes, which can end up waiting for in
flight btree writes to complete, and btree write completions run out of
workqueues - so we can't run out of the same workqueue or we risk
deadlock
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22 17:08:14 -04:00
Kent Overstreet
b0cbf659a5
bcachefs: Fix an allocator error path
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22 17:08:14 -04:00
Kent Overstreet
000de45996
bcachefs: fixes for getting stuck flushing journal pins
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22 17:08:14 -04:00
Kent Overstreet
ed4840308c
bcachefs: Fix a dio bug
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22 17:08:14 -04:00
Kent Overstreet
d0cc3defba
bcachefs: More allocator startup improvements
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22 17:08:14 -04:00
Kent Overstreet
b8adb83365
bcachefs: correctly initialize bch_extent_ptr
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22 17:08:14 -04:00
Kent Overstreet
04c2c34f00
bcachefs: use crc64 from lib/
...
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
e47c017144
bcachefs: Minor replicas.c refactoring
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22 17:08:14 -04:00
Kent Overstreet
e19e57f8a1
bcachefs: fix new reinherit_attrs ioctl
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22 17:08:14 -04:00
Kent Overstreet
0b847a19d9
bcachefs: Lots of option handling improvements
...
Add helptext to option definitions - so we can unify the option
handling with the format command
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22 17:08:14 -04:00
Kent Overstreet
2fab25cdd7
bcachefs: more project quota fixes
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22 17:08:14 -04:00
Kent Overstreet
69d46f9031
bcachefs: fix an rcu usage bug
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22 17:08:14 -04:00
Kent Overstreet
a36d3685bb
bcachefs: fix ja->cur_idx use while reading journal
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22 17:08:14 -04:00
Kent Overstreet
d3bb629d04
bcachefs: fix device remove error path
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22 17:08:13 -04:00
Kent Overstreet
19b505a934
bcachefs: Fix duplicate ioctl nr
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22 17:08:13 -04:00
Kent Overstreet
8095708fce
bcachefs: bch2_ioc_reinherit_attrs()
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22 17:08:13 -04:00
Kent Overstreet
96012e143e
bcachefs: rename keeps inheritable inode opts consistent
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22 17:08:13 -04:00
Kent Overstreet
4d269918ed
bcachefs: add bcachefs_effective xattrs
...
Allows seeing xattrs that were inherited, not explicitly set
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22 17:08:13 -04:00
Kent Overstreet
721d4ad8eb
bcachefs: Add flags to indicate if inode opts were inherited or explicitly set
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22 17:08:13 -04:00
Kent Overstreet
0f5254aa98
bcachefs: bch2_fs_quota_transfer
...
improve quota transfer locking & make ei_qid usage more consistent
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22 17:08:13 -04:00
Kent Overstreet
d42dd4ad6d
bcachefs: merge BCH_INODE_FIELDS_INHERIT/BCH_INODE_OPTS
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22 17:08:13 -04:00
Kent Overstreet
a3e70fb287
bcachefs: use x-macros more consistently
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22 17:08:13 -04:00
Kent Overstreet
7121643e4f
bcachefs: Fix for building in userspace
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22 17:08:13 -04:00
Tim Schlueter
f9ccc30824
bcachefs: Fix bkey_method compilation on gcc 7.3.0
...
Signed-off-by: Tim Schlueter <schlueter.tim@linux.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22 17:08:13 -04:00
Kent Overstreet
06b7345cc2
bcachefs: Include summarized counts in fs_usage
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22 17:08:13 -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
73e6ab9564
bcachefs: Switch replicas to mark_lock
...
Prep work for upcoming disk accounting changes
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22 17:08:13 -04:00
Kent Overstreet
56e0e7c79f
bcachefs: fix an incorrect bkey_debugcheck() call
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22 17:08:13 -04:00
Kent Overstreet
45dbb73e40
bcachefs: improve extent debugcheck fn
...
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
57cb2142ed
bcachefs: Fix for running in degraded mode
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22 17:08:13 -04:00
Kent Overstreet
db636adb2e
bcachefs: Compression fixes
...
regressions from switching disk space accounting to be in compressed
sectors
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22 17:08:13 -04:00
Kent Overstreet
56338d3dc3
bcachefs: propagate BCH_WRITE_CACHED
...
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
76640280ac
bcachefs: New blockcount field for bch_stripe
...
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
90541a741d
bcachefs: Add new alloc fields
...
prep work for persistent alloc info
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22 17:08:12 -04:00
Kent Overstreet
3636ed489a
bcachefs: Deferred btree updates
...
Will be used in the future for inode updates, which will be very helpful
for multithreaded workloads that have to update the inode with every
extent update (appends, or updates that change i_sectors)
Also will be used eventually for fully persistent alloc info
However - we still need a mechanism for reserving space in the journal
prior to getting a journal reservation, so it's not technically safe to
make use of this just yet, we could deadlock with the journal full
(although not likely to be an issue in practice)
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22 17:08:12 -04:00
Kent Overstreet
eb8632657f
bcachefs: drop bogus percpu_ref_tryget
...
caller should already be guarding against rw, and checking here breaks
when caller needs to finish updates for going RO
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22 17:08:12 -04:00
Kent Overstreet
f0cfb963ec
bcachefs: Track nr_inodes with the key marking machinery
...
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
01a0108f01
bcachefs: Fix a btree iter usage error
...
previously, if the code traversed to the next btree node, that could
return an error (due to lock restarts) - which was not being checked
for.
fix is to rework it so it never iterates past the current leaf node, and
pops an assertion if it ever sees an error.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22 17:08:12 -04:00