From: Kjetil Barvik <barvik@broadpark.no>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>,
Pete Harlan <pgit@pcharlan.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Kjetil Barvik <barvik@broadpark.no>
Subject: [PATCH/RFC v7 5/5] lstat_cache(): introduce clear_lstat_cache() function
Date: Tue, 13 Jan 2009 13:29:08 +0100 [thread overview]
Message-ID: <1231849748-8244-6-git-send-email-barvik@broadpark.no> (raw)
In-Reply-To: <1231849748-8244-1-git-send-email-barvik@broadpark.no>
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
next prev parent reply other threads:[~2009-01-13 12:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-13 12:29 [PATCH/RFC v7 0/5] git checkout: optimise away lots of lstat() calls Kjetil Barvik
2009-01-13 12:29 ` [PATCH/RFC v7 1/5] lstat_cache(): more cache effective symlink/directory detection Kjetil Barvik
2009-01-13 12:29 ` [PATCH/RFC v7 2/5] lstat_cache(): introduce has_symlink_or_noent_leading_path() function Kjetil Barvik
2009-01-13 12:29 ` [PATCH/RFC v7 3/5] lstat_cache(): introduce has_dirs_only_path() function Kjetil Barvik
2009-01-13 12:29 ` [PATCH/RFC v7 4/5] lstat_cache(): introduce invalidate_lstat_cache() function Kjetil Barvik
2009-01-13 12:29 ` Kjetil Barvik [this message]
2009-01-13 20:17 ` [PATCH/RFC v7 0/5] git checkout: optimise away lots of lstat() calls Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1231849748-8244-6-git-send-email-barvik@broadpark.no \
--to=barvik@broadpark.no \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=pgit@pcharlan.com \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).