diff src/lib-storage/list/mailbox-list-index-notify.c @ 15167:0fa075f2e85a

lib-storage: Added initial implementation for layout=index. The idea is that all of the mailbox names only exist in the mailbox list index. Storage directories use mailbox GUIDs. This avoids all kinds of race conditions with mailbox renames. mailbox_list_index=yes is required for this layout to work. There are probably still some race conditions within the indexing code itself. Also error recovery is missing.
author Timo Sirainen <tss@iki.fi>
date Fri, 28 Sep 2012 00:11:19 +0300
parents fcd480c4a0db
children 90710c6c3beb
line wrap: on
line diff
--- a/src/lib-storage/list/mailbox-list-index-notify.c	Fri Sep 28 00:03:12 2012 +0300
+++ b/src/lib-storage/list/mailbox-list-index-notify.c	Fri Sep 28 00:11:19 2012 +0300
@@ -149,7 +149,8 @@
 	if (index_node == NULL) {
 		/* re-parse the index list using the given view. we could be
 		   jumping here between old and new view. */
-		(void)mailbox_list_index_parse(ilist, view, FALSE);
+		(void)mailbox_list_index_parse(inotify->notify.list,
+					       view, FALSE);
 		index_node = mailbox_list_index_lookup_uid(ilist, uid);
 		if (index_node == NULL)
 			return NULL;
@@ -355,8 +356,6 @@
 static void
 mailbox_list_index_notify_find_renames(struct mailbox_list_notify_index *inotify)
 {
-	struct mailbox_list_index *ilist =
-		INDEX_LIST_CONTEXT(inotify->notify.list);
 	ARRAY(struct mailbox_list_inotify_entry) entries;
 	struct mailbox_status status;
 	struct mailbox_list_notify_rename *rename;
@@ -381,7 +380,8 @@
 		}
 	}
 
-	(void)mailbox_list_index_parse(ilist, inotify->view, TRUE);
+	(void)mailbox_list_index_parse(inotify->notify.list,
+				       inotify->view, TRUE);
 	while (seq_range_array_iter_nth(&inotify->new_uids_iter,
 					inotify->new_uids_n++, &uid)) {
 		if (notify_lookup_guid(inotify, inotify->view, uid,