From: Timo Sirainen Date: Tue, 14 Apr 2009 00:06:40 +0000 (-0400) Subject: Changed MAILBOX_OPEN_FAST meaning a bit. Don't use it where it's unnecessary. X-Git-Tag: 2.0.alpha1~951 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a341c4cdbd4b93ba479f465ad3f569dc82f57312;p=thirdparty%2Fdovecot%2Fcore.git Changed MAILBOX_OPEN_FAST meaning a bit. Don't use it where it's unnecessary. --HG-- branch : HEAD --- diff --git a/src/imap/cmd-append.c b/src/imap/cmd-append.c index 9af5752630..2b27608fe1 100644 --- a/src/imap/cmd-append.c +++ b/src/imap/cmd-append.c @@ -461,7 +461,7 @@ get_mailbox(struct client_command_context *cmd, const char *name) return cmd->client->mailbox; box = mailbox_open(&storage, name, NULL, MAILBOX_OPEN_SAVEONLY | - MAILBOX_OPEN_FAST | MAILBOX_OPEN_KEEP_RECENT); + MAILBOX_OPEN_KEEP_RECENT); if (box == NULL) { client_send_storage_error(cmd, storage); return NULL; diff --git a/src/imap/cmd-copy.c b/src/imap/cmd-copy.c index 97882cbccf..3f0c8f8910 100644 --- a/src/imap/cmd-copy.c +++ b/src/imap/cmd-copy.c @@ -128,7 +128,6 @@ bool cmd_copy(struct client_command_context *cmd) else { destbox = mailbox_open(&storage, mailbox, NULL, MAILBOX_OPEN_SAVEONLY | - MAILBOX_OPEN_FAST | MAILBOX_OPEN_KEEP_RECENT); if (destbox == NULL) { client_send_storage_error(cmd, storage); diff --git a/src/lib-lda/mail-deliver.c b/src/lib-lda/mail-deliver.c index 89874ee800..e431be3677 100644 --- a/src/lib-lda/mail-deliver.c +++ b/src/lib-lda/mail-deliver.c @@ -78,7 +78,7 @@ mailbox_open_or_create_synced(struct mail_deliver_context *ctx, struct mail_namespace *ns; struct mailbox *box; enum mail_error error; - enum mailbox_open_flags open_flags = MAILBOX_OPEN_FAST | + enum mailbox_open_flags open_flags = MAILBOX_OPEN_KEEP_RECENT | MAILBOX_OPEN_SAVEONLY | MAILBOX_OPEN_POST_SESSION; diff --git a/src/lib-storage/index/index-status.c b/src/lib-storage/index/index-status.c index 52190696dc..4adf23e3b0 100644 --- a/src/lib-storage/index/index-status.c +++ b/src/lib-storage/index/index-status.c @@ -11,8 +11,7 @@ void index_storage_get_status(struct mailbox *box, struct index_mailbox *ibox = (struct index_mailbox *)box; const struct mail_index_header *hdr; - if (!box->opened) - index_storage_mailbox_open(ibox); + i_assert(box->opened); memset(status_r, 0, sizeof(struct mailbox_status)); diff --git a/src/lib-storage/index/index-transaction.c b/src/lib-storage/index/index-transaction.c index 08371c72d7..d9ed0da9b2 100644 --- a/src/lib-storage/index/index-transaction.c +++ b/src/lib-storage/index/index-transaction.c @@ -66,8 +66,7 @@ index_transaction_begin(struct mailbox *box, struct index_transaction_context *it; enum mail_index_transaction_flags trans_flags; - if (!box->opened) - index_storage_mailbox_open(ibox); + i_assert(box->opened); trans_flags = MAIL_INDEX_TRANSACTION_FLAG_AVOID_FLAG_UPDATES; if ((flags & MAILBOX_TRANSACTION_FLAG_HIDE) != 0) diff --git a/src/lib-storage/mail-storage.h b/src/lib-storage/mail-storage.h index 06b662d22c..8f84f7c320 100644 --- a/src/lib-storage/mail-storage.h +++ b/src/lib-storage/mail-storage.h @@ -28,8 +28,8 @@ enum mailbox_open_flags { MAILBOX_OPEN_READONLY = 0x01, /* Only saving/copying mails to mailbox works. */ MAILBOX_OPEN_SAVEONLY = 0x02, - /* Any extra time consuming operations shouldn't be performed - (eg. when opening mailbox just for STATUS). */ + /* Delay opening index files (and possibly other files) until mailbox + is being synchronized. */ MAILBOX_OPEN_FAST = 0x04, /* Don't reset MAIL_RECENT flags when syncing */ MAILBOX_OPEN_KEEP_RECENT = 0x08, diff --git a/src/plugins/quota/quota-storage.c b/src/plugins/quota/quota-storage.c index 8c21916433..1297d25c85 100644 --- a/src/plugins/quota/quota-storage.c +++ b/src/plugins/quota/quota-storage.c @@ -434,8 +434,8 @@ quota_mailbox_list_delete(struct mailbox_list *list, const char *name) mailbox locked so that other processes can't mess up the quota calculations by adding/removing mails while we're doing this. */ storage = qlist->storage; - box = mailbox_open(&storage, name, NULL, MAILBOX_OPEN_FAST | - MAILBOX_OPEN_KEEP_RECENT | MAILBOX_OPEN_KEEP_LOCKED); + box = mailbox_open(&storage, name, NULL, MAILBOX_OPEN_KEEP_RECENT | + MAILBOX_OPEN_KEEP_LOCKED); if (box == NULL) { str = mail_storage_get_last_error(qlist->storage, &error); if (error != MAIL_ERROR_NOTPOSSIBLE) {