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

Function b_writeab

dep/hfsutils/libhfs/block.c:740–757  ·  view source on GitHub ↗

* NAME: block->writeab() * DESCRIPTION: write a block to an allocation block to a volume */

Source from the content-addressed store, hash-verified

738 * DESCRIPTION: write a block to an allocation block to a volume
739 */
740int b_writeab(hfsvol *vol,
741 unsigned int anum, unsigned int index, const block *bp)
742{
743 /* verify the allocation block exists and is marked as in-use */
744
745 if (anum >= vol->mdb.drNmAlBlks)
746 ERROR(EIO, "write nonexistent allocation block");
747 else if (vol->vbm && ! BMTST(vol->vbm, anum))
748 ERROR(EIO, "write unallocated block");
749
750 if (v_dirty(vol) == -1)
751 goto fail;
752
753 return b_writelb(vol, vol->mdb.drAlBlSt + anum * vol->lpa + index, bp);
754
755fail:
756 return -1;
757}
758
759/*
760 * NAME: block->size()

Callers 1

v_allocblocksFunction · 0.85

Calls 2

v_dirtyFunction · 0.85
b_writelbFunction · 0.85

Tested by

no test coverage detected