[dovecot-cvs] dovecot/src/lib-storage/index index-storage.c, 1.85.2.7, 1.85.2.8 index-storage.h, 1.101.2.2, 1.101.2.3

tss at dovecot.org tss at dovecot.org
Sat Mar 10 22:58:44 EET 2007


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

Modified Files:
      Tag: branch_1_0
	index-storage.c index-storage.h 
Log Message:
Added fsync_disable setting.



Index: index-storage.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/index-storage.c,v
retrieving revision 1.85.2.7
retrieving revision 1.85.2.8
diff -u -d -r1.85.2.7 -r1.85.2.8
--- index-storage.c	6 Mar 2007 19:54:20 -0000	1.85.2.7
+++ index-storage.c	10 Mar 2007 20:58:42 -0000	1.85.2.8
@@ -314,7 +314,7 @@
 				bool move_to_memory)
 {
 	struct mail_storage *storage = &ibox->storage->storage;
-	enum mail_index_open_flags index_flags;
+	enum mail_index_open_flags index_flags = 0;
 	enum mail_index_lock_method lock_method = 0;
 	int ret;
 
@@ -325,7 +325,13 @@
 	array_create(&ibox->box.module_contexts,
 		     ibox->box.pool, sizeof(void *), 5);
 
-	index_flags = move_to_memory ? 0 : MAIL_INDEX_OPEN_FLAG_CREATE;
+	if (getenv("FSYNC_DISABLE") != NULL) {
+		ibox->fsync_disable = TRUE;
+		index_flags |= MAIL_INDEX_OPEN_FLAG_FSYNC_DISABLE;
+	}
+
+	if (!move_to_memory)
+		index_flags |= MAIL_INDEX_OPEN_FLAG_CREATE;
 	if ((storage->flags & MAIL_STORAGE_FLAG_MMAP_DISABLE) != 0)
 		index_flags |= MAIL_INDEX_OPEN_FLAG_MMAP_DISABLE;
 #ifndef MMAP_CONFLICTS_WRITE

Index: index-storage.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/index-storage.h,v
retrieving revision 1.101.2.2
retrieving revision 1.101.2.3
diff -u -d -r1.101.2.2 -r1.101.2.3
--- index-storage.h	22 Feb 2007 13:37:32 -0000	1.101.2.2
+++ index-storage.h	10 Mar 2007 20:58:42 -0000	1.101.2.3
@@ -81,6 +81,7 @@
 	unsigned int sent_readonly_flags_warning:1;
 	unsigned int notify_pending:1;
 	unsigned int mail_read_mmaped:1;
+	unsigned int fsync_disable:1;
 };
 
 struct index_transaction_context {



More information about the dovecot-cvs mailing list