[dovecot-cvs] dovecot/src/lib-storage/index/dbox dbox-storage.c, 1.23, 1.24 dbox-sync.c, 1.23, 1.24 dbox-transaction.c, 1.4, 1.5

tss at dovecot.org tss at dovecot.org
Sat Nov 25 22:17:44 UTC 2006


Update of /var/lib/cvs/dovecot/src/lib-storage/index/dbox
In directory talvi:/tmp/cvs-serv28938/lib-storage/index/dbox

Modified Files:
	dbox-storage.c dbox-sync.c dbox-transaction.c 
Log Message:
Mailbox list indexing and related changes. Currently works only with
maildir and mmap_disable=no. This allows doing STATUS to synced mailboxes
without opening their index files at all.



Index: dbox-storage.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/dbox/dbox-storage.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- dbox-storage.c	16 Nov 2006 00:16:33 -0000	1.23
+++ dbox-storage.c	25 Nov 2006 22:17:42 -0000	1.24
@@ -93,6 +93,8 @@
 
 	if (dbox_get_list_settings(&list_set, data, flags) < 0)
 		return NULL;
+	list_set.mail_storage_flags = &flags;
+	list_set.mail_storage_lock_method = &lock_method;
 
 	if (mkdir_parents(list_set.root_dir, CREATE_MODE) < 0 &&
 	    errno != EEXIST) {

Index: dbox-sync.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/dbox/dbox-sync.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- dbox-sync.c	10 Sep 2006 12:48:26 -0000	1.23
+++ dbox-sync.c	25 Nov 2006 22:17:42 -0000	1.24
@@ -593,6 +593,11 @@
 	struct dbox_mailbox *mbox = (struct dbox_mailbox *)box;
 	int ret = 0;
 
+	if (!box->opened) {
+		if (index_storage_mailbox_open(&mbox->ibox) < 0)
+			return index_mailbox_sync_init(box, 0, TRUE);
+	}
+
 	if ((flags & MAILBOX_SYNC_FLAG_FAST) == 0 ||
 	    mbox->ibox.sync_last_check + MAILBOX_FULL_SYNC_INTERVAL <=
 	    ioloop_time)

Index: dbox-transaction.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/dbox/dbox-transaction.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- dbox-transaction.c	15 Oct 2006 12:59:45 -0000	1.4
+++ dbox-transaction.c	25 Nov 2006 22:17:42 -0000	1.5
@@ -66,7 +66,8 @@
 {
 	struct mailbox *box = MAIL_STORAGE_INDEX(t->view->index);
 
-	if (strcmp(box->storage->name, DBOX_STORAGE_NAME) == 0) {
+	/* index can be for mailbox list index, in which case box=NULL */
+	if (box != NULL && strcmp(box->storage->name, DBOX_STORAGE_NAME) == 0) {
 		struct dbox_mailbox *dbox = (struct dbox_mailbox *)box;
 		struct dbox_transaction_context *mt;
 



More information about the dovecot-cvs mailing list