Lines Matching refs:vcb
159 ExtendedVCB *vcb;
177 vcb = HFSTOVCB(hfsmp);
178 vcb->reserveBlocks = ((u_int64_t)vcb->totalBlocks * HFS_MINFREE) / 100;
179 vcb->reserveBlocks = MIN(vcb->reserveBlocks, HFS_MAXRESERVE / vcb->blockSize);
403 ExtendedVCB *vcb;
414 vcb = HFSTOVCB(args->hfsmp);
446 strlcpy((char *)vcb->vcbVN, (const char *)cp->c_desc.cd_nameptr, NAME_MAX+1);
462 ExtendedVCB *vcb;
470 vcb = HFSTOVCB(hfsmp);
509 if (vcb->vcbSigWord == kHFSPlusSigWord)
514 if (vcb->vcbSigWord == kHFSPlusSigWord)
523 if (vcb->vcbSigWord == kHFSPlusSigWord)
529 if ((vcb->vcbSigWord == kHFSSigWord) &&
588 vcb->volumeNameEncodingHint = args->hfs_encoding;
667 ExtendedVCB *vcb;
674 vcb = HFSTOVCB(hfsmp);
676 if (vcb->vcbSigWord == kHFSSigWord)
703 priIDSector = (daddr64_t)((vcb->hfsPlusIOPosOffset / hfsmp->hfs_logical_block_size) +
722 SWAP_BE32(vhp->blockSize) != vcb->blockSize) {
727 vcb->vcbLsMod = to_bsd_time(SWAP_BE32(vhp->modifyDate));
728 vcb->vcbAtrb = SWAP_BE32 (vhp->attributes);
729 vcb->vcbJinfoBlock = SWAP_BE32(vhp->journalInfoBlock);
730 vcb->vcbClpSiz = SWAP_BE32 (vhp->rsrcClumpSize);
731 vcb->vcbNxtCNID = SWAP_BE32 (vhp->nextCatalogID);
732 vcb->vcbVolBkUp = to_bsd_time(SWAP_BE32(vhp->backupDate));
733 vcb->vcbWrCnt = SWAP_BE32 (vhp->writeCount);
734 vcb->vcbFilCnt = SWAP_BE32 (vhp->fileCount);
735 vcb->vcbDirCnt = SWAP_BE32 (vhp->folderCount);
736 HFS_UPDATE_NEXT_ALLOCATION(vcb, SWAP_BE32 (vhp->nextAllocation));
737 vcb->totalBlocks = SWAP_BE32 (vhp->totalBlocks);
738 vcb->freeBlocks = SWAP_BE32 (vhp->freeBlocks);
739 vcb->encodingsBitmap = SWAP_BE64 (vhp->encodingsBitmap);
740 bcopy(vhp->finderInfo, vcb->vcbFndrInfo, sizeof(vhp->finderInfo));
741 vcb->localCreateDate = SWAP_BE32 (vhp->createDate); /* hfs+ create date is in local time */
746 forkp = VTOF((struct vnode *)vcb->extentsRefNum);
758 forkp = VTOF((struct vnode *)vcb->catalogRefNum);
782 forkp = VTOF((struct vnode *)vcb->allocationsRefNum);
799 forkp = VTOF((struct vnode *)vcb->extentsRefNum);
803 forkp = VTOF((struct vnode *)vcb->catalogRefNum);
816 vcb->volumeNameEncodingHint = cndesc.cd_encoding;
817 bcopy(cndesc.cd_nameptr, vcb->vcbVN, min(255, cndesc.cd_namelen));
1832 ExtendedVCB *vcb = VFSTOVCB(mp);
1837 freeCNIDs = (u_long)0xFFFFFFFF - (u_long)vcb->vcbNxtCNID;
1839 sbp->f_bsize = (u_int32_t)vcb->blockSize;
1841 sbp->f_blocks = (u_int64_t)((unsigned long)vcb->totalBlocks);
1844 sbp->f_files = (u_int64_t)((unsigned long )(vcb->totalBlocks - 2)); /* max files is constrained by total blocks */
1885 ExtendedVCB *vcb;
1890 vcb = HFSTOVCB(hfsmp);
1893 priIDSector = (daddr64_t)((vcb->hfsPlusIOPosOffset / hfsmp->hfs_logical_block_size) +
1976 ExtendedVCB *vcb;
2011 vcb = HFSTOVCB(hfsmp);
2013 meta_vp[0] = vcb->extentsRefNum;
2014 meta_vp[1] = vcb->catalogRefNum;
2015 meta_vp[2] = vcb->allocationsRefNum; /* This is NULL for standard HFS */
2053 if (vcb->vcbSigWord == kHFSSigWord) {
2067 if (IsVCBDirty(vcb)) {
2293 ExtendedVCB *vcb;
2320 vcb = HFSTOVCB(hfsmp);
2322 if (BTHasContiguousNodes(VTOF(vcb->catalogRefNum)) == 0 ||
2323 BTHasContiguousNodes(VTOF(vcb->extentsRefNum)) == 0) {
2332 if ( GetFileInfo(vcb, kHFSRootFolderID, ".journal_info_block", &jinfo_attr, &jinfo_fork) == 0
2333 || GetFileInfo(vcb, kHFSRootFolderID, ".journal", &jnl_attr, &jnl_fork) == 0) {
2898 ExtendedVCB *vcb = HFSTOVCB(hfsmp);
2918 mdb->drCrDate = SWAP_BE32 (UTCToLocal(to_hfs_time(vcb->vcbCrDate)));
2919 mdb->drLsMod = SWAP_BE32 (UTCToLocal(to_hfs_time(vcb->vcbLsMod)));
2920 mdb->drAtrb = SWAP_BE16 (vcb->vcbAtrb);
2921 mdb->drNmFls = SWAP_BE16 (vcb->vcbNmFls);
2922 mdb->drAllocPtr = SWAP_BE16 (vcb->nextAllocation);
2923 mdb->drClpSiz = SWAP_BE32 (vcb->vcbClpSiz);
2924 mdb->drNxtCNID = SWAP_BE32 (vcb->vcbNxtCNID);
2925 mdb->drFreeBks = SWAP_BE16 (vcb->freeBlocks);
2927 namelen = strlen((char *)vcb->vcbVN);
2928 retval = utf8_to_hfs(vcb, namelen, vcb->vcbVN, mdb->drVN);
2931 retval = utf8_to_mac_roman(namelen, vcb->vcbVN, mdb->drVN);
2933 mdb->drVolBkUp = SWAP_BE32 (UTCToLocal(to_hfs_time(vcb->vcbVolBkUp)));
2934 mdb->drWrCnt = SWAP_BE32 (vcb->vcbWrCnt);
2935 mdb->drNmRtDirs = SWAP_BE16 (vcb->vcbNmRtDirs);
2936 mdb->drFilCnt = SWAP_BE32 (vcb->vcbFilCnt);
2937 mdb->drDirCnt = SWAP_BE32 (vcb->vcbDirCnt);
2939 bcopy(vcb->vcbFndrInfo, mdb->drFndrInfo, sizeof(mdb->drFndrInfo));
2941 fp = VTOF(vcb->extentsRefNum);
2948 mdb->drXTFlSize = SWAP_BE32 (fp->ff_blocks * vcb->blockSize);
2952 fp = VTOF(vcb->catalogRefNum);
2959 mdb->drCTFlSize = SWAP_BE32 (fp->ff_blocks * vcb->blockSize);
2963 MarkVCBClean( vcb );
2999 ExtendedVCB *vcb = HFSTOVCB(hfsmp);
3017 priIDSector = (daddr64_t)((vcb->hfsPlusIOPosOffset / hfsmp->hfs_logical_block_size) +
3033 printf("HFS: err %d reading VH blk (%s)\n", retval, vcb->vcbVN);
3051 (SWAP_BE32 (volumeHeader->blockSize) != vcb->blockSize)) {
3054 vcb->vcbVN, signature, hfsversion,
3057 printf("HFS: corrupt VH blk (%s)\n", vcb->vcbVN);
3066 if ((vcb->hfsPlusIOPosOffset != 0) &&
3067 (SWAP_BE32 (volumeHeader->createDate) != vcb->localCreateDate)) {
3082 if ( SWAP_BE32 (mdb->drCrDate) != vcb->localCreateDate )
3088 mdb->drCrDate = SWAP_BE32 (vcb->localCreateDate); /* pick up the new create date */
3106 volumeHeader->attributes = SWAP_BE32 (vcb->vcbAtrb);
3107 volumeHeader->journalInfoBlock = SWAP_BE32 (vcb->vcbJinfoBlock);
3113 volumeHeader->createDate = SWAP_BE32 (vcb->localCreateDate); /* volume create date is in local time */
3114 volumeHeader->modifyDate = SWAP_BE32 (to_hfs_time(vcb->vcbLsMod));
3115 volumeHeader->backupDate = SWAP_BE32 (to_hfs_time(vcb->vcbVolBkUp));
3116 volumeHeader->fileCount = SWAP_BE32 (vcb->vcbFilCnt);
3117 volumeHeader->folderCount = SWAP_BE32 (vcb->vcbDirCnt);
3118 volumeHeader->totalBlocks = SWAP_BE32 (vcb->totalBlocks);
3119 volumeHeader->freeBlocks = SWAP_BE32 (vcb->freeBlocks);
3120 volumeHeader->nextAllocation = SWAP_BE32 (vcb->nextAllocation);
3121 volumeHeader->rsrcClumpSize = SWAP_BE32 (vcb->vcbClpSiz);
3122 volumeHeader->dataClumpSize = SWAP_BE32 (vcb->vcbClpSiz);
3123 volumeHeader->nextCatalogID = SWAP_BE32 (vcb->vcbNxtCNID);
3124 volumeHeader->writeCount = SWAP_BE32 (vcb->vcbWrCnt);
3125 volumeHeader->encodingsBitmap = SWAP_BE64 (vcb->encodingsBitmap);
3127 if (bcmp(vcb->vcbFndrInfo, volumeHeader->finderInfo, sizeof(volumeHeader->finderInfo)) != 0) {
3128 bcopy(vcb->vcbFndrInfo, volumeHeader->finderInfo, sizeof(volumeHeader->finderInfo));
3140 fp = VTOF(vcb->extentsRefNum);
3155 fp = VTOF(vcb->catalogRefNum);
3170 fp = VTOF(vcb->allocationsRefNum);
3277 ExtendedVCB *vcb;
3294 vcb = HFSTOVCB(hfsmp);
3301 if ((vcb->vcbSigWord == kHFSSigWord) ||
3303 (vcb->hfsPlusIOPosOffset != 0)) {
3358 newblkcnt = newsize / vcb->blockSize;
3362 addblks = newblkcnt - vcb->totalBlocks;
3364 printf("hfs_extendfs: growing %s by %d blocks\n", vcb->vcbVN, addblks);
3377 vp = vcb->allocationsRefNum;
3385 bitmapblks = roundup((newblkcnt+7) / 8, vcb->vcbVBMIOSize) / vcb->blockSize;
3409 error = ExtendFileC(vcb, fp, bitmapblks * vcb->blockSize, 0,
3423 error = AddFileExtent(vcb, fp, vcb->totalBlocks, bitmapblks);
3438 fp->ff_size += (u_int64_t)bitmapblks * (u_int64_t)vcb->blockSize;
3448 error = (int)buf_meta_bread(vp, blkno, vcb->blockSize, NOCRED, &bp);
3455 bzero((char *)buf_dataptr(bp), vcb->blockSize);
3478 error = BlockMarkAllocated(vcb, vcb->totalBlocks, bitmapblks);
3483 vcb->freeBlocks -= bitmapblks;
3489 if (vcb->blockSize == 512)
3490 error = BlockMarkAllocated(vcb, vcb->totalBlocks + addblks - 2, 2);
3492 error = BlockMarkAllocated(vcb, vcb->totalBlocks + addblks - 1, 1);
3500 if (vcb->blockSize == 512)
3501 (void) BlockMarkFree(vcb, vcb->totalBlocks - 2, 2);
3503 (void) BlockMarkFree(vcb, vcb->totalBlocks - 1, 1);
3510 vcb->totalBlocks += addblks;
3511 vcb->freeBlocks += addblks;
3515 MarkVCBDirty(vcb);
3523 (void) TruncateFileC(vcb, fp, oldBitmapSize, false);
3526 fp->ff_size -= (u_int64_t)bitmapblks * (u_int64_t)vcb->blockSize;
3530 * effect of the "vcb->freeBlocks -= bitmapblks" above.
3532 vcb->freeBlocks += bitmapblks;
3534 vcb->totalBlocks -= addblks;
3535 vcb->freeBlocks -= addblks;
3538 MarkVCBDirty(vcb);
3539 if (vcb->blockSize == 512)
3540 (void) BlockMarkAllocated(vcb, vcb->totalBlocks - 2, 2);
3542 (void) BlockMarkAllocated(vcb, vcb->totalBlocks - 1, 1);
3599 hfsmp->allocLimit = vcb->totalBlocks;
4848 ExtendedVCB *vcb = VFSTOVCB(mp);
4862 VFSATTR_RETURN(fsap, f_bsize, (u_int32_t)vcb->blockSize);
4873 VFSATTR_RETURN(fsap, f_signature, vcb->vcbSigWord);
5024 ExtendedVCB *vcb = VTOVCB(vp);
5066 strlcpy((char *)vcb->vcbVN, name, sizeof(vcb->vcbVN));
5073 MarkVCBDirty(vcb);
5090 vcb->volumeNameEncodingHint = new_desc.cd_encoding;