From 743011fbac672c488e54b843bf8a759bef10862e Mon Sep 17 00:00:00 2001 From: "Jose R. Santos" Date: Mon, 1 Jun 2009 16:15:40 -0400 Subject: [PATCH] Add ext2fs_div64_ceil() Add a new div_cell routine able to handle 64bit values Signed-off-by: Jose R. Santos Signed-off-by: "Theodore Ts'o" --- lib/ext2fs/ext2fs.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/ext2fs/ext2fs.h b/lib/ext2fs/ext2fs.h index d53d613..87a0ab7 100644 --- a/lib/ext2fs/ext2fs.h +++ b/lib/ext2fs/ext2fs.h @@ -1255,6 +1255,7 @@ extern blk_t ext2fs_group_last_block(ext2_filsys fs, dgrp_t group); extern blk_t ext2fs_inode_data_blocks(ext2_filsys fs, struct ext2_inode *inode); extern unsigned int ext2fs_div_ceil(unsigned int a, unsigned int b); +extern __u64 ext2fs_div64_ceil(__u64 a, __u64 b); /* * The actual inlined functions definitions themselves... @@ -1455,6 +1456,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 -- 1.8.3.1