- Only use threads for > 1 thread
- Don't clear ->iodepth for SYNCIO def_thread
- Only use setsid() for forked threads
struct stat sb;
int numjobs;
- if (td->io_engine & FIO_SYNCIO)
- td->iodepth = 1;
- else {
- if (!td->iodepth)
- td->iodepth = 1;
- }
-
#ifndef FIO_HAVE_LIBAIO
if (td->io_engine == FIO_LIBAIO) {
fprintf(stderr, "Linux libaio not available\n");
if (td == &def_thread)
return 0;
+ if (td->io_engine & FIO_SYNCIO)
+ td->iodepth = 1;
+ else {
+ if (!td->iodepth)
+ td->iodepth = 1;
+ }
+
td->filetype = FIO_TYPE_FILE;
if (!stat(jobname, &sb) && S_ISBLK(sb.st_mode))
td->filetype = FIO_TYPE_BD;
*
* sync io is implemented on top of aio.
*
+ * This is not really specific to fio, if the get_io_u/put_io_u and
+ * structures was pulled into this as well it would be a perfectly
+ * generic io engine that could be used for other projects.
+ *
*/
#include <stdio.h>
#include <stdlib.h>
struct thread_data *td = data;
int ret = 1;
- setsid();
+ if (!td->use_thread)
+ setsid();
+
td->pid = getpid();
if (init_io_u(td))
unsigned long spent;
int i, todo, nr_running, m_rate, t_rate, nr_started;
- printf("Starting %d threads\n", thread_number);
+ printf("Starting %d thread%s\n", thread_number, thread_number > 1 ? "s" : "");
fflush(stdout);
signal(SIGINT, sig_handler);