1*f0ba4377SMauro Carvalho Chehab======== 2*f0ba4377SMauro Carvalho Chehabdm-delay 3*f0ba4377SMauro Carvalho Chehab======== 4*f0ba4377SMauro Carvalho Chehab 5*f0ba4377SMauro Carvalho ChehabDevice-Mapper's "delay" target delays reads and/or writes 6*f0ba4377SMauro Carvalho Chehaband maps them to different devices. 7*f0ba4377SMauro Carvalho Chehab 8*f0ba4377SMauro Carvalho ChehabParameters:: 9*f0ba4377SMauro Carvalho Chehab 10*f0ba4377SMauro Carvalho Chehab <device> <offset> <delay> [<write_device> <write_offset> <write_delay> 11*f0ba4377SMauro Carvalho Chehab [<flush_device> <flush_offset> <flush_delay>]] 12*f0ba4377SMauro Carvalho Chehab 13*f0ba4377SMauro Carvalho ChehabWith separate write parameters, the first set is only used for reads. 14*f0ba4377SMauro Carvalho ChehabOffsets are specified in sectors. 15*f0ba4377SMauro Carvalho ChehabDelays are specified in milliseconds. 16*f0ba4377SMauro Carvalho Chehab 17*f0ba4377SMauro Carvalho ChehabExample scripts 18*f0ba4377SMauro Carvalho Chehab=============== 19*f0ba4377SMauro Carvalho Chehab 20*f0ba4377SMauro Carvalho Chehab:: 21*f0ba4377SMauro Carvalho Chehab 22*f0ba4377SMauro Carvalho Chehab #!/bin/sh 23*f0ba4377SMauro Carvalho Chehab # Create device delaying rw operation for 500ms 24*f0ba4377SMauro Carvalho Chehab echo "0 `blockdev --getsz $1` delay $1 0 500" | dmsetup create delayed 25*f0ba4377SMauro Carvalho Chehab 26*f0ba4377SMauro Carvalho Chehab:: 27*f0ba4377SMauro Carvalho Chehab 28*f0ba4377SMauro Carvalho Chehab #!/bin/sh 29*f0ba4377SMauro Carvalho Chehab # Create device delaying only write operation for 500ms and 30*f0ba4377SMauro Carvalho Chehab # splitting reads and writes to different devices $1 $2 31*f0ba4377SMauro Carvalho Chehab echo "0 `blockdev --getsz $1` delay $1 0 0 $2 0 500" | dmsetup create delayed 32