From: Junio C Hamano Date: Mon, 12 Jan 2009 04:05:45 GMT Subject: Re: [PATCH/RFC v6 1/3] lstat_cache(): more cache effective symlink/directory detection Message-ID: <7vbpudkw2u.fsf@gitster.siamese.dyndns.org> In-Reply-To: <1231680542-17315-2-git-send-email-barvik@broadpark.no> Kjetil Barvik writes: > -static inline void set_pathname(int len, const char *name, struct pathname *match) > +static inline void reset_lstat_cache(void) > { > - if (len < PATH_MAX) { > - match->len = len; > - memcpy(match->path, name, len); > - match->path[len] = 0; > - } > + cache.path[0] = '\0'; > + cache.len = 0; > + cache.flags = 0; > } I see you made this internal to the caching code, but I suspect in the long run there needs to be a way for callers that use the caching mechanism to check and then create new paths in the work tree to invalidate the cached code (namely, builtin-apply.c::write_out_results() and entry.c::checkout_entry() codepaths). I'll queue this round to 'pu' anyway, though. Thanks.