diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-06-20 13:49:25 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:10:04 -0400 |
commit | 1bb3c2a9747c404d23012088fbefb4499b884415 (patch) | |
tree | 450da8adf0cea75a7dda044f4c4b7c3d413c9da0 /fs/bcachefs/lru.c | |
parent | a83e108fc1964b8273c6f51cc62588ee774a5a48 (diff) | |
download | linux-stable-1bb3c2a9747c404d23012088fbefb4499b884415.tar.gz linux-stable-1bb3c2a9747c404d23012088fbefb4499b884415.tar.bz2 linux-stable-1bb3c2a9747c404d23012088fbefb4499b884415.zip |
bcachefs: New error message helpers
Add two new helpers for printing error messages with __func__ and
bch2_err_str():
- bch_err_fn
- bch_err_msg
Also kill the old error strings in the recovery path, which were causing
us to incorrectly report memory allocation failures - they're not needed
anymore.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/lru.c')
-rw-r--r-- | fs/bcachefs/lru.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/fs/bcachefs/lru.c b/fs/bcachefs/lru.c index 4f23e88f6ae1..e04c037f0c01 100644 --- a/fs/bcachefs/lru.c +++ b/fs/bcachefs/lru.c @@ -160,20 +160,18 @@ fsck_err: int bch2_check_lrus(struct bch_fs *c) { - struct btree_trans trans; struct btree_iter iter; struct bkey_s_c k; struct bpos last_flushed_pos = POS_MIN; int ret = 0; - bch2_trans_init(&trans, c, 0, 0); - - ret = for_each_btree_key_commit(&trans, iter, - BTREE_ID_lru, POS_MIN, BTREE_ITER_PREFETCH, k, - NULL, NULL, BTREE_INSERT_NOFAIL|BTREE_INSERT_LAZY_RW, - bch2_check_lru_key(&trans, &iter, k, &last_flushed_pos)); - - bch2_trans_exit(&trans); + ret = bch2_trans_run(c, + for_each_btree_key_commit(&trans, iter, + BTREE_ID_lru, POS_MIN, BTREE_ITER_PREFETCH, k, + NULL, NULL, BTREE_INSERT_NOFAIL|BTREE_INSERT_LAZY_RW, + bch2_check_lru_key(&trans, &iter, k, &last_flushed_pos))); + if (ret) + bch_err_fn(c, ret); return ret; } |