[PATCH/RFC v7 5/5] lstat_cache(): introduce clear_lstat_cache() function

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Kjetil Barvik
Date: Tuesday, January 13, 2009 - 5:29 am

If you want to completely clear the contents of the lstat_cache(), then
call this new function.

Signed-off-by: Kjetil Barvik <barvik@broadpark.no>
---
 cache.h    |    1 +
 symlinks.c |    7 +++++++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/cache.h b/cache.h
index f4452a8..468daf6 100644
--- a/cache.h
+++ b/cache.h
@@ -723,6 +723,7 @@ extern int has_symlink_leading_path(int len, const char *name);
 extern int has_symlink_or_noent_leading_path(int len, const char *name);
 extern int has_dirs_only_path(int len, const char *name, int prefix_len);
 extern void invalidate_lstat_cache(int len, const char *name);
+extern void clear_lstat_cache(void);
 
 extern struct alternate_object_database {
 	struct alternate_object_database *next;
diff --git a/symlinks.c b/symlinks.c
index 3b1c3da..7a634cb 100644
--- a/symlinks.c
+++ b/symlinks.c
@@ -183,6 +183,13 @@ void invalidate_lstat_cache(int len, const char *name)
 	}
 }
 
+/* Completely clear the contents of the cache!
+ */
+void clear_lstat_cache(void)
+{
+	reset_lstat_cache(0, 0);
+}
+
 #define USE_ONLY_LSTAT  0
 
 /* Return non-zero if path 'name' has a leading symlink component.
-- 
1.6.0.2.GIT

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH/RFC v7 5/5] lstat_cache(): introduce clear_lstat_ca ..., Kjetil Barvik, (Tue Jan 13, 5:29 am)