table: Use smp::all_cpus() to iterate over all CPUs locally

Currently it uses irange(0, smp::count0), but seastar provides
convenient helper call for the very same range object.

Signed-off-by: Pavel Emelyanov <xemul@scylladb.com>
This commit is contained in:
Pavel Emelyanov
2024-04-17 15:36:51 +03:00
parent a3481a4566
commit 0d2178202d

View File

@@ -2286,7 +2286,7 @@ future<> table::snapshot_on_all_shards(sharded<database>& sharded_db, const glob
std::vector<table::snapshot_file_set> file_sets;
file_sets.reserve(smp::count);
co_await coroutine::parallel_for_each(boost::irange(0u, smp::count), [&] (unsigned shard) -> future<> {
co_await coroutine::parallel_for_each(smp::all_cpus(), [&] (unsigned shard) -> future<> {
file_sets.emplace_back(co_await smp::submit_to(shard, [&] {
return table_shards->take_snapshot(sharded_db.local(), jsondir);
}));