... instead of using a multi-variable state machine.
The net effect of this code is exactly the same as the previous implementation,
except:
- the operation after Write() returns an error might differ
- If the file ends with zeroes, we don't Seek(-1), and
we don't create a hole at all if it is too small, preferring
to save a syscall.
But this formulation is hopefully easier to prove correct.
Signed-off-by: Miloslav Trmač <mitr@redhat.com>