dovecot-2.2: mailbox_list_index=yes: Don't update INBOX's STATUS...
dovecot at dovecot.org
dovecot at dovecot.org
Fri Jul 11 13:51:48 UTC 2014
details: http://hg.dovecot.org/dovecot-2.2/rev/fd0616d553b0
changeset: 17627:fd0616d553b0
user: Timo Sirainen <tss at iki.fi>
date: Fri Jul 11 16:49:35 2014 +0300
description:
mailbox_list_index=yes: Don't update INBOX's STATUS information to index.
This should reduce disk I/O
diffstat:
src/lib-storage/list/mailbox-list-index-status.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diffs (34 lines):
diff -r 535562da7b29 -r fd0616d553b0 src/lib-storage/list/mailbox-list-index-status.c
--- a/src/lib-storage/list/mailbox-list-index-status.c Fri Jul 11 14:27:52 2014 +0300
+++ b/src/lib-storage/list/mailbox-list-index-status.c Fri Jul 11 16:49:35 2014 +0300
@@ -23,6 +23,12 @@
struct index_list_storage_module index_list_storage_module =
MODULE_CONTEXT_INIT(&mail_storage_module_register);
+/* Never update the STATUS information for INBOX. INBOX is almost always opened
+ anyway, so this just causes extra writes. (Although this could be useful if
+ somebody has a lot of other users' shared INBOXes.) */
+#define MAILBOX_IS_NEVER_IN_INDEX(box) \
+ ((box)->inbox_any)
+
static int
index_list_open_view(struct mailbox *box, struct mail_index_view **view_r,
uint32_t *seq_r)
@@ -33,6 +39,8 @@
uint32_t seq;
int ret;
+ if (MAILBOX_IS_NEVER_IN_INDEX(box))
+ return 0;
if (mailbox_list_index_refresh(box->list) < 0)
return -1;
@@ -389,6 +397,8 @@
if (ilist->syncing || ilist->updating_status)
return 0;
+ if (MAILBOX_IS_NEVER_IN_INDEX(box))
+ return 0;
/* refresh the mailbox list index once. we can't do this again after
locking, because it could trigger list syncing. */
More information about the dovecot-cvs
mailing list