We have two different defines, use the one from the networking
protocol. Add a compile time check that bssplit and zones
have the same max, so we don't inadvertently add an overflow
condition if we change one of them.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
compiletime_assert((offsetof(struct jobs_eta, m_rate) % 8) == 0, "m_rate");
compiletime_assert(__TD_F_LAST <= TD_ENG_FLAG_SHIFT, "TD_ENG_FLAG_SHIFT");
+ compiletime_assert(BSSPLIT_MAX == ZONESPLIT_MAX, "bsssplit/zone max");
err = endian_check();
if (err) {
return (int) bsp1->perc - (int) bsp2->perc;
}
-#define SPLIT_MAX_ENTRY 100
-
struct split {
unsigned int nr;
- unsigned int val1[SPLIT_MAX_ENTRY];
- unsigned long long val2[SPLIT_MAX_ENTRY];
+ unsigned int val1[ZONESPLIT_MAX];
+ unsigned long long val2[ZONESPLIT_MAX];
};
static int split_parse_ddir(struct thread_options *o, struct split *split,
split->val1[i] = val;
split->val2[i] = perc;
i++;
- if (i == SPLIT_MAX_ENTRY)
+ if (i == ZONESPLIT_MAX)
break;
}