/* mail_cache_map() increases this always. */
unsigned int remap_counter;
+ struct mail_cache_view *views;
+
struct dotlock_settings dotlock_settings;
struct file_lock *file_lock;
struct mail_cache_view {
struct mail_cache *cache;
+ struct mail_cache_view *prev, *next;
struct mail_index_view *view, *trans_view;
struct mail_cache_transaction_ctx *transaction;
#include "array.h"
#include "buffer.h"
#include "hash.h"
+#include "llist.h"
#include "nfs-workarounds.h"
#include "file-cache.h"
#include "mmap-util.h"
struct mail_cache *cache = *_cache;
*_cache = NULL;
+
+ i_assert(cache->views == NULL);
+
if (cache->file_cache != NULL)
file_cache_free(&cache->file_cache);
view->cached_exists_buf =
buffer_create_dynamic(default_pool,
cache->file_fields_count + 10);
+ DLLIST_PREPEND(&cache->views, view);
return view;
}
!view->cache->compressing)
(void)mail_cache_header_fields_update(view->cache);
+ DLLIST_REMOVE(&view->cache->views, view);
buffer_free(&view->cached_exists_buf);
i_free(view);
}