doc: add ftruncate engine documentation and example jobfile
authorSitsofe Wheeler <sitsofe@yahoo.com>
Mon, 10 Apr 2017 15:37:00 +0000 (18:37 +0300)
committerDmitry Monakhov <dmonakhov@openvz.org>
Mon, 10 Apr 2017 15:37:00 +0000 (18:37 +0300)
Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
HOWTO
examples/ftruncate.fio [new file with mode: 0644]

diff --git a/HOWTO b/HOWTO
index 80b9e75a75cf52ba86b38f6e1addea8f4a118b52..ffdcb755f1a25a0f41158ae2767826a3ec910ac8 100644 (file)
--- a/HOWTO
+++ b/HOWTO
@@ -1675,6 +1675,11 @@ I/O engine
                        DDIR_TRIM
                                does fallocate(,mode = FALLOC_FL_KEEP_SIZE|FALLOC_FL_PUNCH_HOLE).
 
+               **ftruncate**
+                       I/O engine that sends :manpage:`ftruncate(2)` operations in response
+                       to write (DDIR_WRITE) events. Each ftruncate issued sets the file's
+                       size to the current block offset. Block size is ignored.
+
                **e4defrag**
                        I/O engine that does regular EXT4_IOC_MOVE_EXT ioctls to simulate
                        defragment activity in request to DDIR_WRITE event.
diff --git a/examples/ftruncate.fio b/examples/ftruncate.fio
new file mode 100644 (file)
index 0000000..a6ef457
--- /dev/null
@@ -0,0 +1,27 @@
+# Example ftruncate engine jobs
+
+[global]
+ioengine=ftruncate
+directory=/scratch
+size=102404k ; 100Mb+4k
+stonewall
+filename=truncate
+runtime=10s
+time_based
+direct=1
+#
+# bs option is stub here. Truncation is performed on the current block offset.
+# blocksize value is ignored
+bs=4k
+
+# truncate the file to 4Kbytes then repeatedly grow the file back to just over
+# its original size using subsequent truncates
+[grow-truncate]
+rw=write
+
+# Repeatedly change a file to a random size between 0Kbytes and 100Mb
+# using truncates
+[rand-truncate]
+rw=randwrite
+norandommap
+