fio: Use atomic_load_acquire() and atomic_store_release() where appropriate
[fio.git] / verify.c
index b7fa6693068d851f2ffb4c48a3044cfe4eb11f34..5ee0029d130e2f891d48cbd6c1ee01203085a6c3 100644 (file)
--- a/verify.c
+++ b/verify.c
@@ -8,6 +8,7 @@
 #include <pthread.h>
 #include <libgen.h>
 
+#include "arch/arch.h"
 #include "fio.h"
 #include "verify.h"
 #include "trim.h"
@@ -1309,8 +1310,7 @@ int get_next_verify(struct thread_data *td, struct io_u *io_u)
                /*
                 * Ensure that the associated IO has completed
                 */
-               read_barrier();
-               if (ipo->flags & IP_F_IN_FLIGHT)
+               if (atomic_load_acquire(&ipo->flags) & IP_F_IN_FLIGHT)
                        goto nothing;
 
                rb_erase(n, &td->io_hist_tree);
@@ -1322,8 +1322,7 @@ int get_next_verify(struct thread_data *td, struct io_u *io_u)
                /*
                 * Ensure that the associated IO has completed
                 */
-               read_barrier();
-               if (ipo->flags & IP_F_IN_FLIGHT)
+               if (atomic_load_acquire(&ipo->flags) & IP_F_IN_FLIGHT)
                        goto nothing;
 
                flist_del(&ipo->list);