Lines Matching refs:attrp

96                   struct cat_desc *descp, struct cat_attr *attrp, struct cat_fork *forkp, cnid_t *desc_cnid);
99 struct cat_desc *outdescp, struct cat_attr *attrp, struct cat_fork *forkp);
115 static void buildrecord(struct cat_attr *attrp, cnid_t cnid, int std_hfs, u_int32_t encoding, CatalogRecord *crp, u_int32_t *recordSize);
122 static void getbsdattr(struct hfsmount *hfsmp, const struct HFSPlusCatalogFile *crp, struct cat_attr * attrp);
138 static int cat_update_internal(struct hfsmount *hfsmp, int update_hardlink, struct cat_desc *descp, struct cat_attr *attrp,
177 struct cat_attr *attrp,
187 getbsdattr(hfsmp, &cnoderec, attrp);
189 getbsdattr(hfsmp, (struct HFSPlusCatalogFile *)recp, attrp);
203 (attrp->ca_atime >= hfsmp->hfc_timebase)) {
219 (attrp->ca_atime >= hfsmp->hfc_timebase)) {
303 struct cat_desc *outdescp, struct cat_attr *attrp,
318 result = cat_lookupbykey(hfsmp, keyp, 0, descp->cd_hint, wantrsrc, outdescp, attrp, forkp, desc_cnid);
327 result = cat_lookupmangled(hfsmp, descp, wantrsrc, outdescp, attrp, forkp);
337 // result = cat_lookupbykey(hfsmp, keyp, descp->cd_hint, attrp, forkp);
485 struct cat_desc *outdescp, struct cat_attr *attrp, struct cat_fork *forkp)
545 0, wantrsrc, outdescp, attrp, forkp, NULL);
573 struct cat_desc *outdescp, struct cat_attr *attrp, struct cat_fork *forkp)
597 result = cat_idlookup(hfsmp, fileID, 0,0, outdescp, attrp, forkp);
638 struct cat_desc *descp, struct cat_attr *attrp, struct cat_fork *forkp, cnid_t *desc_cnid)
688 && (attrp || forkp)
709 if (attrp != NULL) {
714 getbsdattr(hfsmp, &cnoderec, attrp);
716 getbsdattr(hfsmp, (struct HFSPlusCatalogFile *)recp, attrp);
719 attrp->ca_linkref = ilink;
736 if (!(attrp->ca_recflags & kHFSHasLinkChainMask)) {
738 attrp->ca_recflags |= kHFSHasLinkChainMask;
748 if (attrp->ca_recflags & kHFSHasLinkChainMask) {
750 attrp->ca_recflags &= ~kHFSHasLinkChainMask;
753 if (S_ISREG(attrp->ca_mode) && (attrp->ca_linkcount > 1)) {
754 printf ("hfs: set linkcount=1 on vol=%s cnid=%u old=%u\n", hfsmp->vcbVN, cnid, attrp->ca_linkcount);
755 attrp->ca_linkcount = 1;
810 if (attrp != NULL) {
811 attrp->ca_mode &= S_IFMT | S_IRUSR | S_IRGRP | S_IROTH;
838 if (attrp != NULL) {
839 attrp->ca_blocks = validblks + recp->hfsPlusFile.resourceFork.totalBlocks;
886 cat_create(struct hfsmount *hfsmp, struct cat_desc *descp, struct cat_attr *attrp,
899 modeformat = attrp->ca_mode & S_IFMT;
941 S_ISDIR(attrp->ca_mode));
1004 buildrecord(attrp, nextCNID, std_hfs, encoding, &bto->data, &datalen);
1017 if (!std_hfs || S_ISDIR(attrp->ca_mode)) {
1044 encoding, S_ISDIR(attrp->ca_mode), out_descp);
1049 attrp->ca_fileid = nextCNID;
1382 cat_delete(struct hfsmount *hfsmp, struct cat_desc *descp, struct cat_attr *attrp)
1414 result = getkey(hfsmp, attrp->ca_fileid, (CatalogKey *)&iterator->key);
1415 cnid = attrp->ca_fileid;
1432 result = cat_lookupmangled(hfsmp, descp, 0, &temp_desc, attrp, NULL);
1472 * using the data from attrp and forkp.
1477 cat_update_internal(struct hfsmount *hfsmp, int update_hardlink, struct cat_desc *descp, struct cat_attr *attrp,
1490 state.s_attr = attrp;
1507 ((descp->cd_cnid != attrp->ca_fileid) ||
1509 (attrp->ca_recflags & kHFSHasLinkChainMask))) {
1510 result = getkey(hfsmp, attrp->ca_fileid, (CatalogKey *)&iterator->key);
1536 * using the data from attrp and forkp.
1539 cat_update(struct hfsmount *hfsmp, struct cat_desc *descp, struct cat_attr *attrp,
1542 return cat_update_internal(hfsmp, false, descp, attrp, dataforkp, rsrcforkp);
1553 struct cat_attr *attrp;
1560 attrp = state->s_attr;
1573 dir->valence = attrp->ca_entries;
1574 dir->createDate = UTCToLocal(to_hfs_time(attrp->ca_itime));
1575 dir->modifyDate = UTCToLocal(to_hfs_time(attrp->ca_mtime));
1576 dir->backupDate = UTCToLocal(to_hfs_time(attrp->ca_btime));
1577 bcopy(&attrp->ca_finderinfo[0], &dir->userInfo, 16);
1578 bcopy(&attrp->ca_finderinfo[16], &dir->finderInfo, 16);
1587 (file->fileID != attrp->ca_fileid))
1589 file->createDate = UTCToLocal(to_hfs_time(attrp->ca_itime));
1590 file->modifyDate = UTCToLocal(to_hfs_time(attrp->ca_mtime));
1591 file->backupDate = UTCToLocal(to_hfs_time(attrp->ca_btime));
1592 bcopy(&attrp->ca_finderinfo[0], &file->userInfo, 16);
1593 bcopy(&attrp->ca_finderinfo[16], &file->finderInfo, 16);
1618 if (attrp->ca_flags & (SF_IMMUTABLE | UF_IMMUTABLE))
1629 if (dir->folderID != attrp->ca_fileid) {
1630 printf("hfs: catrec_update: id %d != %d\n", dir->folderID, attrp->ca_fileid);
1633 dir->flags = attrp->ca_recflags;
1634 dir->valence = attrp->ca_entries;
1635 dir->createDate = to_hfs_time(attrp->ca_itime);
1636 dir->contentModDate = to_hfs_time(attrp->ca_mtime);
1637 dir->backupDate = to_hfs_time(attrp->ca_btime);
1638 dir->accessDate = to_hfs_time(attrp->ca_atime);
1639 attrp->ca_atimeondisk = attrp->ca_atime;
1640 dir->attributeModDate = to_hfs_time(attrp->ca_ctime);
1645 dir->folderCount = attrp->ca_dircount;
1646 bcopy(&attrp->ca_finderinfo[0], &dir->userInfo, 32);
1669 (attrp->ca_flags != 0) ||
1670 (attrp->ca_uid != hfsmp->hfs_uid) ||
1671 (attrp->ca_gid != hfsmp->hfs_gid) ||
1672 ((attrp->ca_mode & ALLPERMS) !=
1676 dir->bsdInfo.ownerID = attrp->ca_uid;
1677 dir->bsdInfo.groupID = attrp->ca_gid;
1679 dir->bsdInfo.ownerFlags = attrp->ca_flags & 0x000000FF;
1680 dir->bsdInfo.adminFlags = attrp->ca_flags >> 16;
1681 dir->bsdInfo.fileMode = attrp->ca_mode;
1683 if (attrp->ca_linkcount > 1 || dir->hl_linkCount > 1) {
1684 dir->hl_linkCount = attrp->ca_linkcount;
1695 if (file->fileID != attrp->ca_fileid)
1697 file->flags = attrp->ca_recflags;
1698 file->createDate = to_hfs_time(attrp->ca_itime);
1699 file->contentModDate = to_hfs_time(attrp->ca_mtime);
1700 file->backupDate = to_hfs_time(attrp->ca_btime);
1701 file->accessDate = to_hfs_time(attrp->ca_atime);
1702 attrp->ca_atimeondisk = attrp->ca_atime;
1703 file->attributeModDate = to_hfs_time(attrp->ca_ctime);
1709 file->hl_firstLinkID = attrp->ca_firstlink;
1713 bcopy(&attrp->ca_finderinfo[0], &file->userInfo, 32);
1745 (attrp->ca_flags != 0) ||
1746 (attrp->ca_uid != hfsmp->hfs_uid) ||
1747 (attrp->ca_gid != hfsmp->hfs_gid) ||
1748 ((attrp->ca_mode & ALLPERMS) !=
1752 file->bsdInfo.ownerID = attrp->ca_uid;
1753 file->bsdInfo.groupID = attrp->ca_gid;
1755 file->bsdInfo.ownerFlags = attrp->ca_flags & 0x000000FF;
1756 file->bsdInfo.adminFlags = attrp->ca_flags >> 16;
1757 file->bsdInfo.fileMode = attrp->ca_mode;
1787 if (attrp->ca_flags & (SF_IMMUTABLE | UF_IMMUTABLE))
1793 if (S_ISBLK(attrp->ca_mode) || S_ISCHR(attrp->ca_mode)) {
1794 file->bsdInfo.special.rawDevice = attrp->ca_rdev;
1803 if ((descp->cd_cnid != attrp->ca_fileid) || (attrp->ca_linkcount > 1 ) ||
1805 file->hl_linkCount = attrp->ca_linkcount;
2109 cat_createlink(struct hfsmount *hfsmp, struct cat_desc *descp, struct cat_attr *attrp,
2213 buildrecord(attrp, nextCNID, 0, encoding, &bto->data, &datalen);
2217 bto->data.hfsPlusFile.hl_linkReference = attrp->ca_linkref;
2221 if ((result = cat_makealias(hfsmp, attrp->ca_linkref, &bto->data.hfsPlusFile))) {
3804 * cat_desc here). Both key and attrp must point to real structures.
3810 cat_getkeyplusattr(struct hfsmount *hfsmp, cnid_t cnid, CatalogKey * key, struct cat_attr *attrp)
3817 result = cat_lookupbykey(hfsmp, key, 0, 0, 0, NULL, attrp, NULL, NULL);
3826 (attrp->ca_recflags & kHFSHasLinkChainMask)) {
3851 buildrecord(struct cat_attr *attrp, cnid_t cnid, int std_hfs, u_int32_t encoding,
3854 int type = attrp->ca_mode & S_IFMT;
3855 u_int32_t createtime = to_hfs_time(attrp->ca_itime);
3865 bcopy(attrp->ca_finderinfo, &crp->hfsFolder.userInfo, 32);
3873 bcopy(attrp->ca_finderinfo, &crp->hfsFile.userInfo, 16);
3874 bcopy(&attrp->ca_finderinfo[16], &crp->hfsFile.finderInfo, 16);
3882 crp->hfsPlusFolder.flags = attrp->ca_recflags;
3892 bcopy(attrp->ca_finderinfo, &crp->hfsPlusFolder.userInfo, 32);
3898 crp->hfsPlusFile.flags = attrp->ca_recflags;
3908 bcopy(attrp->ca_finderinfo, &crp->hfsPlusFile.userInfo, 32);
3912 bsdp->special.rawDevice = attrp->ca_rdev;
3919 bsdp->ownerID = attrp->ca_uid;
3920 bsdp->groupID = attrp->ca_gid;
3921 bsdp->fileMode = attrp->ca_mode;
3922 bsdp->adminFlags = attrp->ca_flags >> 16;
3923 bsdp->ownerFlags = attrp->ca_flags & 0x000000FF;
3987 getbsdattr(struct hfsmount *hfsmp, const struct HFSPlusCatalogFile *crp, struct cat_attr * attrp)
3992 attrp->ca_recflags = crp->flags;
3993 attrp->ca_atime = to_bsd_time(crp->accessDate);
3994 attrp->ca_atimeondisk = attrp->ca_atime;
3995 attrp->ca_mtime = to_bsd_time(crp->contentModDate);
3996 attrp->ca_ctime = to_bsd_time(crp->attributeModDate);
3997 attrp->ca_itime = to_bsd_time(crp->createDate);
3998 attrp->ca_btime = to_bsd_time(crp->backupDate);
4001 attrp->ca_flags = 0;
4002 attrp->ca_uid = hfsmp->hfs_uid;
4003 attrp->ca_gid = hfsmp->hfs_gid;
4005 attrp->ca_mode = S_IFDIR | (hfsmp->hfs_dir_mask & ACCESSPERMS);
4007 attrp->ca_mode = S_IFREG | (hfsmp->hfs_file_mask & ACCESSPERMS);
4009 attrp->ca_linkcount = 1;
4010 attrp->ca_rdev = 0;
4012 attrp->ca_linkcount = 1; /* may be overridden below */
4013 attrp->ca_rdev = 0;
4014 attrp->ca_uid = bsd->ownerID;
4015 attrp->ca_gid = bsd->groupID;
4016 attrp->ca_flags = bsd->ownerFlags | (bsd->adminFlags << 16);
4017 attrp->ca_mode = (mode_t)bsd->fileMode;
4018 switch (attrp->ca_mode & S_IFMT) {
4021 attrp->ca_rdev = bsd->special.rawDevice;
4028 attrp->ca_linkcount = bsd->special.linkCount;
4046 * attrp->ca_uid = hfsmp->hfs_uid;
4047 * attrp->ca_gid = hfsmp->hfs_gid;
4053 if (!S_ISDIR(attrp->ca_mode)) {
4054 attrp->ca_mode &= ~S_IFMT;
4055 attrp->ca_mode |= S_IFDIR;
4057 attrp->ca_entries = ((const HFSPlusCatalogFolder *)crp)->valence;
4058 attrp->ca_dircount = ((hfsmp->hfs_flags & HFS_FOLDERCOUNT) && (attrp->ca_recflags & kHFSHasFolderCountMask)) ?
4063 attrp->ca_flags |= UF_HIDDEN;
4069 if ((attrp->ca_flags & (SF_IMMUTABLE | UF_IMMUTABLE)) == 0)
4070 attrp->ca_flags |= UF_IMMUTABLE;
4073 attrp->ca_flags &= ~(SF_IMMUTABLE | UF_IMMUTABLE);
4077 attrp->ca_flags |= UF_HIDDEN;
4079 attrp->ca_blocks = crp->dataFork.totalBlocks + crp->resourceFork.totalBlocks;
4083 attrp->ca_recflags |= kHFSThreadExistsMask;
4086 attrp->ca_firstlink = (attrp->ca_recflags & kHFSHasLinkChainMask) ? crp->hl_firstLinkID : 0;
4089 attrp->ca_fileid = crp->fileID;
4091 bcopy(&crp->userInfo, attrp->ca_finderinfo, 32);
4366 struct cat_attr *attrp, struct cat_fork *forkp)
4410 error = cat_lookupbykey(hfsmp, keyp, HFS_LOOKUP_HARDLINK, 0, true, outdescp, attrp, forkp, NULL);
4413 error = cat_lookupbykey(hfsmp, keyp, HFS_LOOKUP_HARDLINK, 0, false, outdescp, attrp, forkp, NULL);
4438 * described by descp using the data from attrp and forkp.
4442 struct cat_desc *descp, struct cat_attr *attrp, struct cat_fork *forkp)
4445 return cat_update_internal(hfsmp, true, descp, attrp, NULL, forkp);
4447 return cat_update_internal(hfsmp, true, descp, attrp, forkp, NULL);