projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Don't malloc/memcpy ioengine_ops on td initialization
[fio.git]
/
ioengines.c
diff --git
a/ioengines.c
b/ioengines.c
index e2e7280a8edcd0b46a2a2c9daa56914483cca143..918b50ad2bf27dafc0d69f9750d106aad29e2fa4 100644
(file)
--- a/
ioengines.c
+++ b/
ioengines.c
@@
-119,13
+119,13
@@
static struct ioengine_ops *dlopen_ioengine(struct thread_data *td,
return NULL;
}
return NULL;
}
-
ops->
dlhandle = dlhandle;
+
td->io_ops_
dlhandle = dlhandle;
return ops;
}
struct ioengine_ops *load_ioengine(struct thread_data *td, const char *name)
{
return ops;
}
struct ioengine_ops *load_ioengine(struct thread_data *td, const char *name)
{
- struct ioengine_ops *ops
, *ret
;
+ struct ioengine_ops *ops;
char engine[16];
dprint(FD_IO, "load ioengine %s\n", name);
char engine[16];
dprint(FD_IO, "load ioengine %s\n", name);
@@
-153,11
+153,7
@@
struct ioengine_ops *load_ioengine(struct thread_data *td, const char *name)
if (check_engine_ops(ops))
return NULL;
if (check_engine_ops(ops))
return NULL;
- ret = malloc(sizeof(*ret));
- memcpy(ret, ops, sizeof(*ret));
- ret->data = NULL;
-
- return ret;
+ return ops;
}
/*
}
/*
@@
-173,10
+169,9
@@
void free_ioengine(struct thread_data *td)
td->eo = NULL;
}
td->eo = NULL;
}
- if (td->io_ops
->
dlhandle)
- dlclose(td->io_ops
->
dlhandle);
+ if (td->io_ops
_
dlhandle)
+ dlclose(td->io_ops
_
dlhandle);
- free(td->io_ops);
td->io_ops = NULL;
}
td->io_ops = NULL;
}
@@
-186,7
+181,7
@@
void close_ioengine(struct thread_data *td)
if (td->io_ops->cleanup) {
td->io_ops->cleanup(td);
if (td->io_ops->cleanup) {
td->io_ops->cleanup(td);
- td->io_ops
->
data = NULL;
+ td->io_ops
_
data = NULL;
}
free_ioengine(td);
}
free_ioengine(td);