#include <unistd.h>
#include <string.h>
#include <dlfcn.h>
+#include <fcntl.h>
#include <assert.h>
#include "fio.h"
if (ddir_rw(io_u->ddir)) {
io_u_mark_depth(td, 1);
td->ts.total_io_u[io_u->ddir]++;
- }
+ } else if (io_u->ddir == DDIR_TRIM)
+ td->ts.total_io_u[2]++;
} else if (ret == FIO_Q_QUEUED) {
int r;
log_err("fio: io engine init failed. Perhaps try"
" reducing io depth?\n");
}
+ if (!td->error)
+ td->error = ret;
}
return ret;
else
flags = POSIX_FADV_SEQUENTIAL;
- if (fadvise(f->fd, f->file_offset, f->io_size, flags) < 0) {
+ if (posix_fadvise(f->fd, f->file_offset, f->io_size, flags) < 0) {
td_verror(td, errno, "fadvise");
goto err;
}
if (ret) {
td_verror(td, ret, "fio_set_odirect");
+ log_err("fio: the file system does not seem to support direct IO\n");
goto err;
}
}
struct fio_file *f = io_u->file;
int ret;
- ret = os_trim(f->fd, io_u->offset + f->file_offset, io_u->xfer_buflen);
+ ret = os_trim(f->fd, io_u->offset, io_u->xfer_buflen);
if (!ret)
return io_u->xfer_buflen;;