reintroduce out-of-date file warning

This commit is contained in:
Ryan Fleury
2024-07-04 09:56:44 -07:00
parent aed9a285f5
commit d78afc5000
4 changed files with 80 additions and 9 deletions
+26
View File
@@ -112,6 +112,32 @@ fs_key_from_path(String8 path)
return key;
}
internal U64
fs_timestamp_from_path(String8 path)
{
Temp scratch = scratch_begin(0, 0);
U64 result = 0;
path = path_normalized_from_string(scratch.arena, path);
U128 path_key = hs_hash_from_data(path);
U64 slot_idx = path_key.u64[0]%fs_shared->slots_count;
U64 stripe_idx = slot_idx%fs_shared->stripes_count;
FS_Slot *slot = &fs_shared->slots[slot_idx];
FS_Stripe *stripe = &fs_shared->stripes[stripe_idx];
OS_MutexScopeR(stripe->rw_mutex)
{
for(FS_Node *n = slot->first; n != 0; n = n->next)
{
if(str8_match(path, n->path, 0))
{
result = n->timestamp;
break;
}
}
}
scratch_end(scratch);
return result;
}
////////////////////////////////
//~ rjf: Streamer Threads
+1
View File
@@ -82,6 +82,7 @@ internal U64 fs_change_gen(void);
internal U128 fs_hash_from_path(String8 path, U64 endt_us);
internal U128 fs_key_from_path(String8 path);
internal U64 fs_timestamp_from_path(String8 path);
////////////////////////////////
//~ rjf: Streamer Threads