Remove separate storage of PG counts in pg_counts

This commit is contained in:
Vitaliy Filippov
2026-01-25 12:26:49 +03:00
parent c4c17ee6fb
commit 9a6a7b7f75
9 changed files with 60 additions and 44 deletions
+2 -3
View File
@@ -35,15 +35,14 @@ bool osd_t::prepare_primary_rw(osd_op_t *cur_op)
// oid.stripe = starting offset of the parity stripe
.stripe = (cur_op->req.rw.offset/pg_block_size)*pg_block_size,
};
// FIXME: pg_counts should be stored in pool_config, not in a separate map
auto pg_count = pg_counts[pool_id];
auto pg_count = pool_cfg.applied_pg_count;
if (!pg_count)
{
// Pool config is not loaded yet
finish_op(cur_op, -EPIPE);
return false;
}
pg_num_t pg_num = (oid.stripe/pool_cfg.pg_stripe_size) % pg_count + 1; // like map_to_pg()
pg_num_t pg_num = (oid.stripe/pool_cfg.applied_pg_stripe_size) % pg_count + 1; // like map_to_pg()
auto pg_it = pgs.find({ .pool_id = pool_id, .pg_num = pg_num });
if (pg_it == pgs.end() || pg_it->second.state == PG_OFFLINE)
{