Lines Matching refs:bargs

3603 				 struct btrfs_balance_args *bargs)  in chunk_profiles_filter()  argument
3608 if (bargs->profiles & chunk_type) in chunk_profiles_filter()
3615 struct btrfs_balance_args *bargs) in chunk_usage_range_filter() argument
3626 if (bargs->usage_min == 0) in chunk_usage_range_filter()
3629 user_thresh_min = mult_perc(cache->length, bargs->usage_min); in chunk_usage_range_filter()
3631 if (bargs->usage_max == 0) in chunk_usage_range_filter()
3633 else if (bargs->usage_max > 100) in chunk_usage_range_filter()
3636 user_thresh_max = mult_perc(cache->length, bargs->usage_max); in chunk_usage_range_filter()
3646 u64 chunk_offset, struct btrfs_balance_args *bargs) in chunk_usage_filter() argument
3655 if (bargs->usage_min == 0) in chunk_usage_filter()
3657 else if (bargs->usage > 100) in chunk_usage_filter()
3660 user_thresh = mult_perc(cache->length, bargs->usage); in chunk_usage_filter()
3671 struct btrfs_balance_args *bargs) in chunk_devid_filter() argument
3679 if (btrfs_stripe_devid(leaf, stripe) == bargs->devid) in chunk_devid_filter()
3698 struct btrfs_balance_args *bargs) in chunk_drange_filter() argument
3708 if (!(bargs->flags & BTRFS_BALANCE_ARGS_DEVID)) in chunk_drange_filter()
3716 if (btrfs_stripe_devid(leaf, stripe) != bargs->devid) in chunk_drange_filter()
3723 if (stripe_offset < bargs->pend && in chunk_drange_filter()
3724 stripe_offset + stripe_length > bargs->pstart) in chunk_drange_filter()
3735 struct btrfs_balance_args *bargs) in chunk_vrange_filter() argument
3737 if (chunk_offset < bargs->vend && in chunk_vrange_filter()
3738 chunk_offset + btrfs_chunk_length(leaf, chunk) > bargs->vstart) in chunk_vrange_filter()
3747 struct btrfs_balance_args *bargs) in chunk_stripes_range_filter() argument
3751 if (bargs->stripes_min <= num_stripes in chunk_stripes_range_filter()
3752 && num_stripes <= bargs->stripes_max) in chunk_stripes_range_filter()
3759 struct btrfs_balance_args *bargs) in chunk_soft_convert_filter() argument
3761 if (!(bargs->flags & BTRFS_BALANCE_ARGS_CONVERT)) in chunk_soft_convert_filter()
3767 if (bargs->target == chunk_type) in chunk_soft_convert_filter()
3778 struct btrfs_balance_args *bargs = NULL; in should_balance_chunk() local
3788 bargs = &bctl->data; in should_balance_chunk()
3790 bargs = &bctl->sys; in should_balance_chunk()
3792 bargs = &bctl->meta; in should_balance_chunk()
3795 if ((bargs->flags & BTRFS_BALANCE_ARGS_PROFILES) && in should_balance_chunk()
3796 chunk_profiles_filter(chunk_type, bargs)) { in should_balance_chunk()
3801 if ((bargs->flags & BTRFS_BALANCE_ARGS_USAGE) && in should_balance_chunk()
3802 chunk_usage_filter(fs_info, chunk_offset, bargs)) { in should_balance_chunk()
3804 } else if ((bargs->flags & BTRFS_BALANCE_ARGS_USAGE_RANGE) && in should_balance_chunk()
3805 chunk_usage_range_filter(fs_info, chunk_offset, bargs)) { in should_balance_chunk()
3810 if ((bargs->flags & BTRFS_BALANCE_ARGS_DEVID) && in should_balance_chunk()
3811 chunk_devid_filter(leaf, chunk, bargs)) { in should_balance_chunk()
3816 if ((bargs->flags & BTRFS_BALANCE_ARGS_DRANGE) && in should_balance_chunk()
3817 chunk_drange_filter(leaf, chunk, bargs)) { in should_balance_chunk()
3822 if ((bargs->flags & BTRFS_BALANCE_ARGS_VRANGE) && in should_balance_chunk()
3823 chunk_vrange_filter(leaf, chunk, chunk_offset, bargs)) { in should_balance_chunk()
3828 if ((bargs->flags & BTRFS_BALANCE_ARGS_STRIPES_RANGE) && in should_balance_chunk()
3829 chunk_stripes_range_filter(leaf, chunk, bargs)) { in should_balance_chunk()
3834 if ((bargs->flags & BTRFS_BALANCE_ARGS_SOFT) && in should_balance_chunk()
3835 chunk_soft_convert_filter(chunk_type, bargs)) { in should_balance_chunk()
3842 if ((bargs->flags & BTRFS_BALANCE_ARGS_LIMIT)) { in should_balance_chunk()
3843 if (bargs->limit == 0) in should_balance_chunk()
3846 bargs->limit--; in should_balance_chunk()
3847 } else if ((bargs->flags & BTRFS_BALANCE_ARGS_LIMIT_RANGE)) { in should_balance_chunk()
3853 if (bargs->limit_max == 0) in should_balance_chunk()
3856 bargs->limit_max--; in should_balance_chunk()
4079 const struct btrfs_balance_args *bargs, in validate_convert_profile() argument
4082 if (!(bargs->flags & BTRFS_BALANCE_ARGS_CONVERT)) in validate_convert_profile()
4086 if (alloc_profile_is_valid(bargs->target, 1) && in validate_convert_profile()
4087 (bargs->target & ~allowed) == 0) in validate_convert_profile()
4091 type, btrfs_bg_type_to_raid_name(bargs->target)); in validate_convert_profile()
4100 static void describe_balance_args(struct btrfs_balance_args *bargs, char *buf, in describe_balance_args() argument
4106 u64 flags = bargs->flags; in describe_balance_args()
4141 btrfs_bg_type_to_raid_name(bargs->target)); in describe_balance_args()
4147 btrfs_describe_block_groups(bargs->profiles, tmp_buf, in describe_balance_args()
4153 CHECK_APPEND_1ARG("usage=%llu,", bargs->usage); in describe_balance_args()
4157 bargs->usage_min, bargs->usage_max); in describe_balance_args()
4160 CHECK_APPEND_1ARG("devid=%llu,", bargs->devid); in describe_balance_args()
4164 bargs->pstart, bargs->pend); in describe_balance_args()
4168 bargs->vstart, bargs->vend); in describe_balance_args()
4171 CHECK_APPEND_1ARG("limit=%llu,", bargs->limit); in describe_balance_args()
4175 bargs->limit_min, bargs->limit_max); in describe_balance_args()
4179 bargs->stripes_min, bargs->stripes_max); in describe_balance_args()
4254 struct btrfs_ioctl_balance_args *bargs) in btrfs_balance() argument
4418 if (bargs) { in btrfs_balance()
4419 memset(bargs, 0, sizeof(*bargs)); in btrfs_balance()
4420 btrfs_update_ioctl_balance_args(fs_info, bargs); in btrfs_balance()