[PATCH 12/15][e2fsprogs] Add ext2fs_div64_ceil()

Jose R. Santos
2008-07-15T16:51:15Z

From: Jose R. Santos <jrs@us.ibm.com>

Add ext2fs_div64_ceil()

Add a new div_cell routine able to handle 64bit values

Signed-off-by: Jose R. Santos <jrs@us.ibm.com>
--

lib/ext2fs/ext2fs.h | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/lib/ext2fs/ext2fs.h b/lib/ext2fs/ext2fs.h
index 0ca978b..3bc866e 100644
--- a/lib/ext2fs/ext2fs.h
+++ b/lib/ext2fs/ext2fs.h
@@ -1409,6 +1409,14 @@ _INLINE_ unsigned int ext2fs_div_ceil(unsigned int a, unsigned int b)
return 0;
return ((a - 1) / b) + 1;
}
+
+_INLINE_ __u64 ext2fs_div64_ceil(__u64 a, __u64 b)
+{
+ if (!a)
+ return 0;
+ return ((a - 1) / b) + 1;
+}
+
#undef _INLINE_
#endif