mirror of
https://github.com/ceph/ceph
synced 2025-02-24 19:47:44 +00:00
PeeringState::clamp_recovery_priority: use std::clamp
Signed-off-by: Samuel Just <sjust@redhat.com>
This commit is contained in:
parent
d29548aca8
commit
8302349296
@ -992,13 +992,7 @@ int PeeringState::clamp_recovery_priority(int priority, int pool_recovery_priori
|
||||
priority += pool_recovery_priority;
|
||||
|
||||
// Clamp to valid range
|
||||
if (priority > max) {
|
||||
return max;
|
||||
} else if (priority < OSD_RECOVERY_PRIORITY_MIN) {
|
||||
return OSD_RECOVERY_PRIORITY_MIN;
|
||||
} else {
|
||||
return priority;
|
||||
}
|
||||
return std::clamp<int>(priority, OSD_RECOVERY_PRIORITY_MIN, max);
|
||||
}
|
||||
|
||||
unsigned PeeringState::get_recovery_priority()
|
||||
|
Loading…
Reference in New Issue
Block a user