• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/xnu-2782.1.97/bsd/hfs/

Lines Matching +defs:record +defs:entry

522 	FSBufferDescriptor  record;
595 record.bufferAddress = &data;
596 record.itemSize = sizeof(u_int32_t);
597 record.itemCount = 1;
664 /* Insert a hot file entry. */
670 error = BTInsertRecord(filefork, iterator, &record, record.itemSize);
677 /* Insert the corresponding thread record. */
683 error = BTInsertRecord(filefork, iterator, &record, record.itemSize);
763 * Note: the cnode is locked on entry.
785 hotfile_entry_t *entry;
839 entry = hf_getnewentry(hotdata);
840 entry->temperature = temperature;
841 entry->fileid = cp->c_fileid;
842 entry->blocks = ffp->ff_blocks;
843 hf_insert(hotdata, entry);
858 * Note: the cnode is locked on entry.
947 * Update the data of a btree record
968 FSBufferDescriptor record;
988 record.bufferAddress = &data;
989 record.itemSize = sizeof(u_int32_t);
990 record.itemCount = 1;
1004 * Check if entry (thread) is already in hot area.
1011 if (BTSearchRecord(filefork, iterator, &record, NULL, iterator) != 0) {
1016 * Update thread entry with latest temperature.
1027 * Re-key entry with latest temperature.
1033 /* Pick up record data. */
1035 (void) BTSearchRecord(filefork, iterator, &record, NULL, iterator);
1046 error = BTInsertRecord(filefork, iterator, &record, record.itemSize);
1054 * Invalidate this entry in the list.
1084 FSBufferDescriptor record;
1123 record.bufferAddress = &data;
1124 record.itemSize = sizeof(u_int32_t);
1125 record.itemCount = 1;
1145 continue; /* stale entry, go to next */
1156 continue; /* stale entry, go to next */
1164 continue; /* stale entry, go to next */
1172 continue; /* entry too big, go to next */
1179 break; /* adopt this entry the next time around */
1198 /* Insert hot file entry */
1211 error = BTInsertRecord(filefork, iterator, &record, record.itemSize);
1219 /* Insert thread record */
1225 error = BTInsertRecord(filefork, iterator, &record, record.itemSize);
1337 * Obtain the first record (ie the coldest one).
1366 goto delete; /* stale entry, go to next */
1382 goto delete; /* invalid entry, go to next */
1401 goto delete; /* stale entry, go to next */
1499 FSBufferDescriptor record;
1525 record.bufferAddress = &data;
1526 record.itemSize = sizeof(data);
1527 record.itemCount = 1;
1558 error = BTIterateRecord(filefork, kBTreeFirstRecord, iterator, &record, &reclen);
1568 error = BTIterateRecord(filefork, kBTreeNextRecord, iterator, &record, &reclen);
1576 printf("hfs_agehotfiles: invalid record length %d\n", reclen);
1595 printf("hfs_agehotfiles: ran into thread record\n");
1619 * Update thread entry with latest temperature.
1768 * On entry the vnode has a reference.
2024 * Lookup a hot file entry in the tree.
2030 hotfile_entry_t *entry = hotdata->rootentry;
2032 while (entry &&
2033 entry->temperature != temperature &&
2034 entry->fileid != fileid) {
2036 if (temperature > entry->temperature)
2037 entry = entry->right;
2038 else if (temperature < entry->temperature)
2039 entry = entry->left;
2040 else if (fileid > entry->fileid)
2041 entry = entry->right;
2043 entry = entry->left;
2045 return (entry);
2050 * Insert a hot file entry into the tree.
2055 hotfile_entry_t *entry = hotdata->rootentry;
2059 if (entry == NULL) {
2066 while (entry) {
2067 if (temperature > entry->temperature) {
2068 if (entry->right)
2069 entry = entry->right;
2071 entry->right = newentry;
2074 } else if (temperature < entry->temperature) {
2075 if (entry->left)
2076 entry = entry->left;
2078 entry->left = newentry;
2081 } else if (fileid > entry->fileid) {
2082 if (entry->right)
2083 entry = entry->right;
2085 if (entry->fileid != fileid)
2086 entry->right = newentry;
2090 if (entry->left)
2091 entry = entry->left;
2093 if (entry->fileid != fileid)
2094 entry->left = newentry;
2104 * Find the coldest entry in the tree.
2109 hotfile_entry_t *entry = hotdata->rootentry;
2111 if (entry) {
2112 while (entry->left)
2113 entry = entry->left;
2115 return (entry);
2119 * Find the hottest entry in the tree.
2124 hotfile_entry_t *entry = hotdata->rootentry;
2126 if (entry) {
2127 while (entry->right)
2128 entry = entry->right;
2130 return (entry);
2134 * Delete a hot file entry from the tree.
2139 hotfile_entry_t *entry, *parent, *next;
2142 entry = hotdata->rootentry;
2144 while (entry &&
2145 entry->temperature != temperature &&
2146 entry->fileid != fileid) {
2148 parent = entry;
2149 if (temperature > entry->temperature)
2150 entry = entry->right;
2151 else if (temperature < entry->temperature)
2152 entry = entry->left;
2153 else if (fileid > entry->fileid)
2154 entry = entry->right;
2156 entry = entry->left;
2159 if (entry) {
2161 * Reorginize the sub-trees spanning from our entry.
2163 if ((next = entry->right)) {
2167 * current entry and place it at the lowest
2172 /* Walk the Right/Left sub tree from current entry */
2176 /* Plug the old left tree to the new ->Right leftmost entry */
2177 psub->left = entry->left;
2180 next = entry->left;
2183 * Now, plug the current entry sub tree to
2184 * the good pointer of our parent entry.
2188 else if (parent->left == entry)
2193 /* Place entry back on the free-list */
2194 entry->left = 0;
2195 entry->fileid = 0;
2196 entry->temperature = 0;
2198 entry->right = hotdata->freelist;
2199 hotdata->freelist = entry;
2202 if (hotdata->coldest == entry || hotdata->coldest == NULL) {
2210 * Get a free hot file entry.
2215 hotfile_entry_t * entry;
2221 entry = hf_coldest(hotdata);
2222 hf_delete(hotdata, entry->fileid, entry->temperature);
2224 entry = hotdata->freelist;
2225 hotdata->freelist = entry->right;
2226 entry->right = 0;
2228 return (entry);
2242 hotfile_entry_t *entry;
2244 while ((entry = hf_hottest(hotdata)) != NULL) {
2245 sortedlist->hfl_hotfile[i].hf_fileid = entry->fileid;
2246 sortedlist->hfl_hotfile[i].hf_temperature = entry->temperature;
2247 sortedlist->hfl_hotfile[i].hf_blocks = entry->blocks;
2248 sortedlist->hfl_totalblocks += entry->blocks;
2251 hf_delete(hotdata, entry->fileid, entry->temperature);