3 ms·
See fallocate() for Linux/ext4. http://man7.org/linux/man-pages/man2/fallocate.2.html http://man7.org/linux/man-pages/man2/fallocate.2.html
by tyingq 7y ago
See fallocate() for Linux/ext4. http://man7.org/linux/man-pages/man2/fallocate.2.html http://man7.org/linux/man-pages/man2/fallocate.2.html
- maxxxxx 7y agoIt looks like this will zero out data but not remove.
- andoma 7y agoIt will remove if you use FALLOC_FL_COLLAPSE_RANGE
- maxxxxx 7y agoBut: " A filesystem may place limitations on the granularity of the operation, in order to ensure efficient implementation. Typically, offset and len must be a multiple of the filesystem logical block size, which varies according to the filesystem type and configuration. If a filesystem has such a requirement, fallocate() fails with the error EINVAL if this requirement is violated." Seems it's limited.
- andoma 7y agoCorrect, my bad. Did some tests and AFAICT neither EXT4, XFS nor BTRFS allows arbitrary byte ranges here.
- deleted 7y ago[deleted]
- minaguib 7y agoI've written a quick tutorial on linux sparse files/fallocate and effect on different writers/readers: https://gist.github.com/minaguib/1cbe29922b06d50755a2f580b8c343fa https://gist.github.com/minaguib/1cbe29922b06d50755a2f580b8c...