diff options
author | David Disseldorp <ddiss@samba.org> | 2015-02-11 00:24:16 +0100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2015-03-09 21:27:07 +0100 |
commit | 1359e859328567090bf80911083605e17fbd4519 (patch) | |
tree | d4fca3226a1bf6b13e64bbea26de10c4bfc7f862 /source3/python/py_srvsvc.c | |
parent | 47f15b14ae4f3a9d83ed6f7c9ad31e74978e9606 (diff) | |
download | samba-1359e859328567090bf80911083605e17fbd4519.tar.gz samba-1359e859328567090bf80911083605e17fbd4519.tar.xz samba-1359e859328567090bf80911083605e17fbd4519.zip |
smbd/ioctl: add FSCTL_SET_ZERO_DATA support
FSCTL_SET_ZERO_DATA can be used in two ways.
- When requested against a file marked as sparse, it provides a
mechanism for requesting that the server deallocate the underlying
disk space for the corresponding zeroed range.
- When requested against a non-sparse file, it indicates that the server
should allocate and zero the corresponding range.
Both use cases can be handled in Samba using fallocate(). The Linux
specific FALLOC_FL_PUNCH_HOLE flag can be used to deallocate the
underlying disk space. After doing so, a normal fallocate() call can
be used to ensure that the zeroed range is allocated on non-sparse
files.
FSCTL_SET_ZERO_DATA requests must not result in a change to the file
size. The FSCTL_SET_ZERO_DATA handler always calls fallocate() with the
KEEP_SIZE flag set, ensuring that Samba meets this requirement.
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/python/py_srvsvc.c')
0 files changed, 0 insertions, 0 deletions