mirror of
https://github.com/git-for-windows/git.git
synced 2026-03-25 19:43:19 -05:00
fscache: add key for GIT_TRACE_FSCACHE
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
committed by
Johannes Schindelin
parent
b2aa80ae22
commit
78eaedc699
@@ -4,11 +4,13 @@
|
|||||||
#include "fscache.h"
|
#include "fscache.h"
|
||||||
#include "../../dir.h"
|
#include "../../dir.h"
|
||||||
#include "../../abspath.h"
|
#include "../../abspath.h"
|
||||||
|
#include "../../trace.h"
|
||||||
|
|
||||||
static int initialized;
|
static int initialized;
|
||||||
static volatile long enabled;
|
static volatile long enabled;
|
||||||
static struct hashmap map;
|
static struct hashmap map;
|
||||||
static CRITICAL_SECTION mutex;
|
static CRITICAL_SECTION mutex;
|
||||||
|
static struct trace_key trace_fscache = TRACE_KEY_INIT(FSCACHE);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* An entry in the file system cache. Used for both entire directory listings
|
* An entry in the file system cache. Used for both entire directory listings
|
||||||
@@ -207,6 +209,8 @@ static struct fsentry *fsentry_create_list(const struct fsentry *dir)
|
|||||||
if (h == INVALID_HANDLE_VALUE) {
|
if (h == INVALID_HANDLE_VALUE) {
|
||||||
err = GetLastError();
|
err = GetLastError();
|
||||||
errno = (err == ERROR_DIRECTORY) ? ENOTDIR : err_win_to_posix(err);
|
errno = (err == ERROR_DIRECTORY) ? ENOTDIR : err_win_to_posix(err);
|
||||||
|
trace_printf_key(&trace_fscache, "fscache: error(%d) '%s'\n",
|
||||||
|
errno, dir->dirent.d_name);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -392,6 +396,7 @@ int fscache_enable(int enable)
|
|||||||
fscache_clear();
|
fscache_clear();
|
||||||
LeaveCriticalSection(&mutex);
|
LeaveCriticalSection(&mutex);
|
||||||
}
|
}
|
||||||
|
trace_printf_key(&trace_fscache, "fscache: enable(%d)\n", enable);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user