summaryrefslogtreecommitdiff
path: root/volumes.c
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@redhat.com>2013-04-26 16:06:07 -0500
committerDavid Sterba <dsterba@suse.cz>2013-08-09 14:32:28 +0200
commitba4f8cb41141ce5c03eb480c66ef7730eecf2efd (patch)
tree92c05d43d48f855a13a3bf2954c71d9711b7ab29 /volumes.c
parent37003d3627369162e05f95e8b3b244a012a46589 (diff)
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 <miaox@cn.fujitsu.com> Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'volumes.c')
-rw-r--r--volumes.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/volumes.c b/volumes.c
index 0ff22833..10fdc487 100644
--- a/volumes.c
+++ b/volumes.c
@@ -29,6 +29,7 @@
#include "transaction.h"
#include "print-tree.h"
#include "volumes.h"
+#include "math.h"
struct stripe {
struct btrfs_device *dev;
@@ -630,14 +631,6 @@ int btrfs_add_system_chunk(struct btrfs_trans_handle *trans,
return 0;
}
-static u64 div_factor(u64 num, int factor)
-{
- if (factor == 10)
- return num;
- num *= factor;
- return num / 10;
-}
-
static u64 chunk_bytes_by_type(u64 type, u64 calc_size, int num_stripes,
int sub_stripes)
{