projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Some more bits of blktrace support
[fio.git]
/
ioengines.c
diff --git
a/ioengines.c
b/ioengines.c
index 3cfa773ac07ea2e79d6f17c6ef38ffc360947035..28cdfd49b00cd24915f39c7b117e3d2e96e9e31f 100644
(file)
--- a/
ioengines.c
+++ b/
ioengines.c
@@
-17,7
+17,6
@@
#include <assert.h>
#include "fio.h"
#include <assert.h>
#include "fio.h"
-#include "os.h"
static LIST_HEAD(engine_list);
static LIST_HEAD(engine_list);
@@
-208,9
+207,6
@@
int td_io_queue(struct thread_data *td, struct io_u *io_u)
ret = td->io_ops->queue(td, io_u);
ret = td->io_ops->queue(td, io_u);
- if (ret == FIO_Q_QUEUED || ret == FIO_Q_COMPLETED)
- get_file(io_u->file);
-
if (ret == FIO_Q_QUEUED) {
int r;
if (ret == FIO_Q_QUEUED) {
int r;
@@
-272,6
+268,13
@@
int td_io_open_file(struct thread_data *td, struct fio_file *f)
return 1;
}
return 1;
}
+ if (f->filetype == FIO_TYPE_PIPE) {
+ if (td_random(td)) {
+ log_err("fio: can't seek on pipes (no random io)\n");
+ goto err;
+ }
+ }
+
f->last_free_lookup = 0;
f->last_completed_pos = 0;
f->last_pos = 0;
f->last_free_lookup = 0;
f->last_completed_pos = 0;
f->last_pos = 0;
@@
-284,7
+287,9
@@
int td_io_open_file(struct thread_data *td, struct fio_file *f)
if (td->o.invalidate_cache && file_invalidate_cache(td, f))
goto err;
if (td->o.invalidate_cache && file_invalidate_cache(td, f))
goto err;
- if (td->o.fadvise_hint) {
+ if (td->o.fadvise_hint &&
+ (f->filetype == FIO_TYPE_BD || f->filetype == FIO_TYPE_FILE)) {
+
int flags;
if (td_random(td))
int flags;
if (td_random(td))
@@
-306,7
+311,8
@@
done:
get_file(f);
return 0;
err:
get_file(f);
return 0;
err:
- td->io_ops->close_file(td, f);
+ if (td->io_ops->close_file)
+ td->io_ops->close_file(td, f);
return 1;
}
return 1;
}
@@
-319,4
+325,3
@@
void td_io_close_file(struct thread_data *td, struct fio_file *f)
put_file(td, f);
}
put_file(td, f);
}
-