Skip to content

Commit 65b5495

Browse files
jeffhostetlerdscho
authored andcommitted
trace2:gvfs:experiment: add region to cache_tree_fully_valid()
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
1 parent 44098ae commit 65b5495

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
@@ -225,15 +225,15 @@ static void discard_unused_subtrees(struct cache_tree *it)
225225
}
226226
}
227227

228-
int cache_tree_fully_valid(struct cache_tree *it)
228+
static int cache_tree_fully_valid_1(struct cache_tree *it)
229229
{
230230
int i;
231231
if (!it)
232232
return 0;
233233
if (it->entry_count < 0 || !has_object_file(&it->oid))
234234
return 0;
235235
for (i = 0; i < it->subtree_nr; i++) {
236-
if (!cache_tree_fully_valid(it->down[i]->cache_tree))
236+
if (!cache_tree_fully_valid_1(it->down[i]->cache_tree))
237237
return 0;
238238
}
239239
return 1;
@@ -244,6 +244,17 @@ static int must_check_existence(const struct cache_entry *ce)
244244
return !(has_promisor_remote() && ce_skip_worktree(ce));
245245
}
246246

247+
int cache_tree_fully_valid(struct cache_tree *it)
248+
{
249+
int result;
250+
251+
trace2_region_enter("cache_tree", "fully_valid", NULL);
252+
result = cache_tree_fully_valid_1(it);
253+
trace2_region_leave("cache_tree", "fully_valid", NULL);
254+
255+
return result;
256+
}
257+
247258
static int update_one(struct cache_tree *it,
248259
struct cache_entry **cache,
249260
int entries,

0 commit comments

Comments
 (0)