Skip to content

Commit

Permalink
733: review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
komarevtsev-d committed Mar 14, 2024
1 parent 6b56b20 commit e863674
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ void TDiskAgentActor::RenderDevices(IOutputStream& out) const
config.GetState(),
State->IsDeviceDisabled(uuid)
? EDeviceStateFlags::DISABLED
: 0);
: EDeviceStateFlags::NONE);
}
TABLED() {
if (config.GetStateTs()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ IOutputStream& DumpDiskState(
IOutputStream& DumpDeviceState(
IOutputStream& out,
NProto::EDeviceState state,
uint16_t flags,
EDeviceStateFlags flags,
TString suffix)
{
switch (state) {
Expand Down
13 changes: 12 additions & 1 deletion cloud/blockstore/libs/storage/disk_common/monitoring_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ enum EDeviceStateFlags : uint16_t
SUSPENDED = 1 << 3,
};

inline EDeviceStateFlags operator|(EDeviceStateFlags a, EDeviceStateFlags b)
{
return static_cast<EDeviceStateFlags>(
static_cast<uint16_t>(a) | static_cast<uint16_t>(b));
}

inline EDeviceStateFlags& operator|=(EDeviceStateFlags& a, EDeviceStateFlags b)
{
return a = a | b;
}

////////////////////////////////////////////////////////////////////////////////

IOutputStream& DumpAgentState(
Expand All @@ -30,7 +41,7 @@ IOutputStream& DumpDiskState(
IOutputStream& DumpDeviceState(
IOutputStream& out,
NProto::EDeviceState state,
uint16_t flags = EDeviceStateFlags::NONE,
EDeviceStateFlags flags = EDeviceStateFlags::NONE,
TString suffix = "");

} // namespace NCloud::NBlockStore::NStorage
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ namespace {

////////////////////////////////////////////////////////////////////////////////

uint16_t GetDeviceStateFlags(
EDeviceStateFlags GetDeviceStateFlags(
const TDiskRegistryState& state,
const TString& deviceUUID)
{
uint16_t deviceStateFlags = EDeviceStateFlags::NONE;
EDeviceStateFlags deviceStateFlags = EDeviceStateFlags::NONE;
if (state.IsDirtyDevice(deviceUUID)) {
deviceStateFlags |= EDeviceStateFlags::DIRTY;
}
Expand Down Expand Up @@ -668,7 +668,7 @@ void TDiskRegistryActor::RenderDiskHtmlInfo(
}
}
TABLED() {
uint16_t flags =
EDeviceStateFlags flags =
GetDeviceStateFlags(*State, device.GetDeviceUUID());
if (FindPtr(
info.MasterDiskId ? masterDiskInfo.DeviceReplacementIds
Expand Down

0 comments on commit e863674

Please sign in to comment.