MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / mvol_write_block

Function mvol_write_block

src/burp/mvol.cpp:1382–1413  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1380}
1381
1382const UCHAR* mvol_write_block(BurpGlobals* tdgbl, const UCHAR* ptr, ULONG count)
1383{
1384 // To handle tape drives & Multi-volume boundaries, use the normal
1385 // write function, instead of doing a more optimal bulk write.
1386
1387 while (count)
1388 {
1389 // If buffer full, dump it
1390 if (tdgbl->blk_io_cnt <= 0)
1391 {
1392 mvol_write(*ptr++, &tdgbl->blk_io_cnt, &tdgbl->blk_io_ptr);
1393
1394 // One byte was written by mvol_write
1395 count--;
1396 }
1397
1398 const ULONG n = MIN(count, (ULONG) tdgbl->blk_io_cnt);
1399
1400 // Copy data to the IO buffer
1401
1402 memcpy(tdgbl->blk_io_ptr, ptr, n);
1403 ptr += n;
1404
1405 // Skip ahead in current buffer
1406
1407 count -= n;
1408 tdgbl->blk_io_cnt -= n;
1409 tdgbl->blk_io_ptr += n;
1410
1411 }
1412 return ptr;
1413}
1414
1415
1416//____________________________________________________________

Callers 1

crypt_write_blockFunction · 0.85

Calls 1

mvol_writeFunction · 0.85

Tested by

no test coverage detected