| 449 | } |
| 450 | |
| 451 | bool MgrStatMonitor::preprocess_getpoolstats(MonOpRequestRef op) |
| 452 | { |
| 453 | op->mark_pgmon_event(__func__); |
| 454 | auto m = op->get_req<MGetPoolStats>(); |
| 455 | auto session = op->get_session(); |
| 456 | if (!session) |
| 457 | return true; |
| 458 | if (!session->is_capable("pg", MON_CAP_R)) { |
| 459 | dout(0) << "MGetPoolStats received from entity with insufficient caps " |
| 460 | << session->caps << dendl; |
| 461 | return true; |
| 462 | } |
| 463 | if (m->fsid != mon.monmap->fsid) { |
| 464 | dout(0) << __func__ << " on fsid " |
| 465 | << m->fsid << " != " << mon.monmap->fsid << dendl; |
| 466 | return true; |
| 467 | } |
| 468 | epoch_t ver = get_last_committed(); |
| 469 | auto reply = new MGetPoolStatsReply(m->fsid, m->get_tid(), ver); |
| 470 | reply->per_pool = digest.use_per_pool_stats(); |
| 471 | for (const auto& pool_name : m->pools) { |
| 472 | const auto pool_id = mon.osdmon()->osdmap.lookup_pg_pool_name(pool_name); |
| 473 | if (pool_id == -ENOENT) |
| 474 | continue; |
| 475 | auto pool_stat = get_pool_stat(pool_id); |
| 476 | if (!pool_stat) |
| 477 | continue; |
| 478 | reply->pool_stats[pool_name] = *pool_stat; |
| 479 | } |
| 480 | mon.send_reply(op, reply); |
| 481 | return true; |
| 482 | } |
| 483 | |
| 484 | bool MgrStatMonitor::preprocess_statfs(MonOpRequestRef op) |
| 485 | { |
nothing calls this directly
no test coverage detected