Lines Matching refs:handle
131 wipefs_alloc(int fd, size_t block_size, wipefs_ctx *handle)
140 *handle = NULL;
173 *handle = new __wipefs_ctx;
174 if (*handle == NULL) {
179 (*handle)->fd = fd;
180 extMan = &(*handle)->extMan;
201 wipefs_free(handle);
207 wipefs_include_blocks(wipefs_ctx handle, off_t block_offset, off_t nblocks)
211 handle->extMan.AddBlockRangeExtent(block_offset, nblocks);
223 wipefs_except_blocks(wipefs_ctx handle, off_t block_offset, off_t nblocks)
227 handle->extMan.RemoveBlockRangeExtent(block_offset, nblocks);
239 wipefs_wipe(wipefs_ctx handle)
249 extent.length = handle->extMan.totalBytes;
259 ioctl(handle->fd, DKIOCUNMAP, (caddr_t)&unmap);
263 if (handle->extMan.nativeBlockSize > bufSize) {
264 bufSize = handle->extMan.nativeBlockSize;
272 blockSize = handle->extMan.blockSize;
273 totalBytes = handle->extMan.totalBytes;
275 for (curExt = handle->extMan.extentList.begin(); curExt != handle->extMan.extentList.end(); curExt++) {
279 if (byteOffset % handle->extMan.nativeBlockSize != 0 ||
280 numBytes % handle->extMan.nativeBlockSize != 0) {
281 size_t nativeBlockSize = handle->extMan.nativeBlockSize;
293 if (pwrite(handle->fd, bufZero, numBytesToWrite, byteOffset) != (ssize_t)numBytesToWrite) {
309 wipefs_free(wipefs_ctx *handle)
311 if (*handle != NULL) {
312 delete *handle;
313 *handle = NULL;