projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2111f39
)
bcachefs: Convert gc_alloc_start() to for_each_btree_key2()
author
Kent Overstreet
<kent.overstreet@linux.dev>
Tue, 28 Nov 2023 21:31:48 +0000
(16:31 -0500)
committer
Kent Overstreet
<kent.overstreet@linux.dev>
Wed, 29 Nov 2023 03:58:22 +0000
(22:58 -0500)
This eliminates some SRCU warnings: for_each_btree_key2() runs every
loop iteration in a distinct transaction context.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/btree_gc.c
patch
|
blob
|
history
diff --git
a/fs/bcachefs/btree_gc.c
b/fs/bcachefs/btree_gc.c
index 0b5d09c8475d00bf35ee70c52cd9ae9483a56823..30ab78a24517404b35d3e41d8a86482f7e719096 100644
(file)
--- a/
fs/bcachefs/btree_gc.c
+++ b/
fs/bcachefs/btree_gc.c
@@
-1541,8
+1541,8
@@
static int bch2_gc_alloc_start(struct bch_fs *c, bool metadata_only)
rcu_assign_pointer(ca->buckets_gc, buckets);
}
-
for_each_btree_key
(trans, iter, BTREE_ID_alloc, POS_MIN,
-
BTREE_ITER_PREFETCH, k, ret)
{
+
ret = for_each_btree_key2
(trans, iter, BTREE_ID_alloc, POS_MIN,
+
BTREE_ITER_PREFETCH, k, (
{
ca = bch_dev_bkey_exists(c, k.k->p.inode);
g = gc_bucket(ca, k.k->p.offset);
@@
-1561,8
+1561,9
@@
static int bch2_gc_alloc_start(struct bch_fs *c, bool metadata_only)
g->stripe = a->stripe;
g->stripe_redundancy = a->stripe_redundancy;
}
- }
- bch2_trans_iter_exit(trans, &iter);
+
+ 0;
+ }));
err:
bch2_trans_put(trans);
if (ret)