Skip to content

Commit 84d441f

Browse files
jeffhostetlergitster
authored andcommitted
fsmonitor: trace the new invalidated cache-entry count
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9e34e56 commit 84d441f

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

fsmonitor.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -308,16 +308,21 @@ static void fsmonitor_refresh_callback(struct index_state *istate, char *name)
308308
{
309309
int len = strlen(name);
310310
int pos = index_name_pos(istate, name, len);
311+
size_t nr_in_cone;
311312

312313
trace_printf_key(&trace_fsmonitor,
313314
"fsmonitor_refresh_callback '%s' (pos %d)",
314315
name, pos);
315316

316-
if (name[len - 1] == '/') {
317-
handle_path_with_trailing_slash(istate, name, pos);
318-
} else {
319-
handle_path_without_trailing_slash(istate, name, pos);
320-
}
317+
if (name[len - 1] == '/')
318+
nr_in_cone = handle_path_with_trailing_slash(istate, name, pos);
319+
else
320+
nr_in_cone = handle_path_without_trailing_slash(istate, name, pos);
321+
322+
if (nr_in_cone)
323+
trace_printf_key(&trace_fsmonitor,
324+
"fsmonitor_refresh_callback CNT: %d",
325+
(int)nr_in_cone);
321326
}
322327

323328
/*

0 commit comments

Comments
 (0)