]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Added mailbox_list_index_very_dirty_syncs setting.
authorTimo Sirainen <tss@iki.fi>
Thu, 22 May 2014 01:12:05 +0000 (18:12 -0700)
committerTimo Sirainen <tss@iki.fi>
Thu, 22 May 2014 01:12:05 +0000 (18:12 -0700)
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.)

src/lib-storage/index/index-sync.c
src/lib-storage/index/maildir/maildir-sync-index.c
src/lib-storage/index/mbox/mbox-sync-list-index.c
src/lib-storage/mail-storage-settings.c
src/lib-storage/mail-storage-settings.h

index 7478c80d8e728c7dccb7b310340d525032d799cb..49a44b0b8d0bcb9447e3d4e62b4d23040def7880 100644 (file)
@@ -517,6 +517,8 @@ int index_storage_list_index_has_changed(struct mailbox *box,
                /* 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)
index 007da6621aa3a16d77b9539cc5aa5d2f91f21b4c..830e2246262d3379cc7d97b67a9b724f0375079e 100644 (file)
@@ -715,10 +715,8 @@ int maildir_list_index_has_changed(struct mailbox *box,
        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);
index 0df68f1cf4df14e2dfa17b4b38d49bb12e700f9e..133ddbec901a9cf7b2c098bd12f1977011d3f046 100644 (file)
@@ -32,7 +32,7 @@ int mbox_list_index_has_changed(struct mailbox *box,
        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);
index 6108e773e1f301fb2c0e130070199bb5bf67b557..db5068d841911a2ad4e874492bad34bd0b73d78c 100644 (file)
@@ -47,6 +47,7 @@ static const struct setting_define mail_storage_setting_defines[] = {
        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 @@ const struct mail_storage_settings mail_storage_default_settings = {
        .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,
index 7c5e52b742aca825f61c4fcfeda866ff5c3b13a0..6e255335829ef6b14ba229b8cd42460e6e846539 100644 (file)
@@ -32,6 +32,7 @@ struct mail_storage_settings {
        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;