It's enough to have transaction_list, nothing needs the count.
const char *name, const char **error_r);
unsigned int mail_index_map_ext_hdr_offset(unsigned int name_len);
-void mail_index_view_transaction_ref(struct mail_index_view *view);
-void mail_index_view_transaction_unref(struct mail_index_view *view);
-
void mail_index_fsck_locked(struct mail_index *index);
/* Log an error and set it as the index's current error that is available
DLLIST_REMOVE(&t->view->transactions_list, t);
array_free(&t->module_contexts);
- mail_index_view_transaction_unref(t->view);
if (t->latest_view != NULL)
mail_index_view_close(&t->latest_view);
mail_index_view_close(&t->view);
struct mail_index_transaction *t;
/* don't allow syncing view while there's ongoing transactions */
- mail_index_view_transaction_ref(view);
mail_index_view_ref(view);
t = i_new(struct mail_index_transaction, 1);
ARRAY(union mail_index_view_module_context *) module_contexts;
struct mail_index_transaction *transactions_list;
- int transactions;
bool inconsistent:1;
/* this view was created by mail_index_sync_begin() */
int ret;
i_assert(!view->syncing);
- i_assert(view->transactions == 0);
+ i_assert(view->transactions_list == NULL);
view->syncing = TRUE;
bool mail_index_view_have_transactions(struct mail_index_view *view)
{
- i_assert(view->transactions >= 0);
-
- return view->transactions > 0;
-}
-
-void mail_index_view_transaction_ref(struct mail_index_view *view)
-{
- view->transactions++;
-}
-
-void mail_index_view_transaction_unref(struct mail_index_view *view)
-{
- i_assert(view->transactions > 0);
-
- view->transactions--;
+ return view->transactions_list != NULL;
}
static void mail_index_view_ref_map(struct mail_index_view *view,
if (--view->refcount > 0)
return;
- i_assert(view->transactions == 0);
+ i_assert(view->transactions_list == NULL);
view->v.close(view);
}