[dovecot-cvs] dovecot/src/lib-storage/index index-storage.c, 1.95, 1.96 index-storage.h, 1.109, 1.110

tss at dovecot.org tss at dovecot.org
Sun Dec 17 16:35:34 UTC 2006


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

Modified Files:
	index-storage.c index-storage.h 
Log Message:
Added fsync_disable setting. Also added missing fsync()ing to dbox when
saving mails.



Index: index-storage.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/index-storage.c,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -d -r1.95 -r1.96
--- index-storage.c	10 Dec 2006 13:00:44 -0000	1.95
+++ index-storage.c	17 Dec 2006 16:35:32 -0000	1.96
@@ -318,12 +318,18 @@
 void index_storage_mailbox_open(struct index_mailbox *ibox)
 {
 	struct mail_storage *storage = &ibox->storage->storage;
-	enum mail_index_open_flags index_flags;
+	enum mail_index_open_flags index_flags = 0;
 	int ret;
 
 	i_assert(!ibox->box.opened);
 
-	index_flags = ibox->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 (ibox->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.109
retrieving revision 1.110
diff -u -d -r1.109 -r1.110
--- index-storage.h	10 Dec 2006 13:00:44 -0000	1.109
+++ index-storage.h	17 Dec 2006 16:35:32 -0000	1.110
@@ -77,6 +77,7 @@
 	unsigned int notify_pending:1;
 	unsigned int mail_read_mmaped:1;
 	unsigned int move_to_memory:1;
+	unsigned int fsync_disable:1;
 };
 
 struct index_transaction_context {



More information about the dovecot-cvs mailing list