+static int ipo_special(struct thread_data *td, struct io_piece *ipo)
+{
+ struct fio_file *f;
+ int ret;
+
+ /*
+ * Not a special ipo
+ */
+ if (ipo->ddir != DDIR_INVAL)
+ return 0;
+
+ f = td->files[ipo->fileno];
+
+ switch (ipo->file_action) {
+ case FIO_LOG_OPEN_FILE:
+ ret = td_io_open_file(td, f);
+ if (!ret) {
+ free(ipo);
+ break;
+ }
+ td_verror(td, ret, "iolog open file");
+ return -1;
+ case FIO_LOG_CLOSE_FILE:
+ td_io_close_file(td, f);
+ break;
+ case FIO_LOG_UNLINK_FILE:
+ unlink(f->file_name);
+ break;
+ default:
+ log_err("fio: bad file action %d\n", ipo->file_action);
+ break;
+ }
+
+ return 1;
+}
+