From: Timo Sirainen Date: Thu, 2 Apr 2020 20:48:50 +0000 (+0300) Subject: lib-index: Merge mail_cache_reset() into mail_cache_unlink() X-Git-Tag: 2.3.11.2~361 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0a3e9e0ae933a6e852169e19ac03400101046ce6;p=thirdparty%2Fdovecot%2Fcore.git lib-index: Merge mail_cache_reset() into mail_cache_unlink() There are no external callers to mail_cache_reset(), and this simplifies the code. --- diff --git a/src/lib-index/mail-cache.c b/src/lib-index/mail-cache.c index 77f581aaee..ebddcf28b3 100644 --- a/src/lib-index/mail-cache.c +++ b/src/lib-index/mail-cache.c @@ -32,11 +32,6 @@ static void mail_cache_unlink(struct mail_cache *cache) { if (!cache->index->readonly && !MAIL_INDEX_IS_IN_MEMORY(cache->index)) i_unlink_if_exists(cache->filepath); -} - -void mail_cache_reset(struct mail_cache *cache) -{ - mail_cache_unlink(cache); /* mark the cache as unusable */ cache->hdr = NULL; } @@ -45,7 +40,7 @@ void mail_cache_set_corrupted(struct mail_cache *cache, const char *fmt, ...) { va_list va; - mail_cache_reset(cache); + mail_cache_unlink(cache); va_start(va, fmt); T_BEGIN { @@ -316,7 +311,6 @@ mail_cache_map_finish(struct mail_cache *cache, uoff_t offset, size_t size, !MAIL_CACHE_IS_UNUSABLE(cache) && cache->hdr->file_seq != 0 ? cache->hdr->file_seq : 0; - cache->hdr = NULL; *corrupted_r = TRUE; return -1; } diff --git a/src/lib-index/mail-cache.h b/src/lib-index/mail-cache.h index e8cc64ec76..2bce3eb3a7 100644 --- a/src/lib-index/mail-cache.h +++ b/src/lib-index/mail-cache.h @@ -155,8 +155,6 @@ void mail_cache_set_corrupted(struct mail_cache *cache, const char *fmt, ...) ATTR_FORMAT(2, 3); void mail_cache_set_seq_corrupted_reason(struct mail_cache_view *cache_view, uint32_t seq, const char *reason); -/* Delete the cache file. */ -void mail_cache_reset(struct mail_cache *cache); /* Returns human-readable reason for why a cached field is missing for the specified mail. This is mainly for debugging purposes, so the exact