Add support for trim as a workload type

This only works on Linux so far, and it's always sync given what
the interface to the kernel looks like. Also restricted to pure
block devices.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
diff --git a/ioengines.c b/ioengines.c
index bb7833f..b43374e 100644
--- a/ioengines.c
+++ b/ioengines.c
@@ -293,7 +293,7 @@
 			 "support direct IO, or iomem_align= is bad.\n");
 	}
 
-	if (!td->io_ops->commit) {
+	if (!td->io_ops->commit || ddir_trim(io_u->ddir)) {
 		io_u_mark_submit(td, 1);
 		io_u_mark_complete(td, 1);
 	}
@@ -302,8 +302,7 @@
 		if (ddir_rw(io_u->ddir)) {
 			io_u_mark_depth(td, 1);
 			td->ts.total_io_u[io_u->ddir]++;
-		} else if (io_u->ddir == DDIR_TRIM)
-			td->ts.total_io_u[2]++;
+		}
 	} else if (ret == FIO_Q_QUEUED) {
 		int r;