dovecot: Don't bother flushing attribute cache if we just fcntl ...

dovecot at dovecot.org dovecot at dovecot.org
Sun Nov 18 01:45:33 EET 2007


details:   http://hg.dovecot.org/dovecot/rev/e3af6e0e55ae
changeset: 6827:e3af6e0e55ae
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Nov 18 01:45:29 2007 +0200
description:
Don't bother flushing attribute cache if we just fcntl locked the file.

diffstat:

2 files changed, 3 insertions(+), 2 deletions(-)
src/lib-index/mail-cache.c     |    3 ++-
src/lib-index/mail-index-map.c |    2 +-

diffs (25 lines):

diff -r bca08d6f001d -r e3af6e0e55ae src/lib-index/mail-cache.c
--- a/src/lib-index/mail-cache.c	Sat Nov 17 08:14:31 2007 +0200
+++ b/src/lib-index/mail-cache.c	Sun Nov 18 01:45:29 2007 +0200
@@ -490,7 +490,8 @@ static int mail_cache_lock_file(struct m
 	if (ret <= 0)
 		return ret;
 
-	if (cache->index->nfs_flush)
+	if (cache->index->nfs_flush &&
+	    cache->index->lock_method != FILE_LOCK_METHOD_FCNTL)
 		nfs_flush_attr_cache_fd(cache->filepath, cache->fd);
 	mail_cache_flush_read_cache(cache, TRUE);
 	return 1;
diff -r bca08d6f001d -r e3af6e0e55ae src/lib-index/mail-index-map.c
--- a/src/lib-index/mail-index-map.c	Sat Nov 17 08:14:31 2007 +0200
+++ b/src/lib-index/mail-index-map.c	Sun Nov 18 01:45:29 2007 +0200
@@ -811,7 +811,7 @@ static int mail_index_map_latest_file(st
 	if (mail_index_lock_shared(index, &lock_id) < 0)
 		return -1;
 
-	if (index->nfs_flush)
+	if (index->nfs_flush && index->lock_method != FILE_LOCK_METHOD_FCNTL)
 		nfs_flush_attr_cache_fd(index->filepath, index->fd);
 
 	if (fstat(index->fd, &st) == 0)


More information about the dovecot-cvs mailing list