X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=parse.h;h=d68484eaf0c65572352222297162ebd0d20cf7e7;hb=cb765e413e4d124355c3eec47f7ac8cd314a6951;hp=6f2a96b2f906b966d11974c314d7b296a650a172;hpb=b75c0fae66129883dc554fecb6eaa4b35938c14e;p=fio.git diff --git a/parse.h b/parse.h index 6f2a96b2..d68484ea 100644 --- a/parse.h +++ b/parse.h @@ -21,6 +21,7 @@ enum fio_opt_type { FIO_OPT_BOOL, FIO_OPT_FLOAT_LIST, FIO_OPT_STR_SET, + FIO_OPT_STR_VAL_ZONE, FIO_OPT_DEPRECATED, FIO_OPT_SOFT_DEPRECATED, FIO_OPT_UNSUPPORTED, /* keep this last */ @@ -130,12 +131,18 @@ static inline void *td_var(void *to, const struct fio_option *o, static inline int parse_is_percent(unsigned long long val) { - return val >= -101; + return val >= -101ULL; } +#define ZONE_BASE_VAL ((-1ULL >> 1) + 1) static inline int parse_is_percent_uncapped(unsigned long long val) { - return (long long)val <= -1; + return ZONE_BASE_VAL + -1U < val; +} + +static inline int parse_is_zone(unsigned long long val) +{ + return (val - ZONE_BASE_VAL) <= -1U; } struct print_option {