Skip to content

Commit

Permalink
fsmonitor: trace the new invalidated cache-entry count
Browse files Browse the repository at this point in the history
Consolidate the directory/non-directory calls to the refresh handler
code.  Log the resulting count of invalidated cache-entries.

The nr_in_cone value will be used in a later commit to decide if
we also need to try to do case-insensitive lookups.

Signed-off-by: Jeff Hostetler <jeffhostetler@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
jeffhostetler committed Mar 21, 2024
1 parent 405d568 commit 428ed9d
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions fsmonitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,16 +308,21 @@ static void fsmonitor_refresh_callback(struct index_state *istate, char *name)
{
int len = strlen(name);
int pos = index_name_pos(istate, name, len);
size_t nr_in_cone;

trace_printf_key(&trace_fsmonitor,
"fsmonitor_refresh_callback '%s' (pos %d)",
name, pos);

if (name[len - 1] == '/') {
handle_path_with_trailing_slash(istate, name, pos);
} else {
handle_path_without_trailing_slash(istate, name, pos);
}
if (name[len - 1] == '/')
nr_in_cone = handle_path_with_trailing_slash(istate, name, pos);
else
nr_in_cone = handle_path_without_trailing_slash(istate, name, pos);

if (nr_in_cone)
trace_printf_key(&trace_fsmonitor,
"fsmonitor_refresh_callback CNT: %d",
(int)nr_in_cone);
}

/*
Expand Down

0 comments on commit 428ed9d

Please sign in to comment.