From: Timo Sirainen Date: Fri, 27 Mar 2020 10:16:02 +0000 (+0200) Subject: lib-index: Rename mail_cache_compress() to mail_cache_compress_with_trans() X-Git-Tag: 2.3.11.2~418 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dfcbea986021f77120df10a99afd8350a0d974e6;p=thirdparty%2Fdovecot%2Fcore.git lib-index: Rename mail_cache_compress() to mail_cache_compress_with_trans() --- diff --git a/src/lib-index/mail-cache-compress.c b/src/lib-index/mail-cache-compress.c index c81ca14cff..c1100db1b4 100644 --- a/src/lib-index/mail-cache-compress.c +++ b/src/lib-index/mail-cache-compress.c @@ -559,9 +559,9 @@ mail_cache_compress_full(struct mail_cache *cache, bool forced, 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); } diff --git a/src/lib-index/mail-cache-decisions.c b/src/lib-index/mail-cache-decisions.c index 496922fea0..44aa057fe0 100644 --- a/src/lib-index/mail-cache-decisions.c +++ b/src/lib-index/mail-cache-decisions.c @@ -178,7 +178,7 @@ int mail_cache_decisions_copy(struct mail_cache *src, struct mail_cache *dst) 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) diff --git a/src/lib-index/mail-cache-transaction.c b/src/lib-index/mail-cache-transaction.c index fc50b1188a..e3cec007c8 100644 --- a/src/lib-index/mail-cache-transaction.c +++ b/src/lib-index/mail-cache-transaction.c @@ -192,7 +192,7 @@ mail_cache_transaction_compress(struct mail_cache_transaction_ctx *ctx) 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 { diff --git a/src/lib-index/mail-cache.h b/src/lib-index/mail-cache.h index f90735ab67..b120cbd111 100644 --- a/src/lib-index/mail-cache.h +++ b/src/lib-index/mail-cache.h @@ -72,9 +72,9 @@ bool mail_cache_need_compress(struct mail_cache *cache); 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); diff --git a/src/lib-index/mail-index-sync.c b/src/lib-index/mail-index-sync.c index d90fcbcc74..61e5197cb9 100644 --- a/src/lib-index/mail-index-sync.c +++ b/src/lib-index/mail-index-sync.c @@ -948,8 +948,8 @@ int mail_index_sync_commit(struct mail_index_sync_ctx **_ctx) 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 */ diff --git a/src/lib-storage/index/index-rebuild.c b/src/lib-storage/index/index-rebuild.c index d64555fa59..ee9ce2c4b2 100644 --- a/src/lib-storage/index/index-rebuild.c +++ b/src/lib-storage/index/index-rebuild.c @@ -240,7 +240,7 @@ void index_index_rebuild_deinit(struct index_rebuild_context **_ctx, *_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