projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
configure: disable lex/yacc on Solaris
[fio.git]
/
filesetup.c
diff --git
a/filesetup.c
b/filesetup.c
index 12a43b1fa14459439dd73013dd4ef018e5f6bfba..43146ba7671f61216fa938380c4bab908cd44b20 100644
(file)
--- a/
filesetup.c
+++ b/
filesetup.c
@@
-59,7
+59,7
@@
static int extend_file(struct thread_data *td, struct fio_file *f)
if (unlink_file || new_layout) {
dprint(FD_FILE, "layout unlink %s\n", f->file_name);
if (unlink_file || new_layout) {
dprint(FD_FILE, "layout unlink %s\n", f->file_name);
- if ((
unlink(f->file_name
) < 0) && (errno != ENOENT)) {
+ if ((
td_io_unlink_file(td, f
) < 0) && (errno != ENOENT)) {
td_verror(td, errno, "unlink");
return 1;
}
td_verror(td, errno, "unlink");
return 1;
}
@@
-172,7
+172,7
@@
static int extend_file(struct thread_data *td, struct fio_file *f)
if (td->terminate) {
dprint(FD_FILE, "terminate unlink %s\n", f->file_name);
if (td->terminate) {
dprint(FD_FILE, "terminate unlink %s\n", f->file_name);
-
unlink(f->file_name
);
+
td_io_unlink_file(td, f
);
} else if (td->o.create_fsync) {
if (fsync(f->fd) < 0) {
td_verror(td, errno, "fsync");
} else if (td->o.create_fsync) {
if (fsync(f->fd) < 0) {
td_verror(td, errno, "fsync");
@@
-898,7
+898,7
@@
int setup_files(struct thread_data *td)
}
}
}
}
- if (!o->size ||
o->size > total_size
)
+ if (!o->size ||
(total_size && o->size > total_size)
)
o->size = total_size;
if (o->size < td_min_bs(td)) {
o->size = total_size;
if (o->size < td_min_bs(td)) {
@@
-1100,6
+1100,11
@@
void close_and_free_files(struct thread_data *td)
dprint(FD_FILE, "close files\n");
for_each_file(td, f, i) {
dprint(FD_FILE, "close files\n");
for_each_file(td, f, i) {
+ if (td->o.unlink && f->filetype == FIO_TYPE_FILE) {
+ dprint(FD_FILE, "free unlink %s\n", f->file_name);
+ td_io_unlink_file(td, f);
+ }
+
if (fio_file_open(f))
td_io_close_file(td, f);
if (fio_file_open(f))
td_io_close_file(td, f);
@@
-1107,7
+1112,7
@@
void close_and_free_files(struct thread_data *td)
if (td->o.unlink && f->filetype == FIO_TYPE_FILE) {
dprint(FD_FILE, "free unlink %s\n", f->file_name);
if (td->o.unlink && f->filetype == FIO_TYPE_FILE) {
dprint(FD_FILE, "free unlink %s\n", f->file_name);
-
unlink(f->file_name
);
+
td_io_unlink_file(td, f
);
}
sfree(f->file_name);
}
sfree(f->file_name);