[ccache] PATCH: reduce stat() calls on multilevel caches

2010-10-04 Thread Wilson Snyder
I'm trying to reduce the load a bit on our NFS ccache server. I noted the following pattern of accesses on a cache hit: # stat("$CACHE_DIR", {...}) = 0 # stat("$CACHE_DIR/tmp", {...}) = 0 # stat("$CACHE_DIR/CACHEDIR.TAG", {...}) = 0 * stat("$CACHE_DIR/3", {...}) = 0 * stat("$CACHE_DIR/3/d", {...

Re: [ccache] PATCH: reduce stat() calls

2010-10-04 Thread Wilson Snyder
Re my last patch, here's another that avoids these two stat calls on hits: stat("$CACHE_DIR/tmp", {...}) = 0 stat("$CACHE_DIR/CACHEDIR.TAG", {...}) = 0 diff --git a/ccache.c b/ccache.c index eed076f..d1b3878 100644 --- a/ccache.c +++ b/ccache.c @@ -73,7 +73,7 @@ static char *current_working_