return ret;
}
-int mail_cache_compress(struct mail_cache *cache,
- struct mail_index_transaction *trans,
- struct mail_cache_compress_lock **lock_r)
+int mail_cache_compress_with_trans(struct mail_cache *cache,
+ struct mail_index_transaction *trans,
+ struct mail_cache_compress_lock **lock_r)
{
return mail_cache_compress_full(cache, FALSE, trans, lock_r);
}
that the fields are updated even if the cache was already created
and no compression was done. */
dst->field_header_write_pending = TRUE;
- int ret = mail_cache_compress(dst, itrans, &lock);
+ int ret = mail_cache_compress_with_trans(dst, itrans, &lock);
if (lock != NULL)
mail_cache_compress_unlock(&lock);
if (mail_index_transaction_commit(&itrans) < 0)
view = mail_index_view_open(cache->index);
trans = mail_index_transaction_begin(view,
MAIL_INDEX_TRANSACTION_FLAG_EXTERNAL);
- if (mail_cache_compress(cache, trans, &lock) < 0) {
+ if (mail_cache_compress_with_trans(cache, trans, &lock) < 0) {
mail_index_transaction_rollback(&trans);
ret = -1;
} else {
mail_cache_compress_unlock() needs to be called afterwards. The lock doesn't
prevent updates to the cache while it's held, it only prevents another cache
compression. */
-int mail_cache_compress(struct mail_cache *cache,
- struct mail_index_transaction *trans,
- struct mail_cache_compress_lock **lock_r);
+int mail_cache_compress_with_trans(struct mail_cache *cache,
+ struct mail_index_transaction *trans,
+ struct mail_cache_compress_lock **lock_r);
int mail_cache_compress_forced(struct mail_cache *cache,
struct mail_index_transaction *trans,
struct mail_cache_compress_lock **lock_r);
if ((ctx->flags & MAIL_INDEX_SYNC_FLAG_FSYNC) != 0)
trans_flags |= MAIL_INDEX_TRANSACTION_FLAG_FSYNC;
cache_trans = mail_index_transaction_begin(ctx->view, trans_flags);
- if (mail_cache_compress(index->cache, cache_trans,
- &cache_lock) < 0)
+ if (mail_cache_compress_with_trans(index->cache, cache_trans,
+ &cache_lock) < 0)
mail_index_transaction_rollback(&cache_trans);
else {
/* can't really do anything if index commit fails */
*_ctx = NULL;
/* initialize cache file with the old field decisions */
- (void)mail_cache_compress(ctx->box->cache, ctx->trans, &lock);
+ (void)mail_cache_compress_with_trans(ctx->box->cache, ctx->trans, &lock);
if (lock != NULL) {
/* FIXME: this is a bit too early. ideally we should return it
from this function and unlock only after the transaction is