[dovecot-cvs] dovecot/src/lib-storage/index index-storage.c,1.34,1.35 index-storage.h,1.39,1.40

cras at procontrol.fi cras at procontrol.fi
Tue Jul 15 22:26:45 EEST 2003


Update of /home/cvs/dovecot/src/lib-storage/index
In directory danu:/tmp/cvs-serv10641/src/lib-storage/index

Modified Files:
	index-storage.c index-storage.h 
Log Message:
index_mmap_invalidate = yes now invalidate memory maps before accessing
them. Setting this on should fix some problems with OpenBSD. It should also
make it possible to use index files over NFS as long as lock daemon is used.
It might be such a good idea however.



Index: index-storage.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/index-storage.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- index-storage.c	6 Jul 2003 22:55:22 -0000	1.34
+++ index-storage.c	15 Jul 2003 18:26:43 -0000	1.35
@@ -299,20 +299,28 @@
 struct index_mailbox *
 index_storage_mailbox_init(struct mail_storage *storage, struct mailbox *box,
 			   struct mail_index *index, const char *name,
-			   int readonly, int fast)
+			   enum mailbox_open_flags flags)
 {
 	struct index_mailbox *ibox;
-	enum mail_index_open_flags flags;
+	enum mail_index_open_flags index_flags;
 
 	i_assert(name != NULL);
 
+	index_flags = MAIL_INDEX_OPEN_FLAG_CREATE;
+	if ((flags & MAILBOX_OPEN_FAST) != 0)
+		index_flags |= MAIL_INDEX_OPEN_FLAG_FAST;
+	if ((flags & MAILBOX_OPEN_READONLY) != 0)
+		index_flags |= MAIL_INDEX_OPEN_FLAG_UPDATE_RECENT;
+	if ((flags & MAILBOX_OPEN_MMAP_INVALIDATE) != 0)
+		index_flags |= MAIL_INDEX_OPEN_FLAG_MMAP_INVALIDATE;
+
 	do {
 		ibox = i_new(struct index_mailbox, 1);
 		ibox->box = *box;
 
 		ibox->box.storage = storage;
 		ibox->box.name = i_strdup(name);
-		ibox->box.readonly = readonly;
+		ibox->box.readonly = (flags & MAILBOX_OPEN_READONLY) != 0;
 
 		ibox->index = index;
 
@@ -326,13 +334,7 @@
 			index->never_cache_fields =
 				get_never_cache_fields();
 
-			flags = MAIL_INDEX_OPEN_FLAG_CREATE;
-			if (fast)
-				flags |= MAIL_INDEX_OPEN_FLAG_FAST;
-			if (!readonly)
-				flags |= MAIL_INDEX_OPEN_FLAG_UPDATE_RECENT;
-
-			if (!index->open(index, flags))
+			if (!index->open(index, index_flags))
 				break;
 
 			if (INDEX_IS_IN_MEMORY(index) &&

Index: index-storage.h
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/index-storage.h,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- index-storage.h	6 Jul 2003 22:55:22 -0000	1.39
+++ index-storage.h	15 Jul 2003 18:26:43 -0000	1.40
@@ -52,7 +52,7 @@
 struct index_mailbox *
 index_storage_mailbox_init(struct mail_storage *storage, struct mailbox *box,
 			   struct mail_index *index, const char *name,
-			   int readonly, int fast);
+			   enum mailbox_open_flags flags);
 int index_storage_mailbox_free(struct mailbox *box);
 
 int index_storage_sync_and_lock(struct index_mailbox *ibox,



More information about the dovecot-cvs mailing list