dovecot-2.2: lib-storage: Added mailbox_list_index_very_dirty_sy...

dovecot at dovecot.org dovecot at dovecot.org
Thu May 22 01:12:53 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/a9966b4aa020
changeset: 17386:a9966b4aa020
user:      Timo Sirainen <tss at iki.fi>
date:      Wed May 21 18:12:05 2014 -0700
description:
lib-storage: Added mailbox_list_index_very_dirty_syncs setting.
This setting assumes that the mailbox list index is up to date and uses it
without stat()ing backend mailbox files/dirs. (As a possible future TODO it
might be useful to still do the stat()ing, but only rarely.)

diffstat:

 src/lib-storage/index/index-sync.c                 |  2 ++
 src/lib-storage/index/maildir/maildir-sync-index.c |  4 +---
 src/lib-storage/index/mbox/mbox-sync-list-index.c  |  2 +-
 src/lib-storage/mail-storage-settings.c            |  2 ++
 src/lib-storage/mail-storage-settings.h            |  1 +
 5 files changed, 7 insertions(+), 4 deletions(-)

diffs (69 lines):

diff -r 6b8620c6032c -r a9966b4aa020 src/lib-storage/index/index-sync.c
--- a/src/lib-storage/index/index-sync.c	Wed May 21 06:28:36 2014 -0700
+++ b/src/lib-storage/index/index-sync.c	Wed May 21 18:12:05 2014 -0700
@@ -517,6 +517,8 @@
 		/* doesn't exist / not synced */
 		return 1;
 	}
+	if (box->storage->set->mailbox_list_index_very_dirty_syncs)
+		return 0;
 
 	ret = mailbox_get_path_to(box, MAILBOX_LIST_PATH_TYPE_INDEX, &dir);
 	if (ret < 0)
diff -r 6b8620c6032c -r a9966b4aa020 src/lib-storage/index/maildir/maildir-sync-index.c
--- a/src/lib-storage/index/maildir/maildir-sync-index.c	Wed May 21 06:28:36 2014 -0700
+++ b/src/lib-storage/index/maildir/maildir-sync-index.c	Wed May 21 18:12:05 2014 -0700
@@ -715,10 +715,8 @@
 	int ret;
 
 	ret = index_storage_list_index_has_changed(box, list_view, seq);
-	if (ret != 0)
+	if (ret != 0 || box->storage->set->mailbox_list_index_very_dirty_syncs)
 		return ret;
-	if (mbox->storage->set->maildir_very_dirty_syncs)
-		return 0;
 
 	ext_id = maildir_list_get_ext_id(mbox, list_view);
 	mail_index_lookup_ext(list_view, seq, ext_id, &data, &expunged);
diff -r 6b8620c6032c -r a9966b4aa020 src/lib-storage/index/mbox/mbox-sync-list-index.c
--- a/src/lib-storage/index/mbox/mbox-sync-list-index.c	Wed May 21 06:28:36 2014 -0700
+++ b/src/lib-storage/index/mbox/mbox-sync-list-index.c	Wed May 21 18:12:05 2014 -0700
@@ -32,7 +32,7 @@
 	int ret;
 
 	ret = index_storage_list_index_has_changed(box, list_view, seq);
-	if (ret != 0)
+	if (ret != 0 || box->storage->set->mailbox_list_index_very_dirty_syncs)
 		return ret;
 
 	ext_id = mbox_list_get_ext_id(mbox, list_view);
diff -r 6b8620c6032c -r a9966b4aa020 src/lib-storage/mail-storage-settings.c
--- a/src/lib-storage/mail-storage-settings.c	Wed May 21 06:28:36 2014 -0700
+++ b/src/lib-storage/mail-storage-settings.c	Wed May 21 18:12:05 2014 -0700
@@ -47,6 +47,7 @@
 	DEF(SET_BOOL, mail_nfs_storage),
 	DEF(SET_BOOL, mail_nfs_index),
 	DEF(SET_BOOL, mailbox_list_index),
+	DEF(SET_BOOL, mailbox_list_index_very_dirty_syncs),
 	DEF(SET_BOOL, mail_debug),
 	DEF(SET_BOOL, mail_full_filesystem_access),
 	DEF(SET_BOOL, maildir_stat_dirs),
@@ -84,6 +85,7 @@
 	.mail_nfs_storage = FALSE,
 	.mail_nfs_index = FALSE,
 	.mailbox_list_index = FALSE,
+	.mailbox_list_index_very_dirty_syncs = FALSE,
 	.mail_debug = FALSE,
 	.mail_full_filesystem_access = FALSE,
 	.maildir_stat_dirs = FALSE,
diff -r 6b8620c6032c -r a9966b4aa020 src/lib-storage/mail-storage-settings.h
--- a/src/lib-storage/mail-storage-settings.h	Wed May 21 06:28:36 2014 -0700
+++ b/src/lib-storage/mail-storage-settings.h	Wed May 21 18:12:05 2014 -0700
@@ -32,6 +32,7 @@
 	bool mail_nfs_storage;
 	bool mail_nfs_index;
 	bool mailbox_list_index;
+	bool mailbox_list_index_very_dirty_syncs;
 	bool mail_debug;
 	bool mail_full_filesystem_access;
 	bool maildir_stat_dirs;


More information about the dovecot-cvs mailing list