Re: [PATCH 7/3] Make index preloading check the whole path to the file
- From
Linus Torvalds <torvalds@linux-foundation.org>
- Date
- Jul 10, 2009, 03:40 UTC
- Message-ID
- <alpine.LFD.2.01.0907092039140.3352@localhost.localdomain>
- In-Reply-To
- <alpine.LFD.2.01.0907092028480.3352@localhost.localdomain>
On Thu, 9 Jul 2009, Linus Torvalds wrote:
> > It should be memset() to zero. Good catch.
IOW, just this on top. It's the same initialization that 'default_cache' has, except in the case of default_cahe it was implicit in the "static", which is why I missed it when I did the "obvious" version.
Linus --- preload-index.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/preload-index.c b/preload-index.c index c3462dc..14d5281 100644 --- a/preload-index.c +++ b/preload-index.c @@ -36,6 +36,7 @@ static void *preload_thread(void *_data) struct cache_entry **cep = index->cache + p->offset; struct cache_def cache; + memset(&cache, 0, sizeof(cache)); nr = p->nr; if (nr + p->offset > index->cache_nr) nr = index->cache_nr - p->offset;