Files
git/compat/win32/fscache.h
Johannes Schindelin 1bdef2abab fscache: implement an FSCache-aware is_mount_point()
When FSCache is active, we can cache the reparse tag and use it directly
to determine whether a path refers to an NTFS junction, without any
additional, costly I/O.

Note: this change only makes a difference with the next commit, which
will make use of the FSCache in `git clean` (contingent on
`core.fscache` set, of course).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-12-14 22:32:40 +01:00

37 lines
919 B
C

#ifndef FSCACHE_H
#define FSCACHE_H
/*
* The fscache is thread specific. enable_fscache() must be called
* for each thread where caching is desired.
*/
extern CRITICAL_SECTION fscache_cs;
int fscache_enable(size_t initial_size);
#define enable_fscache(initial_size) fscache_enable(initial_size)
void fscache_disable(void);
#define disable_fscache() fscache_disable()
int fscache_enabled(const char *path);
#define is_fscache_enabled(path) fscache_enabled(path)
void fscache_flush(void);
#define flush_fscache() fscache_flush()
DIR *fscache_opendir(const char *dir);
int fscache_lstat(const char *file_name, struct stat *buf);
int fscache_is_mount_point(struct strbuf *path);
/* opaque fscache structure */
struct fscache;
struct fscache *fscache_getcache(void);
#define getcache_fscache() fscache_getcache()
void fscache_merge(struct fscache *dest);
#define merge_fscache(dest) fscache_merge(dest)
#endif