Lines Matching defs:cnid

108 static int getkey(struct hfsmount *hfsmp, cnid_t cnid, CatalogKey * key);
115 static void buildrecord(struct cat_attr *attrp, cnid_t cnid, int std_hfs, u_int32_t encoding, CatalogRecord *crp, u_int32_t *recordSize);
119 static int builddesc(const HFSPlusCatalogKey *key, cnid_t cnid, u_int32_t hint, u_int32_t encoding,
403 * cat_findname - obtain a descriptor from cnid
412 cat_findname(struct hfsmount *hfsmp, cnid_t cnid, struct cat_desc *outdescp)
426 buildthreadkey(cnid, std_hfs, (CatalogKey *)&iterator->key);
464 builddesc(pluskey, cnid, 0, encoding, isdir, outdescp);
468 builddesc((HFSPlusCatalogKey *)keyp, cnid, 0, 0, isdir, outdescp);
484 cat_idlookup(struct hfsmount *hfsmp, cnid_t cnid, int allow_system_files, int wantrsrc,
499 buildthreadkey(cnid, std_hfs, (CatalogKey *)&iterator->key);
555 if (cnid != dcnid) {
556 printf("hfs: cat_idlookup: Requested cnid (%d / %08x) != dcnid (%d / %08x)\n", cnid, cnid, dcnid, dcnid);
647 cnid_t cnid = 0;
665 /* Save the cnid, parentid, and encoding now in case there's a hard link or inode */
666 cnid = getcnid(recp);
676 ((cnid == hfsmp->hfs_jnlfileid) || (cnid == hfsmp->hfs_jnlinfoblkid)) &&
737 printf ("hfs: set hardlink bit on vol=%s cnid=%u inoid=%u\n", hfsmp->vcbVN, cnid, ilink);
749 printf ("hfs: clear hardlink bit on vol=%s cnid=%u\n", hfsmp->vcbVN, cnid);
754 printf ("hfs: set linkcount=1 on vol=%s cnid=%u old=%u\n", hfsmp->vcbVN, cnid, attrp->ca_linkcount);
859 builddesc(pluskey, cnid, hint, encoding, isadir(recp), descp);
866 *desc_cnid = cnid;
950 // that cnid has orphaned attributes so just skip it.
1125 cnid_t cnid = from_cdp->cd_cnid;
1129 if (cnid == fsRtDirID ||
1130 cnid == to_cdp->cd_parentcnid ||
1131 cnid == pathcnid) {
1155 if (pathcnid == cnid || pathcnid == 0) {
1386 cnid_t cnid;
1415 cnid = attrp->ca_fileid;
1418 cnid = descp->cd_cnid;
1439 cnid = temp_desc.cd_cnid;
1455 buildthreadkey(cnid, std_hfs, (CatalogKey *)&iterator->key);
1499 * For open-deleted files we need to do a lookup by cnid
1817 * catalog btree of given cnid by walking up the parent chain till it reaches
1825 cat_set_childlinkbit(struct hfsmount *hfsmp, cnid_t cnid)
1832 while ((cnid != kHFSRootFolderID) && (cnid != kHFSRootParentID) &&
1833 (cnid != hfsmp->hfs_private_desc[DIR_HARDLINKS].cd_cnid)) {
1837 retval = hfs_chash_set_childlinkbit(hfsmp, cnid);
1853 retval = cat_idlookup(hfsmp, cnid, 0, 0, &desc, &attr, NULL);
1873 cnid = desc.cd_parentcnid;
1890 cat_check_link_ancestry(struct hfsmount *hfsmp, cnid_t cnid, cnid_t pointed_at_cnid)
1906 while (cnid != kHFSRootParentID) {
1908 if (pointed_at_cnid == cnid) {
1912 if ((result = getkey(hfsmp, cnid, (CatalogKey *)keyp))) {
1913 printf("hfs: cat_check_link_ancestry: getkey for %u failed\n", cnid);
1918 printf("hfs: cat_check_link_ancestry: cannot find %u\n", cnid);
1927 cnid = keyp->parentID;
1993 printf("hfs: cat_update_siblinglinks: couldn't resolve cnid %d\n", linkfileid);
2046 * cat_lookup_siblinglinks - lookup previous and next link ID for link using its cnid
2793 cnid_t cnid;
2871 cnid = INT_MAX;
2876 cnid = crp->hfsPlusFolder.folderID;
2879 if (cnid == hfsmp->hfs_private_desc[FILE_HARDLINKS].cd_cnid ||
2880 cnid == hfsmp->hfs_private_desc[DIR_HARDLINKS].cd_cnid) {
2888 cnid = crp->hfsPlusFile.fileID;
2898 cnid = crp->hfsPlusFile.hl_linkReference;
2912 cnid = crp->hfsPlusFile.hl_linkReference;
2918 ((cnid == hfsmp->hfs_jnlfileid) ||
2919 (cnid == hfsmp->hfs_jnlinfoblkid))) {
2967 cnid_t linkid = cnid;
2983 * Also stuff the cnid in the upper 32 bits of the cookie.
2987 state->cbs_prevdirentry->d_seekoff = (state->cbs_index + 3) | ((u_int64_t)cnid << 32);
2997 catent.d_fileno = cnid;
3017 state->cbs_desc->cd_cnid = cnid;
3087 entry->d_fileno = cnid;
3115 cnid_t cnid;
3139 cnid = crp->hfsFolder.folderID;
3143 cnid = crp->hfsFile.fileID;
3161 catent.d_fileno = cnid;
3174 state->cbs_desc->cd_cnid = cnid;
3748 getkey(struct hfsmount *hfsmp, cnid_t cnid, CatalogKey * key)
3762 buildthreadkey(cnid, std_hfs, (CatalogKey *)&iterator->key);
3810 cat_getkeyplusattr(struct hfsmount *hfsmp, cnid_t cnid, CatalogKey * key, struct cat_attr *attrp)
3814 result = getkey(hfsmp, cnid, key);
3835 if ((cat_lookup_siblinglinks(hfsmp, cnid, &prevlinkid, &nextlinkid) == 0) &&
3851 buildrecord(struct cat_attr *attrp, cnid_t cnid, int std_hfs, u_int32_t encoding,
3862 crp->hfsFolder.folderID = cnid;
3870 crp->hfsFile.fileID = cnid;
3884 crp->hfsPlusFolder.folderID = cnid;
3900 crp->hfsPlusFile.fileID = cnid;
3932 builddesc(const HFSPlusCatalogKey *key, cnid_t cnid, u_int32_t hint, u_int32_t encoding,
3969 descp->cd_cnid = cnid;
4295 cnid_t cnid = 0;
4299 cnid = crp->hfsFolder.folderID;
4302 cnid = crp->hfsFile.fileID;
4305 cnid = crp->hfsPlusFolder.folderID;
4308 cnid = crp->hfsPlusFile.fileID;
4315 return (cnid);
4324 cnid_t cnid = 0;
4329 cnid = recp->hfsThread.parentID;
4334 cnid = recp->hfsPlusThread.parentID;
4341 return (cnid);
4422 printf ("hfs: cat_lookup_dirlink(): Requested cnid=%u != found_cnid=%u\n", dirlink_id, outdescp->cd_cnid);