Skip to contentSkip to conversation

Recent changes (master)

PATCH Jens Axboe 2 participants 3 messages Nov 24, 2014 Library code

lore
Share & tools
lore

Jens Axboe

author
#0 lore raw

The following changes since commit df8fb6097058098f1c2f7c2cf4019640561768df:

iolog: account for wasted time in ipo stall (2014-11-21 14:33:33 -0700)

are available in the git repository at:

git://git.kernel.dk/fio.git master

for you to fetch changes up to 6f49f8bc80fbeff3d24cf84278d2611db0ec6f6c:

lfsr: don't pass in last value to lfsr_next() (2014-11-23 18:41:11 -0700)

----------------------------------------------------------------
Jens Axboe (1):
lfsr: don't pass in last value to lfsr_next()

 io_u.c     |   14 ++++++++------
 lib/lfsr.c |    2 +-
 lib/lfsr.h |    2 +-
 3 files changed, 10 insertions(+), 8 deletions(-)

---

Diff of recent changes:

io_u.c +8 -6
index c51982d..33c82f2 100644
@@ -83,13 +83,15 @@ struct rand_off {
 static int __get_next_rand_offset(struct thread_data *td, struct fio_file *f,
 				  enum fio_ddir ddir, uint64_t *b)
 {
-	uint64_t r, lastb;
-
-	lastb = last_block(td, f, ddir);
-	if (!lastb)
-		return 1;
+	uint64_t r;
 
 	if (td->o.random_generator == FIO_RAND_GEN_TAUSWORTHE) {
+		uint64_t lastb;
+
+		lastb = last_block(td, f, ddir);
+		if (!lastb)
+			return 1;
+
 		r = __rand(&td->random_state);
 
 		dprint(FD_RANDOM, "off rand %llu\n", (unsigned long long) r);
@@ -98,7 +100,7 @@ static int __get_next_rand_offset(struct thread_data *td, struct fio_file *f,
 	} else {
 		uint64_t off = 0;
 
-		if (lfsr_next(&f->lfsr, &off, lastb))
+		if (lfsr_next(&f->lfsr, &off))
 			return 1;
 
 		*b = off;
lib/lfsr.c +1 -1
index 9fff50d..0c0072c 100644
@@ -124,7 +124,7 @@ static inline void __lfsr_next(struct fio_lfsr *fl, unsigned int spin)
  * c. Check if the calculated value exceeds the desirable range. In this case,
  *    go back to b, else return.
  */
-int lfsr_next(struct fio_lfsr *fl, uint64_t *off, uint64_t last)
+int lfsr_next(struct fio_lfsr *fl, uint64_t *off)
 {
 	if (fl->num_vals++ > fl->max_val)
 		return 1;
lib/lfsr.h +1 -1
index 187abf2..c2d5569 100644
@@ -22,7 +22,7 @@ struct fio_lfsr {
 	unsigned int spin;
 };
 
-int lfsr_next(struct fio_lfsr *fl, uint64_t *off, uint64_t);
+int lfsr_next(struct fio_lfsr *fl, uint64_t *off);
 int lfsr_init(struct fio_lfsr *fl, uint64_t size,
 		unsigned long seed, unsigned int spin);
 int lfsr_reset(struct fio_lfsr *fl, unsigned long seed);
#1 lore raw
Quoted 6 lines · Jens Axboe

lfsr: don't pass in last value to lfsr_next()

  io_u.c     |   14 ++++++++------
  lib/lfsr.c |    2 +-
  lib/lfsr.h |    2 +-
  3 files changed, 10 insertions(+), 8 deletions(-)

t/axmap.c:40 also calls lfsr_next and needs updated.

Signature · 1 line
Bruce
author
#2 lore raw
Quoted 9 lines · Bruce Cran
Quoted 6 lines · Jens Axboe

lfsr: don't pass in last value to lfsr_next()

  io_u.c     |   14 ++++++++------
  lib/lfsr.c |    2 +-
  lib/lfsr.h |    2 +-
  3 files changed, 10 insertions(+), 8 deletions(-)

t/axmap.c:40 also calls lfsr_next and needs updated.

Gah, sorry about that. I was working on a standalone test app, apparently forgot to check the whole thing. Fixed up now.

Signature · 1 line
Jens Axboe