0001-t-io_uring-don-t-use-rand48_r-variants.patch 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. From 5e8865c0e08861558c1253c521dc9098d0c773ee Mon Sep 17 00:00:00 2001
  2. From: Jens Axboe <axboe@kernel.dk>
  3. Date: Mon, 16 Mar 2020 08:30:36 -0600
  4. Subject: [PATCH] t/io_uring: don't use *rand48_r() variants
  5. Not available on all platforms.
  6. Signed-off-by: Jens Axboe <axboe@kernel.dk>
  7. [Patch from upstream
  8. https://github.com/axboe/fio/commit/5e8865c0e08861558c1253c521dc9098d0c773ee]
  9. Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
  10. ---
  11. t/io_uring.c | 5 ++---
  12. 1 file changed, 2 insertions(+), 3 deletions(-)
  13. diff --git a/t/io_uring.c b/t/io_uring.c
  14. index e84a2b6b..d48db1e9 100644
  15. --- a/t/io_uring.c
  16. +++ b/t/io_uring.c
  17. @@ -63,7 +63,6 @@ struct file {
  18. struct submitter {
  19. pthread_t thread;
  20. int ring_fd;
  21. - struct drand48_data rand;
  22. struct io_sq_ring sq_ring;
  23. struct io_uring_sqe *sqes;
  24. struct io_cq_ring cq_ring;
  25. @@ -170,7 +169,7 @@ static void init_io(struct submitter *s, unsigned index)
  26. }
  27. f->pending_ios++;
  28. - lrand48_r(&s->rand, &r);
  29. + r = lrand48();
  30. offset = (r % (f->max_blocks - 1)) * BS;
  31. if (register_files) {
  32. @@ -286,7 +285,7 @@ static void *submitter_fn(void *data)
  33. printf("submitter=%d\n", gettid());
  34. - srand48_r(pthread_self(), &s->rand);
  35. + srand48(pthread_self());
  36. prepped = 0;
  37. do {
  38. --
  39. 2.20.1