Skip to content

Commit

Permalink
quota: Remove unused quota_free()
Browse files Browse the repository at this point in the history
  • Loading branch information
sirainen authored and GitLab committed Jun 9, 2017
1 parent 27569c0 commit 7076aac
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
14 changes: 1 addition & 13 deletions src/plugins/quota/quota.c
Expand Up @@ -1275,7 +1275,7 @@ enum quota_alloc_result quota_try_alloc(struct quota_transaction_context *ctx,
/* with quota_try_alloc() we want to keep track of how many bytes
we've been adding/removing, so disable auto_updating=TRUE
optimization. this of course doesn't work perfectly if
quota_alloc() or quota_free*() was already used within the same
quota_alloc() or quota_free_bytes() was already used within the same
transaction, but that doesn't normally happen. */
ctx->auto_updating = FALSE;
quota_alloc(ctx, mail);
Expand Down Expand Up @@ -1349,18 +1349,6 @@ void quota_alloc(struct quota_transaction_context *ctx, struct mail *mail)
ctx->count_used++;
}

void quota_free(struct quota_transaction_context *ctx, struct mail *mail)
{
uoff_t size;

if (ctx->auto_updating)
return;
if (quota_get_mail_size(ctx, mail, &size) < 0)
quota_recalculate(ctx, QUOTA_RECALCULATE_MISSING_FREES);
else
quota_free_bytes(ctx, size);
}

void quota_free_bytes(struct quota_transaction_context *ctx,
uoff_t physical_size)
{
Expand Down
1 change: 0 additions & 1 deletion src/plugins/quota/quota.h
Expand Up @@ -108,7 +108,6 @@ enum quota_alloc_result quota_test_alloc(struct quota_transaction_context *ctx,
uoff_t size);
/* Update quota by allocating/freeing space used by mail. */
void quota_alloc(struct quota_transaction_context *ctx, struct mail *mail);
void quota_free(struct quota_transaction_context *ctx, struct mail *mail);
void quota_free_bytes(struct quota_transaction_context *ctx,
uoff_t physical_size);
/* Mark the quota to be recalculated */
Expand Down

0 comments on commit 7076aac

Please sign in to comment.