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;
}
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");
}
td_verror(td, __e, buf);
+ return 1;
}
if (!from_hash && f->fd != -1) {
if (td->error != ENOENT) {
log_err("%s\n", td->verror);
err = 1;
+ break;
}
clear_error(td);
}
return f->real_file_size;
return td->o.start_offset +
- (td->thread_number - 1) * td->o.offset_increment;
+ td->subjob_number * td->o.offset_increment;
}
/*
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 (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);