Lines Matching defs:vcb
116 const ExtendedVCB *vcb,
126 const ExtendedVCB *vcb,
132 ExtendedVCB *vcb,
143 ExtendedVCB *vcb,
153 ExtendedVCB *vcb,
162 ExtendedVCB *vcb,
168 ExtendedVCB *vcb,
175 ExtendedVCB *vcb,
182 ExtendedVCB *vcb,
202 // vcb Volume to search
217 const ExtendedVCB *vcb,
235 fcb = GetFileControlBlock(vcb->extentsRefNum);
240 if (vcb->vcbSigWord == kHFSSigWord) {
347 ExtendedVCB *vcb,
371 lockflags = hfs_systemfile_lock(vcb, SFL_EXTENTS, HFS_EXCLUSIVE_LOCK);
373 if (vcb->vcbSigWord == kHFSSigWord) {
400 err = BTInsertRecord(GetFileControlBlock(vcb->extentsRefNum), btIterator, &btRecord, btRecordSize);
405 (void) BTFlushPath(GetFileControlBlock(vcb->extentsRefNum));
407 hfs_systemfile_unlock(vcb, lockflags);
415 const ExtendedVCB *vcb,
428 if (vcb->vcbSigWord == kHFSSigWord) {
448 err = BTDeleteRecord(GetFileControlBlock(vcb->extentsRefNum), btIterator);
449 (void) BTFlushPath(GetFileControlBlock(vcb->extentsRefNum));
467 ExtendedVCB *vcb, // volume that file resides on
489 allocBlockSize = vcb->blockSize;
490 sectorSize = VCBTOHFS(vcb)->hfs_logical_block_size;
492 err = SearchExtentFile(vcb, fcb, offset, &foundKey, foundData, &foundIndex, &hint, &nextFABN);
523 if (vcb->vcbSigWord == kHFSPlusSigWord)
524 temp += vcb->hfsPlusIOPosOffset / sectorSize;
526 temp += vcb->vcbAlBlSt;
555 ExtendedVCB *vcb,
567 if (vcb->vcbSigWord == kHFSPlusSigWord)
585 err = BlockDeallocate( vcb, extentRecord[extentIndex].startBlock, numAllocationBlocks );
605 // vcb Volume to operate on
612 ExtendedVCB *vcb,
633 lockflags = hfs_systemfile_lock(vcb, SFL_EXTENTS, HFS_EXCLUSIVE_LOCK);
636 err = FindExtentRecord(vcb, forkType, fileID, startBlock, false, &key, extents, &hint);
643 err = ReleaseExtents( vcb, extents, &numberExtentsReleased, &releasedLastExtent );
646 err = DeleteExtentRecord(vcb, forkType, fileID, startBlock);
652 hfs_systemfile_unlock(vcb, lockflags);
666 ExtendedVCB *vcb,
677 err = ReleaseExtents( vcb, catalogExtents, &numReleasedAllocationBlocks, &releasedLastExtent );
680 err = TruncateExtents(vcb, forkType, fileID, numReleasedAllocationBlocks, recordDeleted);
692 OSErr FlushExtentFile( ExtendedVCB *vcb )
698 fcb = GetFileControlBlock(vcb->extentsRefNum);
700 lockflags = hfs_systemfile_lock(vcb, SFL_EXTENTS, HFS_EXCLUSIVE_LOCK);
702 hfs_systemfile_unlock(vcb, lockflags);
710 MarkVCBDirty( vcb );
711 // err = FlushVolumeControlBlock( vcb );
853 AddFileExtent(ExtendedVCB *vcb, FCB *fcb, u_int32_t startBlock, u_int32_t blockCount)
864 peof = (int64_t)(fcb->ff_blocks + blockCount) * (int64_t)vcb->blockSize;
866 error = SearchExtentFile(vcb, fcb, peof-1, &foundKey, foundData, &foundIndex, &hint, &nextBlock);
896 error = CreateExtentRecord(vcb, &foundKey, foundData, &hint);
905 error = UpdateExtentRecord(vcb, fcb, &foundKey, foundData, hint);
907 (void) FlushExtentFile(vcb);
923 ExtendedVCB *vcb, // volume that file resides on
956 volumeBlockSize = vcb->blockSize;
961 if (vcb->vcbSigWord == kHFSPlusSigWord)
969 if (vcb->vcbSigWord == kHFSSigWord) {
986 && (vcb->vcbSigWord == kHFSPlusSigWord)
988 && (blocksToAdd < hfs_freeblks(VCBTOHFS(vcb), 1))) {
989 HFS_MOUNT_LOCK(vcb, TRUE);
990 vcb->loanedBlocks += blocksToAdd;
991 HFS_MOUNT_UNLOCK(vcb, TRUE);
1014 HFS_MOUNT_LOCK(vcb, TRUE);
1015 vcb->loanedBlocks -= loanedBlocks;
1016 HFS_MOUNT_UNLOCK(vcb, TRUE);
1024 if ((vcb->vcbClpSiz > (int32_t)volumeBlockSize)
1027 maximumBytes = (int64_t)howmany(bytesToAdd, vcb->vcbClpSiz);
1028 maximumBytes *= vcb->vcbClpSiz;
1036 if ( (vcb->vcbSigWord == kHFSSigWord) && // Too big?
1051 (blocksToAdd > hfs_freeblks(VCBTOHFS(vcb), flags & kEFReserveMask))) {
1060 err = SearchExtentFile(vcb, fcb, peof-1, &foundKey, foundData, &foundIndex, &hint, &nextBlock);
1093 vcb->vcbFreeExtCnt = 0; /* For now, force rebuild of free extent list */
1104 availbytes = (int64_t)hfs_freeblks(VCBTOHFS(vcb), flags & kEFReserveMask) *
1113 vcb,
1152 err = UpdateExtentRecord(vcb, fcb, &foundKey, foundData, hint);
1164 (void) BlockDeallocate(vcb, actualStartBlock, actualNumBlocks);
1190 err = CreateExtentRecord(vcb, &foundKey, foundData, &hint);
1195 (void) BlockDeallocate(vcb, actualStartBlock, actualNumBlocks);
1206 err = UpdateExtentRecord(vcb, fcb, &foundKey, foundData, hint);
1239 if (VCBTOHFS(vcb)->hfs_flags & HFS_METADATA_ZONE) {
1241 if (vcb->nextAllocation >= VCBTOHFS(vcb)->hfs_metazone_start &&
1242 vcb->nextAllocation <= VCBTOHFS(vcb)->hfs_metazone_end) {
1243 HFS_MOUNT_LOCK(vcb, TRUE);
1244 HFS_UPDATE_NEXT_ALLOCATION(vcb, VCBTOHFS(vcb)->hfs_metazone_end + 1);
1245 MarkVCBDirty(vcb);
1246 HFS_MOUNT_UNLOCK(vcb, TRUE);
1256 (void) FlushExtentFile(vcb);
1280 ExtendedVCB *vcb, // volume that file resides on
1303 if (vcb->vcbSigWord == kHFSPlusSigWord)
1321 nextBlock = howmany(peof, vcb->blockSize); // number of allocation blocks to remain in file
1322 peof = (int64_t)((int64_t)nextBlock * (int64_t)vcb->blockSize); // number of bytes in those blocks
1323 if ((vcb->vcbSigWord == kHFSSigWord) && (peof >= kTwoGigabytes)) {
1337 numBlocks = peof / vcb->blockSize;
1353 err = DeallocateFork(vcb, FTOC(fcb)->c_fileid, forkType, fcb->fcbExtents, &recordDeleted);
1372 err = SearchExtentFile(vcb, fcb, peof-1, &key, extentRecord, &extentIndex, &hint, &extentNextBlock);
1387 err = BlockDeallocate(vcb, startBlock, numBlocks);
1411 err = BlockDeallocate(vcb, extentRecord[extentIndex].startBlock, numBlocks);
1429 err = UpdateExtentRecord(vcb, fcb, &key, extentRecord, hint);
1439 err = TruncateExtents(vcb, forkType, FTOC(fcb)->c_fileid, nextBlock, &recordDeleted);
1444 (void) FlushExtentFile(vcb);
1456 ExtendedVCB *vcb,
1472 if (vcb->vcbSigWord != kHFSPlusSigWord)
1491 error = BlockDeallocate(vcb, fcb->fcbExtents[i].startBlock, blkcnt);
1521 lockflags = hfs_systemfile_lock(vcb, SFL_EXTENTS, HFS_EXCLUSIVE_LOCK);
1529 error = FindExtentRecord(vcb, forkType, fileID, startblk, false, NULL, extents, NULL);
1549 error = BlockDeallocate(vcb, extents[i].startBlock, blkcnt);
1564 error = DeleteExtentRecord(vcb, forkType, fileID, startblk);
1576 hfs_systemfile_unlock(vcb, lockflags);
1588 (void) FlushExtentFile(vcb);
1620 ExtendedVCB *vcb,
1638 if (vcb->vcbSigWord == kHFSPlusSigWord)
1698 // Input: vcb - VCB pointer
1721 ExtendedVCB *vcb,
1736 temp64 = filePosition / (int64_t)vcb->blockSize;
1742 err = SearchExtentRecord( vcb, filePositionBlock, foundExtentData, 0,
1767 lockflags = hfs_systemfile_lock(vcb, SFL_EXTENTS, HFS_EXCLUSIVE_LOCK);
1769 err = FindExtentRecord(vcb, FORK_IS_RSRC(fcb) ? kResourceForkType : kDataForkType,
1771 hfs_systemfile_unlock(vcb, lockflags);
1794 err = SearchExtentRecord(vcb, filePositionBlock, foundExtentData, foundExtentKey->startBlock,
1811 // Input: vcb - the volume containing the extents
1824 ExtendedVCB *vcb,
1846 btFCB = GetFileControlBlock(vcb->extentsRefNum);
1858 lockflags = hfs_systemfile_lock(vcb, SFL_EXTENTS, HFS_EXCLUSIVE_LOCK);
1860 if (vcb->vcbSigWord == kHFSSigWord) {
1906 hfs_systemfile_unlock(vcb, lockflags);
2006 ExtendedVCB *vcb,
2021 if (vcb->blockSize >= nodeSize)
2024 mask = (nodeSize / vcb->blockSize) - 1;
2032 (int64_t)((int64_t)blocksChecked * (int64_t)vcb->blockSize) >= (int64_t)fcb->ff_size)
2037 lockflags = hfs_systemfile_lock(vcb, SFL_EXTENTS, HFS_EXCLUSIVE_LOCK);
2042 result = FindExtentRecord(vcb, kDataForkType, fcb->ff_cp->c_fileid, startBlock, FALSE, &key, extents, &hint);
2046 hfs_systemfile_unlock(vcb, lockflags);
2051 hfs_systemfile_unlock(vcb, lockflags);