Boost.AFIO    Boost C++ Libraries
Functions
Zeroing and Deallocation

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.

Function Documentation

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.

Returns:
A batch of op handles.
Parameters:
opsA batch of op handles.
rangesA batch of vectors of extents to zero and deallocate.

Definition at line 3661 of file afio.hpp.

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.

Returns:
A future<void>
Parameters:
_preconditionThe precondition to use.
rangesA sequence of extents to zero and deallocate

{Amortised O(1) to dispatch. Amortised O(1) to complete if deallocation is constant time.} {extents_example}

Definition at line 4925 of file afio.hpp.

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.

Parameters:
_preconditionThe precondition to use.
rangesA 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}

Definition at line 4941 of file afio.hpp.

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.

Parameters:
_ecError code to set.
_preconditionThe precondition to use.
rangesA 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}

Definition at line 4958 of file afio.hpp.


January, 2014

Copyright © 2013-2014 Niall Douglas, Cork, Ireland
Copyright © 2013 Paul Kirth, California
Documentation is generated by Doxygen