MESSAGE quota resource implemention

Greg Banks gnb at fastmail.fm
Fri Sep 9 08:18:52 EDT 2011


On 08/09/11 00:45, Julien Coloos wrote:
> Le 06/09/2011 10:23, Greg Banks a écrit :
>>
>
>>
>> ...
>>
>> I'm still not convinced we'll need quota.sets[], but I'll play along.
>>
>> Thanks again for your work, and sorry that my annotate branch wasn't
>> quite as stable a base as you first thought :)
> So, I saved my current branch to 'quotamessage-0/gnb/annotate' and
> rebased my patches on current 'annotate' branch (with less racy 'quota
> -f').
> I removed everything related to recomputing from my patches (as well as
> quota.sets[]).
> 
> What is missing now is the new index field, which value will be used in
> mailbox_get_usage function. Since my changes do rely on this function,
> and sometimes computes a delta compared to a previous call of that
> function, it may not need to be updated afterwards ... I hope.

Ok, here you go.  Not completely tested yet, so caveat emptor.

The following changes since commit af8d5bd3b40c4cb49fb7c943c85cb0aeab209215:

  Make quota -f less racy. (2011-09-06 15:53:49 +1000)

are available in the git repository at:
  ssh://git@github.com/gnb/cyrus-imapd.git annotate

Greg Banks (9):
      Fix compile warning in cmd_setquota
      append_setup() et al take an array of quota diffs
      unit: restore simplicity to quota TESTCASE macro
      annotate: kill annotate_state_write_{start,finish}
      annotate: _delete and _msg_copy take mailbox*
      annotate: use mailbox* instead of name in API
      Fix annotation memory leak in sync_server
      annotate: track quota in mailbox header
      annotate: woops, forgot this hunk

Julien Coloos (5):
      Added quota MESSAGE resource (RFC 2087) management.
      List and compute all set quota resources.
      Do not mess with mailbox index struct fields upon deleting.
      When tracking quota usage changes, check all resources.     Added
helper function to get messages current usage from mailbox struct.
      Handle quota resources other than STORAGE in DUMP/UNDUMP.     Also
fix protocol breaking upon dumping annotations.

 cunit/annotate.c     |   84 +++++----
 cunit/quota.c        |   72 +++++--
 imap/annotate.c      |  507
++++++++++++++++++++++++--------------------------
 imap/annotate.h      |   19 ++-
 imap/append.c        |   30 ++-
 imap/append.h        |    6 +-
 imap/cyr_virusscan.c |    2 +-
 imap/imap_err.et     |    2 +-
 imap/imapd.c         |  219 ++++++++++++++++-------
 imap/index.c         |    7 +-
 imap/lmtpd.c         |   33 +++-
 imap/lmtpengine.c    |    7 +-
 imap/lmtpengine.h    |    4 +-
 imap/mailbox.c       |  104 ++++++++---
 imap/mailbox.h       |   12 +-
 imap/mbdump.c        |  146 ++++++++++++---
 imap/mboxlist.c      |   31 ++--
 imap/nntpd.c         |    4 +-
 imap/quota.c         |   94 +++++++---
 imap/quota.h         |   18 ++-
 imap/quota_db.c      |   36 +++-
 imap/smmapd.c        |   15 +-
 imap/sync_client.c   |    4 +-
 imap/sync_server.c   |   19 ++-
 imap/sync_support.c  |    6 -
 lib/imapoptions      |   11 +-
 26 files changed, 933 insertions(+), 559 deletions(-)



> Then maybe some of the cassandane tests I pushed on our repository would
> need to be refreshed (at least the one that checks what happens for
> legacy mailboxes on which we add one of the newly handled quota resources).
> 


That's next week's focus I think.

-- 
Greg.


More information about the Cyrus-devel mailing list