MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / adfWriteBitmapBlock

Function adfWriteBitmapBlock

dep/adflib/src/adf_bitm.c:470–490  ·  view source on GitHub ↗

* adfWriteBitmapBlock * * OK */

Source from the content-addressed store, hash-verified

468 * OK
469 */
470RETCODE
471adfWriteBitmapBlock(struct Volume* vol, SECTNUM nSect, struct bBitmapBlock* bitm)
472{
473 uint8_t buf[LOGICAL_BLOCK_SIZE];
474 uint32_t newSum;
475
476 memcpy(buf,bitm,LOGICAL_BLOCK_SIZE);
477#ifdef LITT_ENDIAN
478 /* little to big */
479 swapEndian(buf, SWBL_BITMAP);
480#endif
481
482 newSum = adfNormalSum(buf, 0, LOGICAL_BLOCK_SIZE);
483 swLong(buf,newSum);
484
485/* dumpBlock((uint8_t*)buf);*/
486 if (adfWriteBlock(vol, nSect, (uint8_t*)buf)!=RC_OK)
487 return RC_ERROR;
488
489 return RC_OK;
490}
491
492
493/*

Callers 1

adfUpdateBitmapFunction · 0.85

Calls 4

swapEndianFunction · 0.85
adfNormalSumFunction · 0.85
swLongFunction · 0.85
adfWriteBlockFunction · 0.85

Tested by

no test coverage detected