Skip to content

Commit

Permalink
quota: Take mailbox as parameter in quota_set_storage_error()
Browse files Browse the repository at this point in the history
This is to start using mailbox_set_critical() later.
  • Loading branch information
mrannanj committed Dec 11, 2017
1 parent 804bca7 commit 0060557
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/plugins/quota/quota-storage.c
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 0060557

Please sign in to comment.