• Home
  • Raw
  • Download

Lines Matching refs:bctl

3449 			       struct btrfs_balance_control *bctl)  in insert_balance_item()  argument
3484 btrfs_cpu_balance_args_to_disk(&disk_bargs, &bctl->data); in insert_balance_item()
3486 btrfs_cpu_balance_args_to_disk(&disk_bargs, &bctl->meta); in insert_balance_item()
3488 btrfs_cpu_balance_args_to_disk(&disk_bargs, &bctl->sys); in insert_balance_item()
3491 btrfs_set_balance_flags(leaf, item, bctl->flags); in insert_balance_item()
3545 static void update_balance_args(struct btrfs_balance_control *bctl) in update_balance_args() argument
3550 if (bctl->data.flags & BTRFS_BALANCE_ARGS_CONVERT) in update_balance_args()
3551 bctl->data.flags |= BTRFS_BALANCE_ARGS_SOFT; in update_balance_args()
3552 if (bctl->sys.flags & BTRFS_BALANCE_ARGS_CONVERT) in update_balance_args()
3553 bctl->sys.flags |= BTRFS_BALANCE_ARGS_SOFT; in update_balance_args()
3554 if (bctl->meta.flags & BTRFS_BALANCE_ARGS_CONVERT) in update_balance_args()
3555 bctl->meta.flags |= BTRFS_BALANCE_ARGS_SOFT; in update_balance_args()
3564 if (!(bctl->data.flags & BTRFS_BALANCE_ARGS_USAGE) && in update_balance_args()
3565 !(bctl->data.flags & BTRFS_BALANCE_ARGS_USAGE_RANGE) && in update_balance_args()
3566 !(bctl->data.flags & BTRFS_BALANCE_ARGS_CONVERT)) { in update_balance_args()
3567 bctl->data.flags |= BTRFS_BALANCE_ARGS_USAGE; in update_balance_args()
3568 bctl->data.usage = 90; in update_balance_args()
3570 if (!(bctl->sys.flags & BTRFS_BALANCE_ARGS_USAGE) && in update_balance_args()
3571 !(bctl->sys.flags & BTRFS_BALANCE_ARGS_USAGE_RANGE) && in update_balance_args()
3572 !(bctl->sys.flags & BTRFS_BALANCE_ARGS_CONVERT)) { in update_balance_args()
3573 bctl->sys.flags |= BTRFS_BALANCE_ARGS_USAGE; in update_balance_args()
3574 bctl->sys.usage = 90; in update_balance_args()
3576 if (!(bctl->meta.flags & BTRFS_BALANCE_ARGS_USAGE) && in update_balance_args()
3577 !(bctl->meta.flags & BTRFS_BALANCE_ARGS_USAGE_RANGE) && in update_balance_args()
3578 !(bctl->meta.flags & BTRFS_BALANCE_ARGS_CONVERT)) { in update_balance_args()
3579 bctl->meta.flags |= BTRFS_BALANCE_ARGS_USAGE; in update_balance_args()
3580 bctl->meta.usage = 90; in update_balance_args()
3589 struct btrfs_balance_control *bctl = fs_info->balance_ctl; in reset_balance_state() local
3598 kfree(bctl); in reset_balance_state()
3785 struct btrfs_balance_control *bctl = fs_info->balance_ctl; in should_balance_chunk() local
3791 (bctl->flags & BTRFS_BALANCE_TYPE_MASK))) { in should_balance_chunk()
3796 bargs = &bctl->data; in should_balance_chunk()
3798 bargs = &bctl->sys; in should_balance_chunk()
3800 bargs = &bctl->meta; in should_balance_chunk()
3872 struct btrfs_balance_control *bctl = fs_info->balance_ctl; in __btrfs_balance() local
3885 u64 limit_data = bctl->data.limit; in __btrfs_balance()
3886 u64 limit_meta = bctl->meta.limit; in __btrfs_balance()
3887 u64 limit_sys = bctl->sys.limit; in __btrfs_balance()
3901 memset(&bctl->stat, 0, sizeof(bctl->stat)); in __btrfs_balance()
3909 bctl->data.limit = limit_data; in __btrfs_balance()
3910 bctl->meta.limit = limit_meta; in __btrfs_balance()
3911 bctl->sys.limit = limit_sys; in __btrfs_balance()
3960 bctl->stat.considered++; in __btrfs_balance()
3975 bctl->stat.expected++; in __btrfs_balance()
3993 count_data < bctl->data.limit_min) in __btrfs_balance()
3995 count_meta < bctl->meta.limit_min) in __btrfs_balance()
3997 count_sys < bctl->sys.limit_min)) { in __btrfs_balance()
4032 bctl->stat.completed++; in __btrfs_balance()
4223 struct btrfs_balance_control *bctl = fs_info->balance_ctl; in describe_balance_start_or_resume() local
4240 if (bctl->flags & BTRFS_BALANCE_FORCE) in describe_balance_start_or_resume()
4243 if (bctl->flags & BTRFS_BALANCE_DATA) { in describe_balance_start_or_resume()
4244 describe_balance_args(&bctl->data, tmp_buf, sizeof(tmp_buf)); in describe_balance_start_or_resume()
4248 if (bctl->flags & BTRFS_BALANCE_METADATA) { in describe_balance_start_or_resume()
4249 describe_balance_args(&bctl->meta, tmp_buf, sizeof(tmp_buf)); in describe_balance_start_or_resume()
4253 if (bctl->flags & BTRFS_BALANCE_SYSTEM) { in describe_balance_start_or_resume()
4254 describe_balance_args(&bctl->sys, tmp_buf, sizeof(tmp_buf)); in describe_balance_start_or_resume()
4265 (bctl->flags & BTRFS_BALANCE_RESUME) ? in describe_balance_start_or_resume()
4275 struct btrfs_balance_control *bctl, in btrfs_balance() argument
4303 if (mixed && (bctl->flags & allowed)) { in btrfs_balance()
4304 if (!(bctl->flags & BTRFS_BALANCE_DATA) || in btrfs_balance()
4305 !(bctl->flags & BTRFS_BALANCE_METADATA) || in btrfs_balance()
4306 memcmp(&bctl->data, &bctl->meta, sizeof(bctl->data))) { in btrfs_balance()
4330 if (!validate_convert_profile(fs_info, &bctl->data, allowed, "data") || in btrfs_balance()
4331 !validate_convert_profile(fs_info, &bctl->meta, allowed, "metadata") || in btrfs_balance()
4332 !validate_convert_profile(fs_info, &bctl->sys, allowed, "system")) { in btrfs_balance()
4350 if (((bctl->sys.flags & BTRFS_BALANCE_ARGS_CONVERT) && in btrfs_balance()
4352 !(bctl->sys.target & allowed)) || in btrfs_balance()
4353 ((bctl->meta.flags & BTRFS_BALANCE_ARGS_CONVERT) && in btrfs_balance()
4355 !(bctl->meta.target & allowed))) in btrfs_balance()
4361 meta_target = (bctl->meta.flags & BTRFS_BALANCE_ARGS_CONVERT) ? in btrfs_balance()
4362 bctl->meta.target : fs_info->avail_metadata_alloc_bits; in btrfs_balance()
4363 data_target = (bctl->data.flags & BTRFS_BALANCE_ARGS_CONVERT) ? in btrfs_balance()
4364 bctl->data.target : fs_info->avail_data_alloc_bits; in btrfs_balance()
4368 if (bctl->flags & BTRFS_BALANCE_FORCE) { in btrfs_balance()
4387 ret = insert_balance_item(fs_info, bctl); in btrfs_balance()
4391 if (!(bctl->flags & BTRFS_BALANCE_RESUME)) { in btrfs_balance()
4395 fs_info->balance_ctl = bctl; in btrfs_balance()
4400 update_balance_args(bctl); in btrfs_balance()
4451 if (bctl->flags & BTRFS_BALANCE_RESUME) in btrfs_balance()
4454 kfree(bctl); in btrfs_balance()
4506 struct btrfs_balance_control *bctl; in btrfs_recover_balance() local
4530 bctl = kzalloc(sizeof(*bctl), GFP_NOFS); in btrfs_recover_balance()
4531 if (!bctl) { in btrfs_recover_balance()
4539 bctl->flags = btrfs_balance_flags(leaf, item); in btrfs_recover_balance()
4540 bctl->flags |= BTRFS_BALANCE_RESUME; in btrfs_recover_balance()
4543 btrfs_disk_balance_args_to_cpu(&bctl->data, &disk_bargs); in btrfs_recover_balance()
4545 btrfs_disk_balance_args_to_cpu(&bctl->meta, &disk_bargs); in btrfs_recover_balance()
4547 btrfs_disk_balance_args_to_cpu(&bctl->sys, &disk_bargs); in btrfs_recover_balance()
4568 fs_info->balance_ctl = bctl; in btrfs_recover_balance()