calculate the number of blocks in a metadata device properly

This commit is contained in:
Joe Thornber
2011-09-02 15:22:46 +01:00
parent f8aab12baf
commit 6da9ce9ef7
2 changed files with 48 additions and 4 deletions

View File

@@ -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;
}
}
//----------------------------------------------------------------