bch2_trans_iter_exit(trans, &iter);
err:
if (ret && !bch2_err_matches(ret, BCH_ERR_transaction_restart))
- bch_err(c, "error from __remove_dirent(): %s", bch2_err_str(ret));
+ bch_err(c, "%s(): error %s", __func__, bch2_err_str(ret));
return ret;
}
break;
if (i->equiv == n.equiv) {
- bch_err(c, "adding duplicate snapshot in snapshots_seen_add()");
+ bch_err(c, "%s(): adding duplicate snapshot", __func__);
return -EINVAL;
}
}
err:
fsck_err:
if (ret)
- bch_err(c, "error from check_inode(): %s", bch2_err_str(ret));
+ bch_err(c, "%s(): error %s", __func__, bch2_err_str(ret));
return ret;
}
bch2_trans_exit(&trans);
snapshots_seen_exit(&s);
if (ret)
- bch_err(c, "error from check_inodes(): %s", bch2_err_str(ret));
+ bch_err(c, "%s(): error %s", __func__, bch2_err_str(ret));
return ret;
}
}
fsck_err:
if (ret)
- bch_err(c, "error from check_i_sectors(): %s", bch2_err_str(ret));
+ bch_err(c, "%s(): error %s", __func__, bch2_err_str(ret));
if (!ret && trans_was_restarted(trans, restart_count))
ret = -BCH_ERR_transaction_restart_nested;
return ret;
printbuf_exit(&buf);
if (ret && !bch2_err_matches(ret, BCH_ERR_transaction_restart))
- bch_err(c, "error from check_extent(): %s", bch2_err_str(ret));
+ bch_err(c, "%s(): error %s", __func__, bch2_err_str(ret));
return ret;
}
snapshots_seen_exit(&s);
if (ret)
- bch_err(c, "error from check_extents(): %s", bch2_err_str(ret));
+ bch_err(c, "%s(): error %s", __func__, bch2_err_str(ret));
return ret;
}
}
fsck_err:
if (ret)
- bch_err(c, "error from check_subdir_count(): %s", bch2_err_str(ret));
+ bch_err(c, "%s(): error %s", __func__, bch2_err_str(ret));
if (!ret && trans_was_restarted(trans, restart_count))
ret = -BCH_ERR_transaction_restart_nested;
return ret;
printbuf_exit(&buf);
if (ret && !bch2_err_matches(ret, BCH_ERR_transaction_restart))
- bch_err(c, "error from check_target(): %s", bch2_err_str(ret));
+ bch_err(c, "%s(): error %s", __func__, bch2_err_str(ret));
return ret;
}
printbuf_exit(&buf);
if (ret && !bch2_err_matches(ret, BCH_ERR_transaction_restart))
- bch_err(c, "error from check_dirent(): %s", bch2_err_str(ret));
+ bch_err(c, "%s(): error %s", __func__, bch2_err_str(ret));
return ret;
}
inode_walker_exit(&target);
if (ret)
- bch_err(c, "error from check_dirents(): %s", bch2_err_str(ret));
+ bch_err(c, "%s(): error %s", __func__, bch2_err_str(ret));
return ret;
}
ret = hash_check_key(trans, bch2_xattr_hash_desc, hash_info, iter, k);
fsck_err:
if (ret && !bch2_err_matches(ret, BCH_ERR_transaction_restart))
- bch_err(c, "error from check_xattr(): %s", bch2_err_str(ret));
+ bch_err(c, "%s(): error %s", __func__, bch2_err_str(ret));
return ret;
}
bch2_trans_exit(&trans);
if (ret)
- bch_err(c, "error from check_xattrs(): %s", bch2_err_str(ret));
+ bch_err(c, "%s(): error %s", __func__, bch2_err_str(ret));
return ret;
}
bch2_btree_iter_traverse(&iter) ?:
bch2_trans_update(&trans, &iter, &k.k_i, 0));
if (ret) {
- bch_err(c, "update error in test_delete: %s", bch2_err_str(ret));
+ bch_err(c, "%s(): update error in: %s", __func__, bch2_err_str(ret));
goto err;
}
bch2_btree_iter_traverse(&iter) ?:
bch2_btree_delete_at(&trans, &iter, 0));
if (ret) {
- bch_err(c, "delete error (first) in test_delete: %s", bch2_err_str(ret));
+ bch_err(c, "%s(): delete error (first): %s", __func__, bch2_err_str(ret));
goto err;
}
bch2_btree_iter_traverse(&iter) ?:
bch2_btree_delete_at(&trans, &iter, 0));
if (ret) {
- bch_err(c, "delete error (second) in test_delete: %s", bch2_err_str(ret));
+ bch_err(c, "%s(): delete error (second): %s", __func__, bch2_err_str(ret));
goto err;
}
err:
bch2_btree_iter_traverse(&iter) ?:
bch2_trans_update(&trans, &iter, &k.k_i, 0));
if (ret) {
- bch_err(c, "update error in test_delete_written: %s", bch2_err_str(ret));
+ bch_err(c, "%s(): update error: %s", __func__, bch2_err_str(ret));
goto err;
}
bch2_btree_iter_traverse(&iter) ?:
bch2_btree_delete_at(&trans, &iter, 0));
if (ret) {
- bch_err(c, "delete error in test_delete_written: %s", bch2_err_str(ret));
+ bch_err(c, "%s(): delete error: %s", __func__, bch2_err_str(ret));
goto err;
}
err:
ret = bch2_btree_insert(c, BTREE_ID_xattrs, &k.k_i,
NULL, NULL, 0);
if (ret) {
- bch_err(c, "insert error in test_iterate: %s", bch2_err_str(ret));
+ bch_err(c, "%s(): insert error: %s", __func__, bch2_err_str(ret));
goto err;
}
}
ret = bch2_btree_insert(c, BTREE_ID_extents, &k.k_i,
NULL, NULL, 0);
if (ret) {
- bch_err(c, "insert error in test_iterate_extents: %s", bch2_err_str(ret));
+ bch_err(c, "%s(): insert error: %s", __func__, bch2_err_str(ret));
goto err;
}
}
ret = bch2_btree_insert(c, BTREE_ID_xattrs, &k.k_i,
NULL, NULL, 0);
if (ret) {
- bch_err(c, "insert error in test_iterate_slots: %s", bch2_err_str(ret));
+ bch_err(c, "%s(): insert error: %s", __func__, bch2_err_str(ret));
goto err;
}
}
ret = bch2_btree_insert(c, BTREE_ID_extents, &k.k_i,
NULL, NULL, 0);
if (ret) {
- bch_err(c, "insert error in test_iterate_slots_extents: %s", bch2_err_str(ret));
+ bch_err(c, "%s(): insert error: %s", __func__, bch2_err_str(ret));
goto err;
}
}
ret = bch2_btree_insert(c, BTREE_ID_extents, &k.k_i,
NULL, NULL, 0);
if (ret)
- bch_err(c, "insert error in insert_test_extent: %s", bch2_err_str(ret));
+ bch_err(c, "%s(): insert error: %s", __func__, bch2_err_str(ret));
return ret;
}
ret = test_snapshot_filter(c, snapids[0], snapids[1]);
if (ret) {
- bch_err(c, "err from test_snapshot_filter: %s", bch2_err_str(ret));
+ bch_err(c, "%s(): err from test_snapshot_filter: %s", __func__, bch2_err_str(ret));
return ret;
}
static u64 test_rand(void)
{
u64 v;
-#if 0
- v = prandom_u32_max(U32_MAX);
-#else
+
get_random_bytes(&v, sizeof(v));
-#endif
return v;
}
ret = commit_do(&trans, NULL, NULL, 0,
__bch2_btree_insert(&trans, BTREE_ID_xattrs, &k.k_i));
if (ret) {
- bch_err(c, "error in rand_insert: %s", bch2_err_str(ret));
+ bch_err(c, "%s(): error %s", __func__, bch2_err_str(ret));
break;
}
}
__bch2_btree_insert(&trans, BTREE_ID_xattrs, &k[6].k_i) ?:
__bch2_btree_insert(&trans, BTREE_ID_xattrs, &k[7].k_i));
if (ret) {
- bch_err(c, "error in rand_insert_multi: %s", bch2_err_str(ret));
+ bch_err(c, "%s(): error %s", __func__, bch2_err_str(ret));
break;
}
}
lockrestart_do(&trans, bkey_err(k = bch2_btree_iter_peek(&iter)));
ret = bkey_err(k);
if (ret) {
- bch_err(c, "error in rand_lookup: %s", bch2_err_str(ret));
+ bch_err(c, "%s(): error %s", __func__, bch2_err_str(ret));
break;
}
}
k = bch2_btree_iter_peek(iter);
ret = bkey_err(k);
if (ret && !bch2_err_matches(ret, BCH_ERR_transaction_restart))
- bch_err(trans->c, "lookup error in rand_mixed: %s", bch2_err_str(ret));
+ bch_err(trans->c, "%s(): lookup error: %s", __func__, bch2_err_str(ret));
if (ret)
return ret;
ret = commit_do(&trans, NULL, NULL, 0,
rand_mixed_trans(&trans, &iter, &cookie, i, rand));
if (ret) {
- bch_err(c, "update error in rand_mixed: %s", bch2_err_str(ret));
+ bch_err(c, "%s(): update error: %s", __func__, bch2_err_str(ret));
break;
}
}
ret = commit_do(&trans, NULL, NULL, 0,
__do_delete(&trans, pos));
if (ret) {
- bch_err(c, "error in rand_delete: %s", bch2_err_str(ret));
+ bch_err(c, "%s(): error %s", __func__, bch2_err_str(ret));
break;
}
}
bch2_trans_update(&trans, &iter, &insert.k_i, 0);
}));
if (ret)
- bch_err(c, "error in %s(): %s", __func__, bch2_err_str(ret));
+ bch_err(c, "%s(): error %s", __func__, bch2_err_str(ret));
bch2_trans_exit(&trans);
return ret;
SPOS(0, 0, U32_MAX), 0, k,
0);
if (ret)
- bch_err(c, "error in %s(): %s", __func__, bch2_err_str(ret));
+ bch_err(c, "%s(): error %s", __func__, bch2_err_str(ret));
bch2_trans_exit(&trans);
return ret;
bch2_trans_update(&trans, &iter, &u.k_i, 0);
}));
if (ret)
- bch_err(c, "error in %s(): %s", __func__, bch2_err_str(ret));
+ bch_err(c, "%s(): error %s", __func__, bch2_err_str(ret));
bch2_trans_exit(&trans);
return ret;
SPOS(0, 0, U32_MAX), SPOS_MAX,
0, NULL);
if (ret)
- bch_err(c, "error in seq_delete: %s", bch2_err_str(ret));
+ bch_err(c, "%s(): error %s", __func__, bch2_err_str(ret));
return ret;
}