return 1;
}
+static inline bool trash_clean_achieved(struct trash_clean *tclean)
+{
+ if (tclean->bytes_expunged < tclean->bytes_needed &&
+ tclean->count_expunged < tclean->count_needed)
+ return FALSE;
+ return TRUE;
+}
+
static int trash_clean_do_execute(struct trash_clean *tclean)
{
struct quota_transaction_context *ctx = tclean->ctx;
mail_expunge(tcboxes[oldest_idx].mail);
tclean->count_expunged++;
tclean->bytes_expunged += size;
- if (tclean->bytes_expunged >= tclean->bytes_needed &&
- tclean->count_expunged >= tclean->count_needed)
+ if (trash_clean_achieved(tclean))
break;
tcboxes[oldest_idx].mail = NULL;
} else {