uint32_t keywords_ext_id;
uint32_t modseq_ext_id;
+ unsigned int view_count;
+
/* Module-specific contexts. */
ARRAY_DEFINE(module_contexts, union mail_index_module_context *);
i_array_init(&dest->module_contexts,
I_MIN(5, mail_index_module_register.id));
+
+ dest->index->view_count++;
}
void mail_index_view_ref(struct mail_index_view *view)
static void view_close(struct mail_index_view *view)
{
i_assert(view->refcount == 0);
+ i_assert(view->index->view_count > 0);
+
+ view->index->view_count--;
mail_transaction_log_view_close(&view->log_view);
i_array_init(&view->module_contexts,
I_MIN(5, mail_index_module_register.id));
+
+ index->view_count++;
return view;
}
if (--index->open_count > 0)
return;
+ i_assert(!index->syncing);
+ i_assert(index->view_count == 0);
+
if (index->map != NULL)
mail_index_unmap(&index->map);
i_free(view);
}
-void mail_transaction_log_views_close(struct mail_transaction_log *log)
-{
- struct mail_transaction_log_view *view;
-
- for (view = log->views; view != NULL; view = view->next)
- view->log = NULL;
-}
-
int mail_transaction_log_view_set(struct mail_transaction_log_view *view,
uint32_t min_file_seq, uoff_t min_file_offset,
uint32_t max_file_seq, uoff_t max_file_offset,
void mail_transaction_log_close(struct mail_transaction_log *log)
{
- mail_transaction_log_views_close(log);
+ i_assert(log->views == NULL);
if (log->open_file != NULL)
mail_transaction_log_file_free(&log->open_file);
bool
mail_transaction_log_view_is_corrupted(struct mail_transaction_log_view *view);
-void mail_transaction_log_views_close(struct mail_transaction_log *log);
-
int mail_transaction_log_append_begin(struct mail_index *index, bool external,
struct mail_transaction_log_append_ctx **ctx_r);
void mail_transaction_log_append_add(struct mail_transaction_log_append_ctx *ctx,