punch-alternating: add some options
authorEric Sandeen <sandeen@sandeen.net>
Thu, 4 May 2017 18:25:05 +0000 (13:25 -0500)
committerEryu Guan <eguan@redhat.com>
Fri, 5 May 2017 09:17:39 +0000 (17:17 +0800)
commit54ac0dd3086d2ab4f153c08811da229a23916c68
tree67da3c7ec22f133ebc7cac382161b6b4d718f9ba
parent5fcc706aab436ca07ecc628c04146021fbe663f9
punch-alternating: add some options

I didn't end up using this, but somebody else might find
it useful, so sending it.

This change lets us specify punch patterns other than
literally every other block.

i.e. punch-alternating with no options will do:

...HDHDHDHDHDHD...

-i 4 -s 2 will do:

...DDHHDDHHDDHH...

or -i 3 -s 1 will do:

...DDHDDHDDHDDH...

[eguan: don't allow 0 size and fixed perror string]

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
src/punch-alternating.c