Lines Matching defs:vcb
93 ExtendedVCB *vcb = HFSTOVCB(hfsmp);
116 vcb->vcbSigWord = SWAP_BE16 (mdb->drSigWord);
117 vcb->vcbCrDate = to_bsd_time(LocalToUTC(SWAP_BE32(mdb->drCrDate)));
118 vcb->localCreateDate = SWAP_BE32 (mdb->drCrDate);
119 vcb->vcbLsMod = to_bsd_time(LocalToUTC(SWAP_BE32(mdb->drLsMod)));
120 vcb->vcbAtrb = SWAP_BE16 (mdb->drAtrb);
121 vcb->vcbNmFls = SWAP_BE16 (mdb->drNmFls);
122 vcb->vcbVBMSt = SWAP_BE16 (mdb->drVBMSt);
123 vcb->nextAllocation = SWAP_BE16 (mdb->drAllocPtr);
124 vcb->totalBlocks = SWAP_BE16 (mdb->drNmAlBlks);
125 vcb->allocLimit = vcb->totalBlocks;
126 vcb->blockSize = SWAP_BE32 (mdb->drAlBlkSiz);
127 vcb->vcbClpSiz = SWAP_BE32 (mdb->drClpSiz);
128 vcb->vcbAlBlSt = SWAP_BE16 (mdb->drAlBlSt);
129 vcb->vcbNxtCNID = SWAP_BE32 (mdb->drNxtCNID);
130 vcb->freeBlocks = SWAP_BE16 (mdb->drFreeBks);
131 vcb->vcbVolBkUp = to_bsd_time(LocalToUTC(SWAP_BE32(mdb->drVolBkUp)));
132 vcb->vcbWrCnt = SWAP_BE32 (mdb->drWrCnt);
133 vcb->vcbNmRtDirs = SWAP_BE16 (mdb->drNmRtDirs);
134 vcb->vcbFilCnt = SWAP_BE32 (mdb->drFilCnt);
135 vcb->vcbDirCnt = SWAP_BE32 (mdb->drDirCnt);
136 bcopy(mdb->drFndrInfo, vcb->vcbFndrInfo, sizeof(vcb->vcbFndrInfo));
138 vcb->vcbWrCnt++; /* Compensate for write of MDB on last flush */
141 error = hfs_to_utf8(vcb, mdb->drVN, NAME_MAX, &utf8chars, vcb->vcbVN);
147 (void) mac_roman_to_utf8(mdb->drVN, NAME_MAX, &utf8chars, vcb->vcbVN);
149 hfsmp->hfs_logBlockSize = BestBlockSizeFit(vcb->blockSize, MAXBSIZE, hfsmp->hfs_logical_block_size);
150 vcb->vcbVBMIOSize = kHFSBlockSize;
170 fork.cf_blocks = fork.cf_size / vcb->blockSize;
199 fork.cf_blocks = fork.cf_size / vcb->blockSize;
244 vcb->vcbAtrb &= ~kHFSVolumeUnmountedMask;
253 if ( !(vcb->vcbAtrb & kHFSVolumeHardwareLockMask) ) // if the disk is not write protected
255 MarkVCBDirty( vcb ); // mark VCB dirty so it will be written
287 register ExtendedVCB *vcb;
356 vcb = HFSTOVCB(hfsmp);
358 vcb->vcbSigWord = signature;
359 vcb->vcbJinfoBlock = SWAP_BE32(vhp->journalInfoBlock);
360 vcb->vcbLsMod = to_bsd_time(SWAP_BE32(vhp->modifyDate));
361 vcb->vcbAtrb = SWAP_BE32(vhp->attributes);
362 vcb->vcbClpSiz = SWAP_BE32(vhp->rsrcClumpSize);
363 vcb->vcbNxtCNID = SWAP_BE32(vhp->nextCatalogID);
364 vcb->vcbVolBkUp = to_bsd_time(SWAP_BE32(vhp->backupDate));
365 vcb->vcbWrCnt = SWAP_BE32(vhp->writeCount);
366 vcb->vcbFilCnt = SWAP_BE32(vhp->fileCount);
367 vcb->vcbDirCnt = SWAP_BE32(vhp->folderCount);
370 bcopy(vhp->finderInfo, vcb->vcbFndrInfo, sizeof(vhp->finderInfo));
372 vcb->vcbAlBlSt = 0; /* hfs+ allocation blocks start at first block of volume */
374 vcb->vcbWrCnt++; /* compensate for write of Volume Header on last flush */
377 vcb->nextAllocation = SWAP_BE32(vhp->nextAllocation);
378 vcb->totalBlocks = SWAP_BE32(vhp->totalBlocks);
379 vcb->allocLimit = vcb->totalBlocks;
380 vcb->freeBlocks = SWAP_BE32(vhp->freeBlocks);
381 vcb->blockSize = blockSize;
382 vcb->encodingsBitmap = SWAP_BE64(vhp->encodingsBitmap);
383 vcb->localCreateDate = SWAP_BE32(vhp->createDate);
385 vcb->hfsPlusIOPosOffset = embeddedOffset;
388 vcb->reserveBlocks = 0;
395 hfsmp->hfs_logBlockSize = BestBlockSizeFit(vcb->blockSize, MAXBSIZE, hfsmp->hfs_logical_block_size);
396 vcb->vcbVBMIOSize = min(vcb->blockSize, MAXPHYSIO);
402 (((daddr64_t)vcb->totalBlocks * blockSize) /
587 vcb->vcbCrDate = cnattr.ca_itime;
588 vcb->volumeNameEncodingHint = cndesc.cd_encoding;
589 bcopy(cndesc.cd_nameptr, vcb->vcbVN, min(255, cndesc.cd_namelen));
593 vcb->vcbAtrb &= ~kHFSVolumeUnmountedMask;
609 if ( (vcb->vcbAtrb & kHFSVolumeJournaledMask)
655 } else if (hfsmp->jnl || ((vcb->vcbAtrb & kHFSVolumeJournaledMask) && (hfsmp->hfs_flags & HFS_READ_ONLY))) {
659 vcb->vcbAtrb &= ~kHFSVolumeJournaledMask;
664 hfsmp->hfs_jnlinfoblkid = GetFileInfo(vcb, kRootDirID, ".journal_info_block", &jinfo_attr, NULL);
665 hfsmp->hfs_jnlfileid = GetFileInfo(vcb, kRootDirID, ".journal", &jnl_attr, NULL);
672 vcb->vcbAtrb |= kHFSVolumeJournaledMask;
690 if (vcb->nextAllocation >= hfsmp->hfs_metazone_start &&
691 vcb->nextAllocation <= hfsmp->hfs_metazone_end) {
703 if ( !(vcb->vcbAtrb & kHFSVolumeHardwareLockMask) ) // if the disk is not write protected
705 MarkVCBDirty( vcb ); // mark VCB dirty so it will be written
1142 GetFileInfo(ExtendedVCB *vcb, __unused u_int32_t dirid, const char *name,
1150 if (vcb->vcbSigWord != kHFSPlusSigWord)
1153 hfsmp = VCBTOHFS(vcb);
1190 ExtendedVCB *vcb;
1207 vcb = HFSTOVCB(hfsmp);
1315 if (TruncateFileC(vcb, (FCB*)&dfork, fsize, false) != 0) {
1347 if (TruncateFileC(vcb, (FCB*)&rfork, 0, false) != 0) {
1924 // journaling bit in the vcb and assume it will get written to disk
1943 ExtendedVCB *vcb;
1951 vcb = HFSTOVCB(hfsmp);
1962 fid = GetFileInfo(vcb, kRootDirID, ".journal_info_block", &jib_attr, &jib_fork);
1966 vcb->vcbAtrb &= ~kHFSVolumeJournaledMask;
1976 vcb->vcbJinfoBlock = jib_fork.cf_extents[0].startBlock;
1984 (daddr64_t)(vcb->hfsPlusIOPosOffset / hfsmp->hfs_logical_block_size +
1989 vcb->vcbAtrb &= ~kHFSVolumeJournaledMask;
1998 fid = GetFileInfo(vcb, kRootDirID, ".journal", &jattr, &jfork);
2003 vcb->vcbAtrb &= ~kHFSVolumeJournaledMask;
2009 if ((jib_offset / (u_int64_t)vcb->blockSize) != jfork.cf_extents[0].startBlock) {
2011 (jib_offset / (u_int64_t)vcb->blockSize), jfork.cf_extents[0].startBlock);
2013 jib_offset = (u_int64_t)jfork.cf_extents[0].startBlock * (u_int64_t)vcb->blockSize;
2019 if (jib_size != (u_int64_t)jfork.cf_extents[0].blockCount*vcb->blockSize) {
2021 jib_size, (u_int64_t)jfork.cf_extents[0].blockCount*vcb->blockSize);
2023 jib_size = (u_int64_t)jfork.cf_extents[0].blockCount * vcb->blockSize;
2045 jib_offset + (off_t)vcb->hfsPlusIOPosOffset,
2064 jib_offset + (off_t)vcb->hfsPlusIOPosOffset, jib_size);
2066 jib_offset + (off_t)vcb->hfsPlusIOPosOffset,
2091 // jib_offset + (off_t)vcb->hfsPlusIOPosOffset,
2095 jib_offset + (off_t)vcb->hfsPlusIOPosOffset,
2161 ExtendedVCB *vcb;
2169 vcb = HFSTOVCB(hfsmp);
2170 fs_size = (u_int64_t)vcb->blockSize * (u_int64_t)vcb->totalBlocks;
2186 zonesize = roundup(vcb->totalBlocks / 8, vcb->vcbVBMIOSize);
2196 hfsmp->hfs_overflow_maxblks = filesize / vcb->blockSize;
2216 hfsmp->hfs_catalog_maxblks = filesize / vcb->blockSize;
2271 zonesize = roundup(zonesize, (u_int64_t)vcb->vcbVBMIOSize * 8 * vcb->blockSize);
2274 hfsmp->hfs_catalog_maxblks += (temp - (temp / 3)) / vcb->blockSize;
2276 hfsmp->hfs_hotfile_maxblks = filesize / vcb->blockSize;
2279 blk = zonesize / vcb->blockSize;
2286 hfsmp->hfs_hotfile_start = blk - (filesize / vcb->blockSize);
2301 ExtendedVCB *vcb = HFSTOVCB(hfsmp);
2306 freeblocks = MetaZoneFreeBlocks(vcb);