Lines Matching defs: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 */
95 #define HFS_LOOKUP_CASESENSITIVE 0x4 /* If set, verify results of a file/directory record match input case */
127 static void promotefork(struct hfsmount *hfsmp, const struct HFSCatalogFile *file, int resource, struct cat_fork * forkp);
178 * The catalog lock must be held (like other functions in this file).
778 /* No corresponding file/folder record found for a thread record,
837 * Compare the mangled version of file name looked up from the
842 * file system.
922 /* Make sure the case of the file was correct if requested */
974 * and linkCount for regular file before we vend it out. This might
976 * file is modified and updated on disk.
996 /* This is a regular file and the link count was more than 1 */
1143 * NOTE: both the catalog file and attribute file locks must
1206 * Now insert the file/directory record
1390 /* The file has mangled name. Search the cnode data using full name */
1547 /* For directory hard links, always create a file thread
1626 * A file must be zero length (no blocks)
1639 * Derive a key from either the file ID (for a virtual inode)
1665 /* The file has mangled name. Delete the file using full name */
1810 HFSCatalogFile *file;
1813 file = (struct HFSCatalogFile *)crp;
1816 (file->fileID != attrp->ca_fileid))
1818 file->createDate = UTCToLocal(to_hfs_time(attrp->ca_itime));
1819 file->modifyDate = UTCToLocal(to_hfs_time(attrp->ca_mtime));
1820 file->backupDate = UTCToLocal(to_hfs_time(attrp->ca_btime));
1821 bcopy(&attrp->ca_finderinfo[0], &file->userInfo, 16);
1822 bcopy(&attrp->ca_finderinfo[16], &file->finderInfo, 16);
1825 file->rsrcLogicalSize = forkp->cf_size;
1826 file->rsrcPhysicalSize = forkp->cf_blocks * blksize;
1828 file->rsrcExtents[i].startBlock =
1830 file->rsrcExtents[i].blockCount =
1836 file->dataLogicalSize = forkp->cf_size;
1837 file->dataPhysicalSize = forkp->cf_blocks * blksize;
1839 file->dataExtents[i].startBlock =
1841 file->dataExtents[i].blockCount =
1848 file->flags |= kHFSFileLockedMask;
1850 file->flags &= ~kHFSFileLockedMask;
1896 * same effect as creating a new file while
1921 HFSPlusCatalogFile *file;
1924 file = (struct HFSPlusCatalogFile *)crp;
1926 if (file->fileID != attrp->ca_fileid)
1928 file->flags = attrp->ca_recflags;
1929 file->createDate = to_hfs_time(attrp->ca_itime);
1930 file->contentModDate = to_hfs_time(attrp->ca_mtime);
1931 file->backupDate = to_hfs_time(attrp->ca_btime);
1932 file->accessDate = to_hfs_time(attrp->ca_atime);
1934 file->attributeModDate = to_hfs_time(attrp->ca_ctime);
1936 * Note: file hardlink inodes don't require a text encoding
1940 file->hl_firstLinkID = attrp->ca_firstlink;
1942 file->textEncoding = descp->cd_encoding;
1944 bcopy(&attrp->ca_finderinfo[0], &file->userInfo, 32);
1963 * same effect as creating a new file while
1970 is_dirlink = (file->flags & kHFSHasLinkChainMask) &&
1971 (SWAP_BE32(file->userInfo.fdType) == kHFSAliasType) &&
1972 (SWAP_BE32(file->userInfo.fdCreator) == kHFSAliasCreator);
1975 ((file->bsdInfo.fileMode != 0) ||
1981 if ((file->bsdInfo.fileMode == 0) ||
1983 file->bsdInfo.ownerID = attrp->ca_uid;
1984 file->bsdInfo.groupID = attrp->ca_gid;
1986 file->bsdInfo.ownerFlags = attrp->ca_flags & 0x000000FF;
1987 file->bsdInfo.adminFlags = attrp->ca_flags >> 16;
1988 file->bsdInfo.fileMode = attrp->ca_mode;
1992 file->resourceFork.logicalSize = forkp->cf_size;
1993 file->resourceFork.totalBlocks = forkp->cf_blocks;
1994 bcopy(&forkp->cf_extents[0], &file->resourceFork.extents,
1997 file->resourceFork.clumpSize =
2002 file->dataFork.logicalSize = forkp->cf_size;
2003 file->dataFork.totalBlocks = forkp->cf_blocks;
2004 bcopy(&forkp->cf_extents[0], &file->dataFork.extents,
2007 file->dataFork.clumpSize =
2011 if ((file->resourceFork.extents[0].startBlock != 0) &&
2012 (file->resourceFork.extents[0].startBlock ==
2013 file->dataFork.extents[0].startBlock)) {
2019 file->flags |= kHFSFileLockedMask;
2021 file->flags &= ~kHFSFileLockedMask;
2025 file->bsdInfo.special.rawDevice = attrp->ca_rdev;
2035 (file->hl_linkCount > 1)) {
2036 file->hl_linkCount = attrp->ca_linkcount;
2178 HFSPlusCatalogFile *file;
2185 file = (struct HFSPlusCatalogFile *)crp;
2186 if (file->flags & kHFSHasLinkChainMask) {
2188 file->hl_prevLinkID = state->prevlinkid;
2191 file->hl_nextLinkID = state->nextlinkid;
2194 printf("hfs: update_siblinglinks_callback: file %d isn't a chain\n", file->fileID);
2240 struct HFSPlusCatalogFile file;
2252 BDINIT(btdata, &file);
2257 if (file.recordType != kHFSPlusFileRecord) {
2261 *linkfileid = file.fileID;
2263 if (file.flags & kHFSHasLinkChainMask) {
2264 *prevlinkid = file.hl_prevLinkID;
2265 *nextlinkid = file.hl_nextLinkID;
2285 struct HFSPlusCatalogFile file;
2297 BDINIT(btdata, &file);
2303 if (file.flags & kHFSHasLinkChainMask) {
2313 *nextlinkid = file.hl_firstLinkID;
2315 *prevlinkid = file.hl_prevLinkID;
2316 *nextlinkid = file.hl_nextLinkID;
2338 struct HFSPlusCatalogFile file;
2356 BDINIT(btdata, &file);
2363 if (file.flags & kHFSHasLinkChainMask) {
2377 /* Raw inode for file hardlink (the base inode) */
2378 currentlink = file.hl_firstLinkID;
2383 * not have any siblings, then it's an open-unlinked file, and we
2393 if (file.hl_nextLinkID == 0) {
2406 currentlink = file.hl_nextLinkID;
2721 /* If the file system is on a virtual device like disk image,
2765 struct HFSPlusCatalogFile file;
2771 bzero(&file, sizeof (file));
2790 BDINIT(btdata, &file);
2801 (file.recordType == kHFSPlusFileRecord)) {
2803 totalBlocks = file.resourceFork.totalBlocks;
2806 if ((file.resourceFork.extents[i].blockCount == 0) &&
2807 (file.resourceFork.extents[i].startBlock == 0)) {
2812 file.resourceFork.extents[i].startBlock,
2813 file.resourceFork.extents[i].blockCount, 0);
2815 totalBlocks -= file.resourceFork.extents[i].blockCount;
2816 file.resourceFork.extents[i].startBlock = 0;
2817 file.resourceFork.extents[i].blockCount = 0;
3114 * uses the next file id as the seek offset of each entry.
3242 /* If link ref is inode's file id then use it directly. */
3257 /* A directory's link ref is always inode's file id. */
3310 * is going to be counted as a file record, so we can catch both
3341 catent.d_fileno = 0; /* file number = 0 means skip entry */
3748 * Post process any hard links to get the real file id.
4075 * cat_getdirentries, we can assume that only file
4150 * getkeyplusattr - From id, fetch the key and the bsd attrs for a file/dir (could pass
4168 * Check for a raw file hardlink inode.
4196 * buildrecord - build a default catalog directory or file record
4387 * track of whether or not the file or folder is hfs locked
4419 /* The file's supposed to be locked:
4424 /* The file's supposed to be unlocked: */
4539 } else /* file */ {
4540 const struct HFSCatalogFile * file;
4542 file = (const struct HFSCatalogFile *) dataPtr;
4544 crp->flags = file->flags;
4545 crp->fileID = file->fileID;
4546 crp->createDate = LocalToUTC(file->createDate);
4547 crp->contentModDate = LocalToUTC(file->modifyDate);
4548 crp->backupDate = LocalToUTC(file->backupDate);
4551 bcopy(&file->userInfo, &crp->userInfo, 16);
4552 bcopy(&file->finderInfo, &crp->finderInfo, 16);
4553 crp->dataFork.totalBlocks = file->dataPhysicalSize / blocksize;
4554 crp->resourceFork.totalBlocks = file->rsrcPhysicalSize / blocksize;
4776 /* Directory hard links are catalog file record */
4793 printf ("hfs: cat_lookup_dirlink(): Error looking up file record for id=%u (error=%d)\n", dirlink_id, error);