|
@@ -25,7 +25,6 @@
|
|
#include <linux/capability.h>
|
|
#include <linux/capability.h>
|
|
#include <linux/ratelimit.h>
|
|
#include <linux/ratelimit.h>
|
|
#include <linux/kthread.h>
|
|
#include <linux/kthread.h>
|
|
-#include <asm/div64.h>
|
|
|
|
#include "compat.h"
|
|
#include "compat.h"
|
|
#include "ctree.h"
|
|
#include "ctree.h"
|
|
#include "extent_map.h"
|
|
#include "extent_map.h"
|
|
@@ -36,6 +35,7 @@
|
|
#include "async-thread.h"
|
|
#include "async-thread.h"
|
|
#include "check-integrity.h"
|
|
#include "check-integrity.h"
|
|
#include "rcu-string.h"
|
|
#include "rcu-string.h"
|
|
|
|
+#include "math.h"
|
|
|
|
|
|
static int init_first_rw_device(struct btrfs_trans_handle *trans,
|
|
static int init_first_rw_device(struct btrfs_trans_handle *trans,
|
|
struct btrfs_root *root,
|
|
struct btrfs_root *root,
|
|
@@ -2338,18 +2338,6 @@ static int chunk_profiles_filter(u64 chunk_type,
|
|
return 1;
|
|
return 1;
|
|
}
|
|
}
|
|
|
|
|
|
-static u64 div_factor_fine(u64 num, int factor)
|
|
|
|
-{
|
|
|
|
- if (factor <= 0)
|
|
|
|
- return 0;
|
|
|
|
- if (factor >= 100)
|
|
|
|
- return num;
|
|
|
|
-
|
|
|
|
- num *= factor;
|
|
|
|
- do_div(num, 100);
|
|
|
|
- return num;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
static int chunk_usage_filter(struct btrfs_fs_info *fs_info, u64 chunk_offset,
|
|
static int chunk_usage_filter(struct btrfs_fs_info *fs_info, u64 chunk_offset,
|
|
struct btrfs_balance_args *bargs)
|
|
struct btrfs_balance_args *bargs)
|
|
{
|
|
{
|
|
@@ -2514,15 +2502,6 @@ static int should_balance_chunk(struct btrfs_root *root,
|
|
return 1;
|
|
return 1;
|
|
}
|
|
}
|
|
|
|
|
|
-static u64 div_factor(u64 num, int factor)
|
|
|
|
-{
|
|
|
|
- if (factor == 10)
|
|
|
|
- return num;
|
|
|
|
- num *= factor;
|
|
|
|
- do_div(num, 10);
|
|
|
|
- return num;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
static int __btrfs_balance(struct btrfs_fs_info *fs_info)
|
|
static int __btrfs_balance(struct btrfs_fs_info *fs_info)
|
|
{
|
|
{
|
|
struct btrfs_balance_control *bctl = fs_info->balance_ctl;
|
|
struct btrfs_balance_control *bctl = fs_info->balance_ctl;
|