btrfs: punch holes and prealloc extents with send
authorFilipe David Borba Manana <fdmanana@gmail.com>
Tue, 22 Apr 2014 00:45:53 +0000 (10:45 +1000)
committerDave Chinner <david@fromorbit.com>
Tue, 22 Apr 2014 00:45:53 +0000 (10:45 +1000)
commitf81be18fa837b244a05acc7024a69c38747ee6eb
tree0fa16838e040e0ab8ee67e5451e5bcf114e9c161
parentcd444c6591df7cc1dd2989b81259c9e9e6744613
btrfs: punch holes and prealloc extents with send

This test verifies that after an incremental btrfs send the
replicated file has the same exact hole and data structure as in
the origin filesystem. This didn't use to be the case before the
send stream version 2 - holes were sent as write operations of 0
valued bytes instead of punching holes with the fallocate system
call, and pre-allocated extents were sent as well as write
operations of 0 valued bytes instead of intructions for the
receiver to use the fallocate system call.

It also checks that prealloc extents that lie beyond the file's
size are replicated by an incremental send.

Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
common/rc
tests/btrfs/047 [new file with mode: 0755]
tests/btrfs/047.out [new file with mode: 0644]
tests/btrfs/group