]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/opts.c
Merge pull request #190 from Dikay900/fs_free_space
[bcachefs-tools-debian] / libbcachefs / opts.c
index b7722b6236978cd692a478cd4ec324ade4456bb4..8e6f230eac38155bf5d048367d6ebde35a4a15bd 100644 (file)
 
 #define x(t, n, ...) [n] = #t,
 
-const char * const bch2_iops_measurements[] = {
-       BCH_IOPS_MEASUREMENTS()
-       NULL
-};
-
 const char * const bch2_error_actions[] = {
        BCH_ERROR_ACTIONS()
        NULL
@@ -270,28 +265,28 @@ int bch2_opt_validate(const struct bch_option *opt, u64 v, struct printbuf *err)
                if (err)
                        prt_printf(err, "%s: too small (min %llu)",
                               opt->attr.name, opt->min);
-               return -ERANGE;
+               return -BCH_ERR_ERANGE_option_too_small;
        }
 
        if (opt->max && v >= opt->max) {
                if (err)
                        prt_printf(err, "%s: too big (max %llu)",
                               opt->attr.name, opt->max);
-               return -ERANGE;
+               return -BCH_ERR_ERANGE_option_too_big;
        }
 
        if ((opt->flags & OPT_SB_FIELD_SECTORS) && (v & 511)) {
                if (err)
                        prt_printf(err, "%s: not a multiple of 512",
                               opt->attr.name);
-               return -EINVAL;
+               return -BCH_ERR_opt_parse_error;
        }
 
        if ((opt->flags & OPT_MUST_BE_POW_2) && !is_power_of_2(v)) {
                if (err)
                        prt_printf(err, "%s: must be a power of two",
                               opt->attr.name);
-               return -EINVAL;
+               return -BCH_ERR_opt_parse_error;
        }
 
        if (opt->fn.validate)