changeset 6510:d79975141df2 HEAD

Fixes to NFS read cache flushing.
author Timo Sirainen <tss@iki.fi>
date Sun, 30 Sep 2007 16:45:36 +0300
parents d0689497bb11
children fe5c19ffc119
files src/lib-index/mail-cache-compress.c src/lib-index/mail-cache-sync-update.c
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mail-cache-compress.c	Sun Sep 30 16:27:12 2007 +0300
+++ b/src/lib-index/mail-cache-compress.c	Sun Sep 30 16:45:36 2007 +0300
@@ -307,7 +307,6 @@
 			return -1;
 		}
 
-		mail_cache_flush_read_cache(cache, FALSE);
 		ret = read_full(fd, &hdr, sizeof(hdr));
 		close_keep_errno(fd);
 
@@ -338,7 +337,7 @@
 	unsigned int i, count;
 	int fd, ret;
 
-	if (cache->fd != -1)
+	if (!MAIL_CACHE_IS_UNUSABLE(cache))
 		mail_cache_flush_read_cache(cache, TRUE);
 
 	/* get the latest info on fields */
--- a/src/lib-index/mail-cache-sync-update.c	Sun Sep 30 16:27:12 2007 +0300
+++ b/src/lib-index/mail-cache-sync-update.c	Sun Sep 30 16:45:36 2007 +0300
@@ -159,6 +159,7 @@
 
 void mail_cache_sync_lost_handler(struct mail_index *index)
 {
-	mail_cache_flush_read_cache(index->cache, FALSE);
+	if (!MAIL_CACHE_IS_UNUSABLE(index->cache))
+		mail_cache_flush_read_cache(index->cache, FALSE);
 	file_cache_invalidate(index->cache->file_cache, 0, (uoff_t)-1);
 }