| 11101 | kv_entry hdr = {0}; |
| 11102 | uint32_t text_bytes = 0; |
| 11103 | bool ok = kv_read_header(fp, &hdr, &text_bytes); |
| 11104 | uint64_t skip = (uint64_t)text_bytes + hdr.payload_bytes; |
| 11105 | if (ok && hdr.model_id == model_id && (hdr.ext_flags & KV_EXT_TOOL_MAP) && |
| 11106 | skip <= (uint64_t)INT64_MAX && |
| 11107 | fseeko(fp, (off_t)skip, SEEK_CUR) == 0) |
| 11108 | { |
| 11109 | kv_tool_map_load_from_pos(s, fp, &wanted); |
| 11110 | } |
| 11111 | fclose(fp); |
| 11112 | } |
| 11113 | closedir(d); |
| 11114 | id_list_free(&wanted); |
| 11115 | } |
| 11116 | |
| 11117 | #ifdef DS4_SERVER_TEST |
| 11118 | static double kv_entry_eviction_score(const kv_entry *e, const ds4_tokens *live, |
| 11119 | uint64_t now, |
| 11120 | const ds4_kvstore_eviction_context *incoming) { |
| 11121 | return ds4_kvstore_entry_eviction_score(e, live, now, incoming); |