From ba4f8cb41141ce5c03eb480c66ef7730eecf2efd Mon Sep 17 00:00:00 2001 From: Eric Sandeen Date: Fri, 26 Apr 2013 16:06:07 -0500 Subject: Btrfs-progs: cleanup duplicated division functions div_factor has been implemented for two times, cleanup it. And I move them into a independent file named math.h because they are common math functions. [Eric Sandeen: port kernel commit 3fed40c to userspace] Signed-off-by: Miao Xie Signed-off-by: Eric Sandeen Signed-off-by: David Sterba Signed-off-by: Chris Mason --- extent-tree.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'extent-tree.c') diff --git a/extent-tree.c b/extent-tree.c index 63b1a38..e458268 100644 --- a/extent-tree.c +++ b/extent-tree.c @@ -27,6 +27,7 @@ #include "crc32c.h" #include "volumes.h" #include "free-space-cache.h" +#include "math.h" #define PENDING_EXTENT_INSERT 0 #define PENDING_EXTENT_DELETE 1 @@ -300,15 +301,6 @@ wrapped: goto again; } -static u64 div_factor(u64 num, int factor) -{ - if (factor == 10) - return num; - num *= factor; - num /= 10; - return num; -} - static int block_group_state_bits(u64 flags) { int bits = 0; -- cgit v1.2.1