]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
quota: Take mailbox as parameter in quota_set_storage_error()
authorMartti Rannanjärvi <martti.rannanjarvi@dovecot.fi>
Mon, 27 Nov 2017 11:52:07 +0000 (13:52 +0200)
committerMartti Rannanjärvi <martti.rannanjarvi@dovecot.fi>
Mon, 11 Dec 2017 07:41:54 +0000 (09:41 +0200)
This is to start using mailbox_set_critical() later.

src/plugins/quota/quota-storage.c

index 1a98e48755891fc7cbb8da1309f37894e7eaeb30..fcc3147ef6d9e731cee126bd2d07d20a2d555537 100644 (file)
@@ -47,11 +47,12 @@ static MODULE_CONTEXT_DEFINE_INIT(quota_mailbox_list_module,
                                  &mailbox_list_module_register);
 
 static void quota_set_storage_error(struct quota_transaction_context *qt,
-                                   struct mail_storage *storage,
+                                   struct mailbox *box,
                                    enum quota_alloc_result res,
                                    const char *internal_err)
 {
        const char *errstr = quota_alloc_result_errstr(res, qt);
+       struct mail_storage *storage = box->storage;
        switch (res) {
        case QUOTA_ALLOC_RESULT_OVER_MAXSIZE:
                mail_storage_set_error(storage, MAIL_ERROR_LIMIT, errstr);
@@ -125,7 +126,7 @@ quota_get_status(struct mailbox *box, enum mailbox_status_items items,
                const char *error;
                enum quota_alloc_result qret = quota_test_alloc(qt, 0, &error);
                if (qret != QUOTA_ALLOC_RESULT_OK) {
-                       quota_set_storage_error(qt, box->storage, qret, error);
+                       quota_set_storage_error(qt, box, qret, error);
                        ret = -1;
                }
                quota_transaction_rollback(&qt);
@@ -267,7 +268,7 @@ static int quota_check(struct mail_save_context *ctx, struct mailbox *src_box)
                   background quota calculation, allow saving anyway. */
                return 0;
        default:
-               quota_set_storage_error(qt, t->box->storage, ret, error);
+               quota_set_storage_error(qt, t->box, ret, error);
                return -1;
        }
 }
@@ -336,7 +337,7 @@ quota_save_begin(struct mail_save_context *ctx, struct istream *input)
                         * anyway. */
                        break;
                default:
-                       quota_set_storage_error(qt, t->box->storage, qret, error);
+                       quota_set_storage_error(qt, t->box, qret, error);
                        return -1;
                }
        }