#include <assert.h>
#include <sys/types.h>
#include <dirent.h>
+#include <errno.h>
#include "fio.h"
#include "diskutil.h"
* flag is now set
*/
if (td_offload_overlap(td)) {
- int res = pthread_mutex_unlock(&overlap_check);
- assert(res == 0);
+ int res;
+
+ res = pthread_mutex_unlock(&overlap_check);
+ if (fio_unlikely(res != 0)) {
+ log_err("failed to unlock overlap check mutex, err: %i:%s", errno, strerror(errno));
+ abort();
+ }
}
assert(fio_file_open(io_u->file));
if (td_ioengine_flagged(td, FIO_SYNCIO) ||
async_ioengine_sync_trim(td, io_u)) {
- if (fio_fill_issue_time(td))
+ if (fio_fill_issue_time(td)) {
fio_gettime(&io_u->issue_time, NULL);
- /*
- * only used for iolog
- */
- if (td->o.read_iolog_file)
- memcpy(&td->last_issue, &io_u->issue_time,
- sizeof(io_u->issue_time));
+ /*
+ * only used for iolog
+ */
+ if (td->o.read_iolog_file)
+ memcpy(&td->last_issue, &io_u->issue_time,
+ sizeof(io_u->issue_time));
+ }
}
if (!td_ioengine_flagged(td, FIO_SYNCIO) &&
!async_ioengine_sync_trim(td, io_u)) {
if (fio_fill_issue_time(td) &&
- !td_ioengine_flagged(td, FIO_ASYNCIO_SETS_ISSUE_TIME))
+ !td_ioengine_flagged(td, FIO_ASYNCIO_SETS_ISSUE_TIME)) {
fio_gettime(&io_u->issue_time, NULL);
- /*
- * only used for iolog
- */
- if (td->o.read_iolog_file)
- memcpy(&td->last_issue, &io_u->issue_time,
- sizeof(io_u->issue_time));
+ /*
+ * only used for iolog
+ */
+ if (td->o.read_iolog_file)
+ memcpy(&td->last_issue, &io_u->issue_time,
+ sizeof(io_u->issue_time));
+ }
}
return ret;
flags = POSIX_FADV_RANDOM;
else if (td->o.fadvise_hint == F_ADV_SEQUENTIAL)
flags = POSIX_FADV_SEQUENTIAL;
+#ifdef POSIX_FADV_NOREUSE
+ else if (td->o.fadvise_hint == F_ADV_NOREUSE)
+ flags = POSIX_FADV_NOREUSE;
+#endif
else {
log_err("fio: unknown fadvise type %d\n",
td->o.fadvise_hint);