projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
131898b
)
bcachefs: Convert compression_stats to for_each_btree_key2
author
Kent Overstreet
<kent.overstreet@linux.dev>
Mon, 4 Dec 2023 05:38:56 +0000
(
00:38
-0500)
committer
Kent Overstreet
<kent.overstreet@linux.dev>
Mon, 4 Dec 2023 21:04:55 +0000
(16:04 -0500)
for_each_btree_key2() runs each loop iteration in a btree transaction,
and thus does not cause SRCU lock hold time problems.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/sysfs.c
patch
|
blob
|
blame
|
history
diff --git
a/fs/bcachefs/sysfs.c
b/fs/bcachefs/sysfs.c
index ab743115f169e5fc1a7c665148d0c877800fefab..f3cb7115b530bb29dcd35453931a05753438f0fb 100644
(file)
--- a/
fs/bcachefs/sysfs.c
+++ b/
fs/bcachefs/sysfs.c
@@
-276,8
+276,8
@@
static int bch2_compression_stats_to_text(struct printbuf *out, struct bch_fs *c
if (!btree_type_has_ptrs(id))
continue;
-
for_each_btree_key
(trans, iter, id, POS_MIN,
-
BTREE_ITER_ALL_SNAPSHOTS, k, ret)
{
+
ret = for_each_btree_key2
(trans, iter, id, POS_MIN,
+
BTREE_ITER_ALL_SNAPSHOTS, k, (
{
struct bkey_ptrs_c ptrs = bch2_bkey_ptrs_c(k);
const union bch_extent_entry *entry;
struct extent_ptr_decoded p;
@@
-309,8
+309,8
@@
static int bch2_compression_stats_to_text(struct printbuf *out, struct bch_fs *c
nr_uncompressed_extents++;
else if (compressed)
nr_compressed_extents++;
- }
-
bch2_trans_iter_exit(trans, &iter
);
+ 0;
+
})
);
}
bch2_trans_put(trans);