• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.5.8/xnu-1228.15.4/bsd/hfs/

Lines Matching refs:file

6  * This file contains Original Code and/or Modifications of Original Code
8 * Version 2.0 (the 'License'). You may not use this file except in
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
83 /* Map file mode type to directory entry types */
123 static void promotefork(struct hfsmount *hfsmp, const struct HFSCatalogFile *file, int resource, struct cat_fork * forkp);
533 /* No corresponding file/folder record found for a thread record,
785 * NOTE: both the catalog file and attribute file locks must
854 // this call requires the attribute file lock to be held
894 * Now insert the file/directory record
1064 /* The file has mangled name. Search the cnode data using full name */
1208 /* For directory hard links, always create a file thread
1282 * A file must be zero length (no blocks)
1295 * Derive a key from either the file ID (for a virtual inode)
1321 /* The file has mangled name. Delete the file using full name */
1454 HFSCatalogFile *file;
1456 file = (struct HFSCatalogFile *)crp;
1459 (file->fileID != attrp->ca_fileid))
1461 file->createDate = UTCToLocal(to_hfs_time(attrp->ca_itime));
1462 file->modifyDate = UTCToLocal(to_hfs_time(attrp->ca_mtime));
1463 file->backupDate = UTCToLocal(to_hfs_time(attrp->ca_btime));
1464 bcopy(&attrp->ca_finderinfo[0], &file->userInfo, 16);
1465 bcopy(&attrp->ca_finderinfo[16], &file->finderInfo, 16);
1468 file->rsrcLogicalSize = forkp->cf_size;
1469 file->rsrcPhysicalSize = forkp->cf_blocks * blksize;
1471 file->rsrcExtents[i].startBlock =
1473 file->rsrcExtents[i].blockCount =
1479 file->dataLogicalSize = forkp->cf_size;
1480 file->dataPhysicalSize = forkp->cf_blocks * blksize;
1482 file->dataExtents[i].startBlock =
1484 file->dataExtents[i].blockCount =
1491 file->flags |= kHFSFileLockedMask;
1493 file->flags &= ~kHFSFileLockedMask;
1537 * same effect as creating a new file while
1562 HFSPlusCatalogFile *file;
1564 file = (struct HFSPlusCatalogFile *)crp;
1566 if (file->fileID != attrp->ca_fileid)
1568 file->flags = attrp->ca_recflags;
1569 file->createDate = to_hfs_time(attrp->ca_itime);
1570 file->contentModDate = to_hfs_time(attrp->ca_mtime);
1571 file->backupDate = to_hfs_time(attrp->ca_btime);
1572 file->accessDate = to_hfs_time(attrp->ca_atime);
1574 file->attributeModDate = to_hfs_time(attrp->ca_ctime);
1576 * Note: file hardlink inodes don't require a text encoding
1580 file->hl_firstLinkID = attrp->ca_firstlink;
1582 file->textEncoding = descp->cd_encoding;
1584 bcopy(&attrp->ca_finderinfo[0], &file->userInfo, 32);
1603 * same effect as creating a new file while
1606 if ((file->bsdInfo.fileMode != 0) ||
1612 if ((file->bsdInfo.fileMode == 0) ||
1614 file->bsdInfo.ownerID = attrp->ca_uid;
1615 file->bsdInfo.groupID = attrp->ca_gid;
1617 file->bsdInfo.ownerFlags = attrp->ca_flags & 0x000000FF;
1618 file->bsdInfo.adminFlags = attrp->ca_flags >> 16;
1619 file->bsdInfo.fileMode = attrp->ca_mode;
1623 file->resourceFork.logicalSize = forkp->cf_size;
1624 file->resourceFork.totalBlocks = forkp->cf_blocks;
1625 bcopy(&forkp->cf_extents[0], &file->resourceFork.extents,
1628 file->resourceFork.clumpSize =
1633 file->dataFork.logicalSize = forkp->cf_size;
1634 file->dataFork.totalBlocks = forkp->cf_blocks;
1635 bcopy(&forkp->cf_extents[0], &file->dataFork.extents,
1638 file->dataFork.clumpSize =
1642 if ((file->resourceFork.extents[0].startBlock != 0) &&
1643 (file->resourceFork.extents[0].startBlock ==
1644 file->dataFork.extents[0].startBlock)) {
1650 file->flags |= kHFSFileLockedMask;
1652 file->flags &= ~kHFSFileLockedMask;
1656 file->bsdInfo.special.rawDevice = attrp->ca_rdev;
1658 file->hl_linkCount = attrp->ca_linkcount;
1799 HFSPlusCatalogFile *file;
1806 file = (struct HFSPlusCatalogFile *)crp;
1807 if (file->flags & kHFSHasLinkChainMask) {
1809 file->hl_prevLinkID = state->prevlinkid;
1812 file->hl_nextLinkID = state->nextlinkid;
1815 printf("updatelink_callback: file %d isn't a chain\n", file->fileID);
1861 struct HFSPlusCatalogFile file;
1873 BDINIT(btdata, &file);
1878 if (file.recordType != kHFSPlusFileRecord) {
1882 *linkfileid = file.fileID;
1884 if (file.flags & kHFSHasLinkChainMask) {
1885 *prevlinkid = file.hl_prevLinkID;
1886 *nextlinkid = file.hl_nextLinkID;
1906 struct HFSPlusCatalogFile file;
1919 BDINIT(btdata, &file);
1926 if (file.flags & kHFSHasLinkChainMask) {
1936 *nextlinkid = file.hl_firstLinkID;
1938 *prevlinkid = file.hl_prevLinkID;
1939 *nextlinkid = file.hl_nextLinkID;
2214 /* If the file system is on a virtual device like disk image,
2259 struct HFSPlusCatalogFile file;
2265 bzero(&file, sizeof (file));
2284 BDINIT(btdata, &file);
2295 (file.recordType == kHFSPlusFileRecord)) {
2297 totalBlocks = file.resourceFork.totalBlocks;
2300 if ((file.resourceFork.extents[i].blockCount == 0) &&
2301 (file.resourceFork.extents[i].startBlock == 0)) {
2306 file.resourceFork.extents[i].startBlock,
2307 file.resourceFork.extents[i].blockCount);
2309 totalBlocks -= file.resourceFork.extents[i].blockCount;
2310 file.resourceFork.extents[i].startBlock = 0;
2311 file.resourceFork.extents[i].blockCount = 0;
2604 * uses the next file id as the seek offset of each entry.
2698 /* If link ref is inode's file id then use it directly. */
2712 /* A directory's link ref is always inode's file id. */
2782 catent.d_fileno = 0; /* file number = 0 means skip entry */
3168 * Post process any hard links to get the real file id.
3501 * cat_getdirentries, we can assume that only file
3573 * getkeyplusattr - From id, fetch the key and the bsd attrs for a file/dir (could pass
3592 * Check for a raw file hardlink inode.
3620 * buildrecord - build a default catalog directory or file record
3807 * track of whether or not the file or folder is hfs locked
3839 /* The file's supposed to be locked:
3844 /* The file's supposed to be unlocked: */
3958 } else /* file */ {
3959 const struct HFSCatalogFile * file;
3961 file = (const struct HFSCatalogFile *) dataPtr;
3963 crp->flags = file->flags;
3964 crp->fileID = file->fileID;
3965 crp->createDate = LocalToUTC(file->createDate);
3966 crp->contentModDate = LocalToUTC(file->modifyDate);
3967 crp->backupDate = LocalToUTC(file->backupDate);
3970 bcopy(&file->userInfo, &crp->userInfo, 16);
3971 bcopy(&file->finderInfo, &crp->finderInfo, 16);
3972 crp->dataFork.totalBlocks = file->dataPhysicalSize / blocksize;
3973 crp->resourceFork.totalBlocks = file->rsrcPhysicalSize / blocksize;