Functions | |
virtual std::vector< future<> > | boost::afio::dispatcher::zero (const std::vector< future<>> &ops, const std::vector< std::vector< std::pair< off_t, off_t >>> &ranges)=0 |
Schedule a batch of asynchronous zeroing and deallocations of physical storage ("hole punching") after preceding operations. | |
future | boost::afio::async_zero (future<> _precondition, std::vector< std::pair< off_t, off_t >> ranges) |
Asynchronous zeroing and deallocation of physical storage ("hole punching") after a preceding operation. | |
void | boost::afio::zero (future<> _precondition, std::vector< std::pair< off_t, off_t >> ranges) |
Synchronous zeroing and deallocation of physical storage ("hole punching") after a preceding operation. | |
void | boost::afio::zero (error_code &_ec, future<> _precondition, std::vector< std::pair< off_t, off_t >> ranges) |
Synchronous zeroing and deallocation of physical storage ("hole punching") after a preceding operation. |
future boost::afio::dispatcher::zero | ( | const std::vector< future<>> & | ops, |
const std::vector< std::vector< std::pair< off_t, off_t >>> & | ranges | ||
) | [pure virtual] |
Schedule a batch of asynchronous zeroing and deallocations of physical storage ("hole punching") after preceding operations.
Most extent based filing systems provide an optimised way of zeroing parts of a file by deallocating the storage backing those regions, and marking those regions as unwritten instead of actually writing zero bytes to storage. They appear as zeroes to anything reading those ranges, and have the big advantage of not consuming any actual physical storage. On Windows, extent deallocation writes zeros for ordinary files and only actually deallocates physical storage if the file is sparse or compressed (note that AFIO by default creates sparse files where possible, and converts any file opened for writing to a sparse file). For your information, deallocation on NTFS is on a 64Kb granularity, but the zeros are written at a byte granularity. On Linux, an attempt is made to use FALLOC_FL_PUNCH_HOLE which if it fails then a write of zeros corresponding to the same ranges is made instead. On FreeBSD, long runs of zeros are automatically detected and eliminated on physical storage, and so zeros are simply written. On OS X, there is no formal hole punching API that we are aware of, and so zeros are simply written.
ops | A batch of op handles. |
ranges | A batch of vectors of extents to zero and deallocate. |
future boost::afio::async_zero | ( | future<> | _precondition, |
std::vector< std::pair< off_t, off_t >> | ranges | ||
) |
Asynchronous zeroing and deallocation of physical storage ("hole punching") after a preceding operation.
_precondition | The precondition to use. |
ranges | A sequence of extents to zero and deallocate |
{Amortised O(1) to dispatch. Amortised O(1) to complete if deallocation is constant time.} {extents_example}
void boost::afio::zero | ( | future<> | _precondition, |
std::vector< std::pair< off_t, off_t >> | ranges | ||
) |
Synchronous zeroing and deallocation of physical storage ("hole punching") after a preceding operation.
_precondition | The precondition to use. |
ranges | A sequence of extents to zero and deallocate |
{distinguish, throwing} {Amortised O(1) to dispatch. Amortised O(1) to complete if deallocation is constant time.} {extents_example}
void boost::afio::zero | ( | error_code & | _ec, |
future<> | _precondition, | ||
std::vector< std::pair< off_t, off_t >> | ranges | ||
) |
Synchronous zeroing and deallocation of physical storage ("hole punching") after a preceding operation.
_ec | Error code to set. |
_precondition | The precondition to use. |
ranges | A sequence of extents to zero and deallocate |
{distinguish, non throwing} {Amortised O(1) to dispatch. Amortised O(1) to complete if deallocation is constant time.} {extents_example}
January, 2014 |
Copyright © 2013-2014 Niall Douglas, Cork, Ireland Copyright © 2013 Paul Kirth, California |