bool disable_unlimited_tracking:1;
/* Set while quota is being recalculated to avoid recursion. */
bool recounting:1;
- /* Quota root is hidden (to e.g. IMAP GETQUOTAROOT) */
- bool hidden:1;
/* Did we already check quota_over_status correctness? */
bool quota_over_status_checked:1;
/* Are there any quota warnings with threshold=under? */
DEF(STR, quota_driver),
DEF(STR, quota_args),
DEF(BOOL, quota_ignore),
+ DEF(BOOL, quota_hidden),
DEF(SIZE, quota_storage_size),
DEF(UINT, quota_storage_percentage),
DEF(SIZE, quota_storage_extra),
.quota_driver = "count",
.quota_args = "",
.quota_ignore = FALSE,
+ .quota_hidden = FALSE,
.quota_storage_size = SET_SIZE_UNLIMITED,
.quota_storage_percentage = 100,
.quota_storage_extra = 0,
this differs from unlimited quota, which still tracks the quota,
even if it is not enforced. */
bool quota_ignore;
+ /* Quota root is hidden (to e.g. IMAP GETQUOTAROOT) */
+ bool quota_hidden;
/* Quota storage size is counted as:
quota_storage_size * quota_storage_percentage / 100 +
quota_storage_extra. */
static ARRAY(const struct quota_backend*) quota_backends;
-static void hidden_param_handler(struct quota_root *_root, const char *param_value);
static void ignoreunlim_param_handler(struct quota_root *_root, const char *param_value);
static void noenforcing_param_handler(struct quota_root *_root, const char *param_value);
-struct quota_param_parser quota_param_hidden = {.param_name = "hidden", .param_handler = hidden_param_handler};
struct quota_param_parser quota_param_ignoreunlimited = {.param_name = "ignoreunlimited", .param_handler = ignoreunlim_param_handler};
struct quota_param_parser quota_param_noenforcing = {.param_name = "noenforcing", .param_handler = noenforcing_param_handler};
const char **error_r)
{
const struct quota_param_parser default_params[] = {
- quota_param_hidden,
quota_param_ignoreunlimited,
quota_param_noenforcing,
{.param_name = NULL}
bool quota_root_is_hidden(struct quota_root *root)
{
- return root->hidden;
+ return root->set->quota_hidden;
}
enum quota_get_result
ctx->recalculate = recalculate;
}
-static void hidden_param_handler(struct quota_root *_root, const char *param_value ATTR_UNUSED)
-{
- _root->hidden = TRUE;
-}
-
static void ignoreunlim_param_handler(struct quota_root *_root, const char *param_value ATTR_UNUSED)
{
_root->disable_unlimited_tracking = TRUE;