]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-index: Added mail_index_reset_fscked()
authorTimo Sirainen <tss@iki.fi>
Tue, 6 Dec 2011 23:46:42 +0000 (01:46 +0200)
committerTimo Sirainen <tss@iki.fi>
Tue, 6 Dec 2011 23:46:42 +0000 (01:46 +0200)
src/lib-index/mail-index-fsck.c
src/lib-index/mail-index-private.h
src/lib-index/mail-index.h

index 4970faeb54a81c8ce6b87d8f7065dda4cd5a805c..21f14eefd3eb13f0e71a4aa2a84c98e345ae69da 100644 (file)
@@ -431,6 +431,8 @@ int mail_index_fsck(struct mail_index *index)
 
        i_warning("fscking index file %s", index->filepath);
 
+       index->fscked = TRUE;
+
        if (index->log->head == NULL) {
                /* we're trying to open the index files, but there wasn't
                   any .log file. */
@@ -469,3 +471,11 @@ void mail_index_fsck_locked(struct mail_index *index)
        ret = mail_index_fsck(index);
        i_assert(ret == 0);
 }
+
+bool mail_index_reset_fscked(struct mail_index *index)
+{
+       bool ret = index->fscked;
+
+       index->fscked = FALSE;
+       return ret;
+}
index ad7d5209ebc899e56afeb6483e16177e113d10f2..58064b67fda6bfdd9cb9f4c318eaec9366596536 100644 (file)
@@ -241,6 +241,7 @@ struct mail_index {
        unsigned int modseqs_enabled:1;
        unsigned int initial_create:1;
        unsigned int initial_mapped:1;
+       unsigned int fscked:1;
 };
 
 extern struct mail_index_module_register mail_index_module_register;
index 8ed6fba4ff99ef24a1c9e06b7d65bc557a75b55f..99c66885a10e022fb5769e934ee3ac4b2b185249 100644 (file)
@@ -360,6 +360,9 @@ void mail_index_mark_corrupted(struct mail_index *index);
 /* Check and fix any found problems. Returns -1 if we couldn't lock for sync,
    0 if everything went ok. */
 int mail_index_fsck(struct mail_index *index);
+/* Returns TRUE if mail_index_fsck() has been called since the last
+   mail_index_reset_fscked() call. */
+bool mail_index_reset_fscked(struct mail_index *index);
 
 /* Synchronize changes in view. You have to go through all records, or view
    will be marked inconsistent. Only sync_mask type records are