projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
server/client: don't use __ conversion functions if not needed
[fio.git]
/
ioengines.c
diff --git
a/ioengines.c
b/ioengines.c
index 3c75fa6bfed6812e9027e832ff0d26505034b7d9..07d1d5678986cbe86fd3c87eae1c3a413526ba2a 100644
(file)
--- a/
ioengines.c
+++ b/
ioengines.c
@@
-220,7
+220,7
@@
int td_io_prep(struct thread_data *td, struct io_u *io_u)
}
int td_io_getevents(struct thread_data *td, unsigned int min, unsigned int max,
}
int td_io_getevents(struct thread_data *td, unsigned int min, unsigned int max,
- struct timespec *t)
+
const
struct timespec *t)
{
int r = 0;
{
int r = 0;
@@
-375,6
+375,9
@@
int td_io_init(struct thread_data *td)
td->error = ret;
}
td->error = ret;
}
+ if (!ret && (td->io_ops->flags & FIO_NOIO))
+ td->flags |= TD_F_NOIO;
+
return ret;
}
return ret;
}
@@
-503,6
+506,14
@@
int td_io_close_file(struct thread_data *td, struct fio_file *f)
return put_file(td, f);
}
return put_file(td, f);
}
+int td_io_unlink_file(struct thread_data *td, struct fio_file *f)
+{
+ if (td->io_ops->unlink_file)
+ return td->io_ops->unlink_file(td, f);
+ else
+ return unlink(f->file_name);
+}
+
int td_io_get_file_size(struct thread_data *td, struct fio_file *f)
{
if (!td->io_ops->get_file_size)
int td_io_get_file_size(struct thread_data *td, struct fio_file *f)
{
if (!td->io_ops->get_file_size)
@@
-511,7
+522,8
@@
int td_io_get_file_size(struct thread_data *td, struct fio_file *f)
return td->io_ops->get_file_size(td, f);
}
return td->io_ops->get_file_size(td, f);
}
-static int do_sync_file_range(struct thread_data *td, struct fio_file *f)
+static int do_sync_file_range(const struct thread_data *td,
+ struct fio_file *f)
{
off64_t offset, nbytes;
{
off64_t offset, nbytes;
@@
-524,7
+536,7
@@
static int do_sync_file_range(struct thread_data *td, struct fio_file *f)
return sync_file_range(f->fd, offset, nbytes, td->o.sync_file_range);
}
return sync_file_range(f->fd, offset, nbytes, td->o.sync_file_range);
}
-int do_io_u_sync(struct thread_data *td, struct io_u *io_u)
+int do_io_u_sync(
const
struct thread_data *td, struct io_u *io_u)
{
int ret;
{
int ret;
@@
-550,7
+562,7
@@
int do_io_u_sync(struct thread_data *td, struct io_u *io_u)
return ret;
}
return ret;
}
-int do_io_u_trim(struct thread_data *td, struct io_u *io_u)
+int do_io_u_trim(
const
struct thread_data *td, struct io_u *io_u)
{
#ifndef FIO_HAVE_TRIM
io_u->error = EINVAL;
{
#ifndef FIO_HAVE_TRIM
io_u->error = EINVAL;