new = kmalloc_array(BKEY_BTREE_PTR_U64s_MAX, sizeof(u64), GFP_KERNEL);
if (!new)
- return -ENOMEM;
+ return -BCH_ERR_ENOMEM_gc_repair_key;
btree_ptr_to_v2(b, new);
b->data->min_key = new_min;
new = kmalloc_array(BKEY_BTREE_PTR_U64s_MAX, sizeof(u64), GFP_KERNEL);
if (!new)
- return -ENOMEM;
+ return -BCH_ERR_ENOMEM_gc_repair_key;
btree_ptr_to_v2(b, new);
b->data->max_key = new_max;
new = kmalloc(bkey_bytes(k->k), GFP_KERNEL);
if (!new) {
bch_err(c, "%s: error allocating new key", __func__);
- ret = -ENOMEM;
+ ret = -BCH_ERR_ENOMEM_gc_repair_key;
goto err;
}
sizeof(u64), GFP_KERNEL);
if (!c->usage_gc) {
bch_err(c, "error allocating c->usage_gc");
- return -ENOMEM;
+ return -BCH_ERR_ENOMEM_gc_start;
}
for_each_member_device(ca, c, i) {
if (!ca->usage_gc) {
bch_err(c, "error allocating ca->usage_gc");
percpu_ref_put(&ca->ref);
- return -ENOMEM;
+ return -BCH_ERR_ENOMEM_gc_start;
}
this_cpu_write(ca->usage_gc->d[BCH_DATA_free].buckets,
if (!buckets) {
percpu_ref_put(&ca->ref);
bch_err(c, "error allocating ca->buckets[gc]");
- return -ENOMEM;
+ return -BCH_ERR_ENOMEM_gc_alloc_start;
}
buckets->first_bucket = ca->mi.first_bucket;
r = genradix_ptr_alloc(&c->reflink_gc_table, c->reflink_gc_nr++,
GFP_KERNEL);
if (!r) {
- ret = -ENOMEM;
+ ret = -BCH_ERR_ENOMEM_gc_reflink_start;
break;
}
ca->oldest_gen = kvmalloc(ca->mi.nbuckets, GFP_KERNEL);
if (!ca->oldest_gen) {
percpu_ref_put(&ca->ref);
- ret = -ENOMEM;
+ ret = -BCH_ERR_ENOMEM_gc_gens;
goto err;
}