MCPcopy Create free account
hub / github.com/ceph/ceph / from_desc

Method from_desc

src/blk/kernel/KernelDevice.cc:1375–1390  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1373
1374
1375HugePagePoolOfPools HugePagePoolOfPools::from_desc(const std::string& desc) {
1376 std::map<size_t, size_t> conf; // buffer_size -> buffers_in_pool
1377 std::map<std::string, std::string> exploded_str_conf;
1378 get_str_map(desc, &exploded_str_conf);
1379 for (const auto& [buffer_size_s, buffers_in_pool_s] : exploded_str_conf) {
1380 size_t buffer_size, buffers_in_pool;
1381 if (sscanf(buffer_size_s.c_str(), "%zu", &buffer_size) != 1) {
1382 ceph_abort("can't parse a key in the configuration");
1383 }
1384 if (sscanf(buffers_in_pool_s.c_str(), "%zu", &buffers_in_pool) != 1) {
1385 ceph_abort("can't parse a value in the configuration");
1386 }
1387 conf[buffer_size] = buffers_in_pool;
1388 }
1389 return HugePagePoolOfPools{std::move(conf)};
1390}
1391
1392// create a buffer basing on user-configurable. it's intended to make
1393// our buffers THP-able.

Callers

nothing calls this directly

Calls 2

get_str_mapFunction · 0.85
c_strMethod · 0.45

Tested by

no test coverage detected