Lines Matching defs:hotdata

164 	hotfile_data_t *hotdata;
266 MALLOC(hotdata, hotfile_data_t *, size, M_TEMP, M_WAITOK);
267 if (hotdata == NULL) {
274 bzero(hotdata, size);
277 hotdata->entries[i-1].right = &hotdata->entries[i];
279 hotdata->freelist = &hotdata->entries[0];
283 hotdata->threshold = HFC_MINIMUM_TEMPERATURE;
284 hotdata->maxblocks = HFC_MAXIMUM_FILESIZE / HFSTOVCB(hfsmp)->blockSize;
285 hotdata->hfsmp = hfsmp;
287 hfsmp->hfc_recdata = hotdata;
301 hotfile_data_t *hotdata;
324 hotdata = (hotfile_data_t *)hfsmp->hfc_recdata;
325 if (hotdata == NULL)
332 printf("hfs: curentries: %d\n", hotdata->activefiles);
337 if (hotdata->rootentry == NULL) {
365 size += sizeof(hotfileinfo_t) * (hotdata->activefiles - 1);
376 hf_getsortedlist(hotdata, listp); /* NOTE: destroys hot file tree! */
421 FREE(hotdata, M_TEMP);
435 hotfile_data_t *hotdata = NULL;
451 hotdata = (hotfile_data_t *)hfsmp->hfc_recdata;
452 if (hotdata == NULL || hfsmp->hfc_stage != HFC_RECORDING) {
482 hotfileinfo.threshold = SWAP_BE32 (hotdata->threshold);
483 hotfileinfo.maxfileblks = SWAP_BE32 (hotdata->maxblocks);
498 if (hotdata) {
499 FREE(hotdata, M_TEMP);
784 hotfile_data_t *hotdata;
802 if ((hotdata = (hotfile_data_t *)hfsmp->hfc_recdata) == NULL) {
811 (ffp->ff_blocks > hotdata->maxblocks) ||
819 if (temperature < hotdata->threshold) {
827 if ((hotdata->activefiles < hfsmp->hfc_maxfiles) ||
828 (hotdata->coldest == NULL) ||
829 (temperature > hotdata->coldest->temperature)) {
830 ++hotdata->refcount;
831 entry = hf_getnewentry(hotdata);
835 hf_insert(hotdata, entry);
836 --hotdata->refcount;
855 hotfile_data_t *hotdata;
880 if ((hotdata = (hotfile_data_t *)hfsmp->hfc_recdata) == NULL)
884 if (temperature < hotdata->threshold)
887 if (hotdata->coldest && (temperature >= hotdata->coldest->temperature)) {
888 ++hotdata->refcount;
889 hf_delete(hotdata, VTOC(vp)->c_fileid, temperature);
890 --hotdata->refcount;
2013 hf_lookup(hotfile_data_t *hotdata, u_int32_t fileid, u_int32_t temperature)
2015 hotfile_entry_t *entry = hotdata->rootentry;
2038 hf_insert(hotfile_data_t *hotdata, hotfile_entry_t *newentry)
2040 hotfile_entry_t *entry = hotdata->rootentry;
2045 hotdata->rootentry = newentry;
2046 hotdata->coldest = newentry;
2047 hotdata->activefiles++;
2085 hotdata->activefiles++;
2092 hf_coldest(hotfile_data_t *hotdata)
2094 hotfile_entry_t *entry = hotdata->rootentry;
2107 hf_hottest(hotfile_data_t *hotdata)
2109 hotfile_entry_t *entry = hotdata->rootentry;
2122 hf_delete(hotfile_data_t *hotdata, u_int32_t fileid, u_int32_t temperature)
2127 entry = hotdata->rootentry;
2172 hotdata->rootentry = next;
2183 entry->right = hotdata->freelist;
2184 hotdata->freelist = entry;
2185 hotdata->activefiles--;
2187 if (hotdata->coldest == entry || hotdata->coldest == NULL) {
2188 hotdata->coldest = hf_coldest(hotdata);
2198 hf_getnewentry(hotfile_data_t *hotdata)
2205 if (hotdata->freelist == NULL) {
2206 entry = hf_coldest(hotdata);
2207 hf_delete(hotdata, entry->fileid, entry->temperature);
2209 entry = hotdata->freelist;
2210 hotdata->freelist = entry->right;
2224 hf_getsortedlist(hotfile_data_t * hotdata, hotfilelist_t *sortedlist)
2229 while ((entry = hf_hottest(hotdata)) != NULL) {
2236 hf_delete(hotdata, entry->fileid, entry->temperature);