diff options
| author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-06-06 14:33:27 -0400 |
|---|---|---|
| committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-07-14 19:00:15 -0400 |
| commit | 820b9efeb142a45b2c55df0806feb34936025c2a (patch) | |
| tree | fb03d8bfa6b466ac0efd712aa23edbfacacf172f /fs/bcachefs/eytzinger.h | |
| parent | f73e6bb6d6c70b72aff021237b8c4722cc43a919 (diff) | |
| download | linux-next-820b9efeb142a45b2c55df0806feb34936025c2a.tar.gz linux-next-820b9efeb142a45b2c55df0806feb34936025c2a.zip | |
bcachefs: Fix bch2_gc_accounting_done() locking
The transaction commit path takes mark_lock, so we shouldn't be holding
it; use a bpos as an iterator so that we can drop and retake.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/eytzinger.h')
| -rw-r--r-- | fs/bcachefs/eytzinger.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/fs/bcachefs/eytzinger.h b/fs/bcachefs/eytzinger.h index 795f4fc0bab1..0541192d7bc0 100644 --- a/fs/bcachefs/eytzinger.h +++ b/fs/bcachefs/eytzinger.h @@ -286,6 +286,17 @@ static inline int eytzinger0_find_gt(void *base, size_t nr, size_t size, return eytzinger0_next(idx, nr); } +static inline int eytzinger0_find_ge(void *base, size_t nr, size_t size, + cmp_func_t cmp, const void *search) +{ + ssize_t idx = eytzinger0_find_le(base, nr, size, cmp, search); + + if (idx < nr && !cmp(base + idx * size, search)) + return idx; + + return eytzinger0_next(idx, nr); +} + #define eytzinger0_find(base, nr, size, _cmp, search) \ ({ \ void *_base = (base); \ |
