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;
810 if ((hotdata = (hotfile_data_t *)hfsmp->hfc_recdata) == NULL) {
819 (ffp->ff_blocks > hotdata->maxblocks) ||
827 if (temperature < hotdata->threshold) {
835 if ((hotdata->activefiles < hfsmp->hfc_maxfiles) ||
836 (hotdata->coldest == NULL) ||
837 (temperature > hotdata->coldest->temperature)) {
838 ++hotdata->refcount;
839 entry = hf_getnewentry(hotdata);
843 hf_insert(hotdata, entry);
844 --hotdata->refcount;
863 hotfile_data_t *hotdata;
888 if ((hotdata = (hotfile_data_t *)hfsmp->hfc_recdata) == NULL)
892 if (temperature < hotdata->threshold)
895 if (hotdata->coldest && (temperature >= hotdata->coldest->temperature)) {
896 ++hotdata->refcount;
897 hf_delete(hotdata, VTOC(vp)->c_fileid, temperature);
898 --hotdata->refcount;
2028 hf_lookup(hotfile_data_t *hotdata, u_int32_t fileid, u_int32_t temperature)
2030 hotfile_entry_t *entry = hotdata->rootentry;
2053 hf_insert(hotfile_data_t *hotdata, hotfile_entry_t *newentry)
2055 hotfile_entry_t *entry = hotdata->rootentry;
2060 hotdata->rootentry = newentry;
2061 hotdata->coldest = newentry;
2062 hotdata->activefiles++;
2100 hotdata->activefiles++;
2107 hf_coldest(hotfile_data_t *hotdata)
2109 hotfile_entry_t *entry = hotdata->rootentry;
2122 hf_hottest(hotfile_data_t *hotdata)
2124 hotfile_entry_t *entry = hotdata->rootentry;
2137 hf_delete(hotfile_data_t *hotdata, u_int32_t fileid, u_int32_t temperature)
2142 entry = hotdata->rootentry;
2187 hotdata->rootentry = next;
2198 entry->right = hotdata->freelist;
2199 hotdata->freelist = entry;
2200 hotdata->activefiles--;
2202 if (hotdata->coldest == entry || hotdata->coldest == NULL) {
2203 hotdata->coldest = hf_coldest(hotdata);
2213 hf_getnewentry(hotfile_data_t *hotdata)
2220 if (hotdata->freelist == NULL) {
2221 entry = hf_coldest(hotdata);
2222 hf_delete(hotdata, entry->fileid, entry->temperature);
2224 entry = hotdata->freelist;
2225 hotdata->freelist = entry->right;
2239 hf_getsortedlist(hotfile_data_t * hotdata, hotfilelist_t *sortedlist)
2244 while ((entry = hf_hottest(hotdata)) != NULL) {
2251 hf_delete(hotdata, entry->fileid, entry->temperature);