Mercurial > dovecot > original-hg > dovecot-1.2
changeset 6874:1d0521b7151d HEAD
Added noenforcing option to fs quota backend.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Wed, 28 Nov 2007 16:45:25 +0200 |
parents | 3069e66789b3 |
children | a9e4221d5c0b |
files | src/plugins/quota/quota-fs.c src/plugins/quota/quota-private.h src/plugins/quota/quota.c |
diffstat | 3 files changed, 10 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/plugins/quota/quota-fs.c Wed Nov 28 16:08:39 2007 +0200 +++ b/src/plugins/quota/quota-fs.c Wed Nov 28 16:45:25 2007 +0200 @@ -97,6 +97,8 @@ root->user_disabled = TRUE; else if (strcmp(*tmp, "inode_per_mail") == 0) root->inode_per_mail = TRUE; + else if (strcmp(*tmp, "noenforcing") == 0) + _root->no_enforcing = TRUE; else if (strncmp(*tmp, "mount=", 6) == 0) { i_free(root->storage_mount_path); root->storage_mount_path = i_strdup(*tmp + 6);
--- a/src/plugins/quota/quota-private.h Wed Nov 28 16:08:39 2007 +0200 +++ b/src/plugins/quota/quota-private.h Wed Nov 28 16:45:25 2007 +0200 @@ -75,6 +75,9 @@ /* Module-specific contexts. See quota_module_id. */ ARRAY_DEFINE(quota_module_contexts, void); + + /* don't enforce quota when saving */ + unsigned int no_enforcing:1; }; struct quota_transaction_context {
--- a/src/plugins/quota/quota.c Wed Nov 28 16:08:39 2007 +0200 +++ b/src/plugins/quota/quota.c Wed Nov 28 16:45:25 2007 +0200 @@ -586,6 +586,11 @@ /* find the lowest quota limits from all roots and use them */ roots = array_get(&ctx->quota->roots, &count); for (i = 0; i < count; i++) { + if (roots[i]->no_enforcing) { + /* we don't care what the current quota is */ + continue; + } + ret = quota_get_resource(roots[i], mailbox_name, QUOTA_NAME_STORAGE_BYTES, ¤t, &limit);