EntryCache: Add entry_cache_add_missing() for negative caching.
It provides a way for filesystems to cache a lookup failure and therefore prevents repeated lookups of missing entries. This is a common scenario for example in command lookup and compiling, where each directory in PATH or each include directory is searched for the given entry.
This commit is contained in:
@@ -104,6 +104,8 @@ extern status_t file_map_translate(void *map, off_t offset, size_t size,
|
||||
/* entry cache */
|
||||
extern status_t entry_cache_add(dev_t mountID, ino_t dirID, const char* name,
|
||||
ino_t nodeID);
|
||||
extern status_t entry_cache_add_missing(dev_t mountID, ino_t dirID,
|
||||
const char* name);
|
||||
extern status_t entry_cache_remove(dev_t mountID, ino_t dirID,
|
||||
const char* name);
|
||||
|
||||
|
||||
@@ -871,6 +871,7 @@
|
||||
|
||||
/* entry cache */
|
||||
#define entry_cache_add fssh_entry_cache_add
|
||||
#define entry_cache_add_missing fssh_entry_cache_add_missing
|
||||
#define entry_cache_remove fssh_entry_cache_remove
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -126,6 +126,8 @@ extern fssh_status_t fssh_file_map_translate(void *_map, fssh_off_t offset,
|
||||
extern fssh_status_t fssh_entry_cache_add(fssh_dev_t mountID,
|
||||
fssh_ino_t dirID, const char* name,
|
||||
fssh_ino_t nodeID);
|
||||
extern fssh_status_t fssh_entry_cache_add_missing(fssh_dev_t mountID,
|
||||
fssh_ino_t dirID, const char* name);
|
||||
extern fssh_status_t fssh_entry_cache_remove(fssh_dev_t mountID,
|
||||
fssh_ino_t dirID, const char* name);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user