#include "hash.h"
#include "smalloc.h"
#include "verify.h"
+#include "trim.h"
#include "diskutil.h"
#include "cgroup.h"
#include "profile.h"
unsigned int rate_iops = 0;
unsigned int rate_iops_min = 0;
+ assert(ddir_rw(ddir));
+
if (!td->o.ratemin[ddir] && !td->o.rate_iops_min[ddir])
return 0;
io_u->xfer_buf += bytes;
io_u->offset += bytes;
- td->ts.short_io_u[io_u->ddir]++;
+ if (ddir_rw(io_u->ddir))
+ td->ts.short_io_u[io_u->ddir]++;
if (io_u->offset == f->real_file_size)
goto sync_done;
td_set_runstate(td, TD_RUNNING);
while ( (td->o.read_iolog_file && !flist_empty(&td->io_log_list)) ||
+ (!flist_empty(&td->trim_list)) ||
((td->this_io_bytes[0] + td->this_io_bytes[1]) < td->o.size) ) {
struct timeval comp_time;
unsigned long bytes_done[2] = { 0, 0 };
io_u->xfer_buf += bytes;
io_u->offset += bytes;
- td->ts.short_io_u[io_u->ddir]++;
+ if (ddir_rw(io_u->ddir))
+ td->ts.short_io_u[io_u->ddir]++;
if (io_u->offset == f->real_file_size)
goto sync_done;
}
}
+ if (td->trim_entries)
+ printf("trim entries %ld\n", td->trim_entries);
+
if (td->o.fill_device && td->error == ENOSPC) {
td->error = 0;
td->terminate = 1;
if (allocate_io_mem(td))
return 1;
- if (td->o.odirect || td->o.mem_align)
+ if (td->o.odirect || td->o.mem_align ||
+ (td->io_ops->flags & FIO_RAWIO))
p = PAGE_ALIGN(td->orig_buffer) + td->o.mem_align;
else
p = td->orig_buffer;
INIT_FLIST_HEAD(&td->io_log_list);
INIT_FLIST_HEAD(&td->io_hist_list);
INIT_FLIST_HEAD(&td->verify_list);
+ INIT_FLIST_HEAD(&td->trim_list);
pthread_mutex_init(&td->io_u_lock, NULL);
td->io_hist_tree = RB_ROOT;
static int fio_start_gtod_thread(void)
{
+ pthread_attr_t attr;
int ret;
- ret = pthread_create(>od_thread, NULL, gtod_thread_main, NULL);
+ pthread_attr_init(&attr);
+ pthread_attr_setstacksize(&attr, PTHREAD_STACK_MIN);
+ ret = pthread_create(>od_thread, &attr, gtod_thread_main, NULL);
+ pthread_attr_destroy(&attr);
if (ret) {
log_err("Can't create gtod thread: %s\n", strerror(ret));
return 1;