@matheusbsbs / matheus-bagliano / commits / 381b920b8a
Fork 0

Revert "lstat_cache(): print a warning if doing ping-pong between cache types"

This reverts commit 7734f04873cfaddd0b148074a633f1f824fd961f. I guess that the reverted commit, 7734f048, has been in test long enough, and should now be reverted. I have not received any info regarding any debug output of the reverted commit, so lets hope that the lstat_cache() function do not cause any ping-pong. Signed-off-by: Kjetil Barvik <barvik@broadpark.no> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Kjetil Barvik committed Mar 17, 2009 at 19:20 UTC 381b920b8ac1440962f340cba9030e2dc3130c49
1 file changed -23
symlinks.c
-23
@@ -51,11 +51,6 @@ static inline void reset_lstat_cache(void)
51 */
52 }
53
54 -#define SWITCHES_BEFORE_WARNING 10
55 -static unsigned int cache_switches, number_of_warnings;
56 -static unsigned int current_cache_func, last_cache_func;
57 -static unsigned int total_calls;
58 -
54 #define FL_DIR (1 << 0)
55 #define FL_NOENT (1 << 1)
56 #define FL_SYMLINK (1 << 2)
@@ -82,7 +77,6 @@ static int lstat_cache(const char *name, int len,
77 int match_flags, ret_flags, save_flags, max_len, ret;
78 struct stat st;
79
85 - total_calls++;
80 if (cache.track_flags != track_flags ||
81 cache.prefix_len_stat_func != prefix_len_stat_func) {
82 /*
@@ -94,17 +88,6 @@ static int lstat_cache(const char *name, int len,
88 cache.track_flags = track_flags;
89 cache.prefix_len_stat_func = prefix_len_stat_func;
90 match_len = last_slash = 0;
97 - cache_switches++;
98 - if (cache_switches > SWITCHES_BEFORE_WARNING) {
99 - if (number_of_warnings < 10 || number_of_warnings % 1000 == 0)
100 - printf("warning from %s:%d cache_switches:%u > %u "\
101 - "(current:%u last:%u total:%u)\n",
102 - __FILE__, __LINE__,
103 - cache_switches, SWITCHES_BEFORE_WARNING,
104 - current_cache_func, last_cache_func,
105 - total_calls);
106 - number_of_warnings++;
107 - }
91 } else {
92 /*
93 * Check to see if we have a match from the cache for
@@ -233,8 +216,6 @@ void clear_lstat_cache(void)
216 */
217 int has_symlink_leading_path(const char *name, int len)
218 {
236 - last_cache_func = current_cache_func;
237 - current_cache_func = 1;
219 return lstat_cache(name, len,
220 FL_SYMLINK|FL_DIR, USE_ONLY_LSTAT) &
221 FL_SYMLINK;
@@ -246,8 +227,6 @@ int has_symlink_leading_path(const char *name, int len)
227 */
228 int has_symlink_or_noent_leading_path(const char *name, int len)
229 {
249 - last_cache_func = current_cache_func;
250 - current_cache_func = 2;
230 return lstat_cache(name, len,
231 FL_SYMLINK|FL_NOENT|FL_DIR, USE_ONLY_LSTAT) &
232 (FL_SYMLINK|FL_NOENT);
@@ -262,8 +241,6 @@ int has_symlink_or_noent_leading_path(const char *name, int len)
241 */
242 int has_dirs_only_path(const char *name, int len, int prefix_len)
243 {
265 - last_cache_func = current_cache_func;
266 - current_cache_func = 3;
244 return lstat_cache(name, len,
245 FL_DIR|FL_FULLPATH, prefix_len) &
246 FL_DIR;