calculate the number of blocks in a metadata device properly
This commit is contained in:
@@ -9,6 +9,13 @@ namespace base {
|
||||
T div_up(T const &v, T const &divisor) {
|
||||
return (v + (divisor - 1)) / divisor;
|
||||
}
|
||||
|
||||
// Seemingly pointless function, but it coerces the arguments
|
||||
// nicely.
|
||||
template <typename T>
|
||||
T div_down(T const &v, T const &divisor) {
|
||||
return v / divisor;
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user