Skip to content

Commit

Permalink
doc: add ftruncate engine documentation and example jobfile
Browse files Browse the repository at this point in the history
Signed-off-by: Sitsofe Wheeler <[email protected]>
  • Loading branch information
sitsofe authored and Dmitry Monakhov committed Apr 10, 2017
1 parent a467027 commit 761cd09
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
5 changes: 5 additions & 0 deletions HOWTO
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
27 changes: 27 additions & 0 deletions examples/ftruncate.fio
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 761cd09

Please sign in to comment.