The following changes since commit b136e932040242ff2245e5cfc97df82a7fd03ceb: lfsr: indent table (2013-03-08 19:12:15 +0100) are available in the git repository at: git://git.kernel.dk/fio.git master Alex Pyrgiotis (1): lfsr: Fix spin related bug lib/lfsr.c | 16 +++++++++++----- 1 files changed, 11 insertions(+), 5 deletions(-) --- Diff of recent changes: diff --git a/lib/lfsr.c b/lib/lfsr.c index a835404..4c15c62 100644 --- a/lib/lfsr.c +++ b/lib/lfsr.c @@ -108,22 +108,28 @@ static inline void __lfsr_next(struct fio_lfsr *fl, unsigned int spin) } } +/* + * lfsr_next does the following: + * + * a. Return if the number of max values has been exceeded. + * b. Check if the next iteration(s) produce a cycle (due to spin) and add "1" + * where necessary. + * c. Calculate the next value and return. + */ int lfsr_next(struct fio_lfsr *fl, uint64_t *off, uint64_t last) { int repeat; unsigned int spin; + if (fl->num_vals++ > fl->max_val) + return 1; + repeat = fl->num_vals % fl->cycle_length; if (repeat == 0) spin = fl->spin + 1; else spin = fl->spin; - if (fl->num_vals > fl->max_val) - return 1; - - fl->num_vals++; - do { __lfsr_next(fl, spin); } while (fl->last_val > fl->max_val); -- To unsubscribe from this list: send the line "unsubscribe fio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html