Skip to content

Commit edf9d8a

Browse files
jeffhostetlermjcheetham
authored andcommitted
trace2:gvfs:experiment: add region to cache_tree_fully_valid()
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
1 parent a1f3296 commit edf9d8a

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

cache-tree.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,15 +233,15 @@ static void discard_unused_subtrees(struct cache_tree *it)
233233
}
234234
}
235235

236-
int cache_tree_fully_valid(struct cache_tree *it)
236+
static int cache_tree_fully_valid_1(struct cache_tree *it)
237237
{
238238
int i;
239239
if (!it)
240240
return 0;
241241
if (it->entry_count < 0 || !repo_has_object_file(the_repository, &it->oid))
242242
return 0;
243243
for (i = 0; i < it->subtree_nr; i++) {
244-
if (!cache_tree_fully_valid(it->down[i]->cache_tree))
244+
if (!cache_tree_fully_valid_1(it->down[i]->cache_tree))
245245
return 0;
246246
}
247247
return 1;
@@ -252,6 +252,17 @@ static int must_check_existence(const struct cache_entry *ce)
252252
return !(repo_has_promisor_remote(the_repository) && ce_skip_worktree(ce));
253253
}
254254

255+
int cache_tree_fully_valid(struct cache_tree *it)
256+
{
257+
int result;
258+
259+
trace2_region_enter("cache_tree", "fully_valid", NULL);
260+
result = cache_tree_fully_valid_1(it);
261+
trace2_region_leave("cache_tree", "fully_valid", NULL);
262+
263+
return result;
264+
}
265+
255266
static int update_one(struct cache_tree *it,
256267
struct cache_entry **cache,
257268
int entries,

0 commit comments

Comments
 (0)