Lines Matching refs:bargs

3753 				 struct btrfs_balance_args *bargs)  in chunk_profiles_filter()  argument
3758 if (bargs->profiles & chunk_type) in chunk_profiles_filter()
3765 struct btrfs_balance_args *bargs) in chunk_usage_range_filter() argument
3776 if (bargs->usage_min == 0) in chunk_usage_range_filter()
3779 user_thresh_min = mult_perc(cache->length, bargs->usage_min); in chunk_usage_range_filter()
3781 if (bargs->usage_max == 0) in chunk_usage_range_filter()
3783 else if (bargs->usage_max > 100) in chunk_usage_range_filter()
3786 user_thresh_max = mult_perc(cache->length, bargs->usage_max); in chunk_usage_range_filter()
3796 u64 chunk_offset, struct btrfs_balance_args *bargs) in chunk_usage_filter() argument
3805 if (bargs->usage_min == 0) in chunk_usage_filter()
3807 else if (bargs->usage > 100) in chunk_usage_filter()
3810 user_thresh = mult_perc(cache->length, bargs->usage); in chunk_usage_filter()
3821 struct btrfs_balance_args *bargs) in chunk_devid_filter() argument
3829 if (btrfs_stripe_devid(leaf, stripe) == bargs->devid) in chunk_devid_filter()
3848 struct btrfs_balance_args *bargs) in chunk_drange_filter() argument
3858 if (!(bargs->flags & BTRFS_BALANCE_ARGS_DEVID)) in chunk_drange_filter()
3866 if (btrfs_stripe_devid(leaf, stripe) != bargs->devid) in chunk_drange_filter()
3873 if (stripe_offset < bargs->pend && in chunk_drange_filter()
3874 stripe_offset + stripe_length > bargs->pstart) in chunk_drange_filter()
3885 struct btrfs_balance_args *bargs) in chunk_vrange_filter() argument
3887 if (chunk_offset < bargs->vend && in chunk_vrange_filter()
3888 chunk_offset + btrfs_chunk_length(leaf, chunk) > bargs->vstart) in chunk_vrange_filter()
3897 struct btrfs_balance_args *bargs) in chunk_stripes_range_filter() argument
3901 if (bargs->stripes_min <= num_stripes in chunk_stripes_range_filter()
3902 && num_stripes <= bargs->stripes_max) in chunk_stripes_range_filter()
3909 struct btrfs_balance_args *bargs) in chunk_soft_convert_filter() argument
3911 if (!(bargs->flags & BTRFS_BALANCE_ARGS_CONVERT)) in chunk_soft_convert_filter()
3917 if (bargs->target == chunk_type) in chunk_soft_convert_filter()
3928 struct btrfs_balance_args *bargs = NULL; in should_balance_chunk() local
3938 bargs = &bctl->data; in should_balance_chunk()
3940 bargs = &bctl->sys; in should_balance_chunk()
3942 bargs = &bctl->meta; in should_balance_chunk()
3945 if ((bargs->flags & BTRFS_BALANCE_ARGS_PROFILES) && in should_balance_chunk()
3946 chunk_profiles_filter(chunk_type, bargs)) { in should_balance_chunk()
3951 if ((bargs->flags & BTRFS_BALANCE_ARGS_USAGE) && in should_balance_chunk()
3952 chunk_usage_filter(fs_info, chunk_offset, bargs)) { in should_balance_chunk()
3954 } else if ((bargs->flags & BTRFS_BALANCE_ARGS_USAGE_RANGE) && in should_balance_chunk()
3955 chunk_usage_range_filter(fs_info, chunk_offset, bargs)) { in should_balance_chunk()
3960 if ((bargs->flags & BTRFS_BALANCE_ARGS_DEVID) && in should_balance_chunk()
3961 chunk_devid_filter(leaf, chunk, bargs)) { in should_balance_chunk()
3966 if ((bargs->flags & BTRFS_BALANCE_ARGS_DRANGE) && in should_balance_chunk()
3967 chunk_drange_filter(leaf, chunk, bargs)) { in should_balance_chunk()
3972 if ((bargs->flags & BTRFS_BALANCE_ARGS_VRANGE) && in should_balance_chunk()
3973 chunk_vrange_filter(leaf, chunk, chunk_offset, bargs)) { in should_balance_chunk()
3978 if ((bargs->flags & BTRFS_BALANCE_ARGS_STRIPES_RANGE) && in should_balance_chunk()
3979 chunk_stripes_range_filter(leaf, chunk, bargs)) { in should_balance_chunk()
3984 if ((bargs->flags & BTRFS_BALANCE_ARGS_SOFT) && in should_balance_chunk()
3985 chunk_soft_convert_filter(chunk_type, bargs)) { in should_balance_chunk()
3992 if ((bargs->flags & BTRFS_BALANCE_ARGS_LIMIT)) { in should_balance_chunk()
3993 if (bargs->limit == 0) in should_balance_chunk()
3996 bargs->limit--; in should_balance_chunk()
3997 } else if ((bargs->flags & BTRFS_BALANCE_ARGS_LIMIT_RANGE)) { in should_balance_chunk()
4003 if (bargs->limit_max == 0) in should_balance_chunk()
4006 bargs->limit_max--; in should_balance_chunk()
4229 const struct btrfs_balance_args *bargs, in validate_convert_profile() argument
4232 if (!(bargs->flags & BTRFS_BALANCE_ARGS_CONVERT)) in validate_convert_profile()
4236 if (alloc_profile_is_valid(bargs->target, 1) && in validate_convert_profile()
4237 (bargs->target & ~allowed) == 0) in validate_convert_profile()
4241 type, btrfs_bg_type_to_raid_name(bargs->target)); in validate_convert_profile()
4250 static void describe_balance_args(struct btrfs_balance_args *bargs, char *buf, in describe_balance_args() argument
4256 u64 flags = bargs->flags; in describe_balance_args()
4291 btrfs_bg_type_to_raid_name(bargs->target)); in describe_balance_args()
4297 btrfs_describe_block_groups(bargs->profiles, tmp_buf, in describe_balance_args()
4303 CHECK_APPEND_1ARG("usage=%llu,", bargs->usage); in describe_balance_args()
4307 bargs->usage_min, bargs->usage_max); in describe_balance_args()
4310 CHECK_APPEND_1ARG("devid=%llu,", bargs->devid); in describe_balance_args()
4314 bargs->pstart, bargs->pend); in describe_balance_args()
4318 bargs->vstart, bargs->vend); in describe_balance_args()
4321 CHECK_APPEND_1ARG("limit=%llu,", bargs->limit); in describe_balance_args()
4325 bargs->limit_min, bargs->limit_max); in describe_balance_args()
4329 bargs->stripes_min, bargs->stripes_max); in describe_balance_args()
4404 struct btrfs_ioctl_balance_args *bargs) in btrfs_balance() argument
4568 if (bargs) { in btrfs_balance()
4569 memset(bargs, 0, sizeof(*bargs)); in btrfs_balance()
4570 btrfs_update_ioctl_balance_args(fs_info, bargs); in btrfs_balance()