]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-index: Rename mail_cache_compress() to mail_cache_compress_with_trans()
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Fri, 27 Mar 2020 10:16:02 +0000 (12:16 +0200)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 15 Apr 2020 09:41:42 +0000 (12:41 +0300)
src/lib-index/mail-cache-compress.c
src/lib-index/mail-cache-decisions.c
src/lib-index/mail-cache-transaction.c
src/lib-index/mail-cache.h
src/lib-index/mail-index-sync.c
src/lib-storage/index/index-rebuild.c

index c81ca14cff6791de9a42c67fe7efe62f1a0b4268..c1100db1b4ca3705ba37171b25920307eaed83e7 100644 (file)
@@ -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);
 }
index 496922fea093000661170389b7689b7e7d4acb94..44aa057fe0698045c4d809ac5d84cd2405886039 100644 (file)
@@ -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)
index fc50b1188afc106b2be0e19f552ae961e1eb4364..e3cec007c8e282d0c471bafd5372cc41a988d1c1 100644 (file)
@@ -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 {
index f90735ab6757a5dfae866e1eb41b08b38ed7e790..b120cbd111fead13e35b5d4690e819781dae609f 100644 (file)
@@ -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);
index d90fcbcc74f5c17925a3392bd909d9e324515e35..61e5197cb99bcba250830d55db1c9fa302d4fe7d 100644 (file)
@@ -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 */
index d64555fa59d4a495b79ddf482848a34c16836038..ee9ce2c4b20bb53bcb3f701532d97f406f5e99b1 100644 (file)
@@ -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