mirror of
https://github.com/deepseek-ai/3FS
synced 2025-06-26 18:16:45 +00:00
explicit down cast (#46)
Newer clang does not allow down cast with brace initialization. Replace them with C-style cast.
This commit is contained in:
@@ -124,7 +124,7 @@ bool runBenchmarks() {
|
|||||||
auto nodeIdStr = nodeEndpointStrs[0];
|
auto nodeIdStr = nodeEndpointStrs[0];
|
||||||
auto endpointStr = nodeEndpointStrs[1];
|
auto endpointStr = nodeEndpointStrs[1];
|
||||||
|
|
||||||
NodeId nodeId{std::stoul(nodeIdStr)};
|
auto nodeId = (NodeId)std::stoul(nodeIdStr);
|
||||||
auto endpoint = net::Address::fromString(endpointStr);
|
auto endpoint = net::Address::fromString(endpointStr);
|
||||||
storageEndpoints[nodeId] = endpoint;
|
storageEndpoints[nodeId] = endpoint;
|
||||||
XLOGF(WARN, "Add storage endpoint: {} @ {}", nodeId, endpoint);
|
XLOGF(WARN, "Add storage endpoint: {} @ {}", nodeId, endpoint);
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ static monitor::CountRecorder num_update_channels_total{"storage_client.num_upda
|
|||||||
UpdateChannelAllocator::UpdateChannelAllocator(size_t numChannels)
|
UpdateChannelAllocator::UpdateChannelAllocator(size_t numChannels)
|
||||||
: numChannels_(std::min(kMaxNumChannels, numChannels)) {
|
: numChannels_(std::min(kMaxNumChannels, numChannels)) {
|
||||||
std::scoped_lock lock(availableChannelMutex_);
|
std::scoped_lock lock(availableChannelMutex_);
|
||||||
for (uint32_t id = numChannels_; id > 0; id--) {
|
for (auto id = (ChannelId)numChannels_; id > 0; id--) {
|
||||||
availableChannelIds_.push(ChannelId{id});
|
availableChannelIds_.push(id);
|
||||||
num_update_channels_total.addSample(1);
|
num_update_channels_total.addSample(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ Result<meta::Inode> UserConfig::statConfig(meta::InodeId iid, const meta::UserIn
|
|||||||
auto key = isSys ? systemKeys[kidx] : userKeys[kidx];
|
auto key = isSys ? systemKeys[kidx] : userKeys[kidx];
|
||||||
return meta::Inode{iid,
|
return meta::Inode{iid,
|
||||||
{meta::Symlink{config.find(key).value()->toString()},
|
{meta::Symlink{config.find(key).value()->toString()},
|
||||||
meta::Acl{ui.uid, ui.gid, meta::Permission{isSys ? 0444 : 0400}}}};
|
meta::Acl{ui.uid, ui.gid, meta::Permission{isSys ? 0444u : 0400u}}}};
|
||||||
}
|
}
|
||||||
|
|
||||||
std::pair<std::shared_ptr<std::vector<meta::DirEntry>>, std::shared_ptr<std::vector<std::optional<meta::Inode>>>>
|
std::pair<std::shared_ptr<std::vector<meta::DirEntry>>, std::shared_ptr<std::vector<std::optional<meta::Inode>>>>
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ auto createStorageEventTrace(size_t id) {
|
|||||||
ClientId::zero(),
|
ClientId::zero(),
|
||||||
storage::RequestId{id},
|
storage::RequestId{id},
|
||||||
storage::UpdateChannel{
|
storage::UpdateChannel{
|
||||||
.id = storage::ChannelId{id},
|
.id = (storage::ChannelId)id,
|
||||||
.seqnum = storage::ChannelSeqNum{id},
|
.seqnum = storage::ChannelSeqNum{id},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -375,7 +375,7 @@ bool UnitTestFabric::setUpStorageSystem() {
|
|||||||
|
|
||||||
if (!setupConfig_.start_storage_server()) {
|
if (!setupConfig_.start_storage_server()) {
|
||||||
for (auto &[key, value] : storageEndpoints) {
|
for (auto &[key, value] : storageEndpoints) {
|
||||||
nodeEndpoints[storage::NodeId{std::stoul(key)}] = value;
|
nodeEndpoints[(storage::NodeId)std::stoul(key)] = value;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (uint32_t nodeIndex = 0; nodeIndex < numStorageNodes; nodeIndex++) {
|
for (uint32_t nodeIndex = 0; nodeIndex < numStorageNodes; nodeIndex++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user