[dovecot-cvs] dovecot/src/lib-index mail-index-open.c,1.16,1.17 mail-index.h,1.52,1.53

cras at procontrol.fi cras at procontrol.fi
Thu Nov 21 22:31:05 EET 2002


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

Modified Files:
	mail-index-open.c mail-index.h 
Log Message:
mail_read_mmaped: Use mmap() instead of read() to read mail files. read()
seems to be a bit faster with my Linux/x86 and it's better with NFS, so
that's the default.



Index: mail-index-open.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-index/mail-index-open.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- mail-index-open.c	13 Nov 2002 00:43:14 -0000	1.16
+++ mail-index-open.c	21 Nov 2002 20:31:03 -0000	1.17
@@ -150,6 +150,7 @@
 			return FALSE;
 	}
 
+	index->mail_read_mmaped = getenv("MAIL_READ_MMAPED") != NULL;
 	return TRUE;
 }
 

Index: mail-index.h
===================================================================
RCS file: /home/cvs/dovecot/src/lib-index/mail-index.h,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -d -r1.52 -r1.53
--- mail-index.h	21 Nov 2002 20:13:32 -0000	1.52
+++ mail-index.h	21 Nov 2002 20:31:03 -0000	1.53
@@ -366,6 +366,7 @@
 
 	unsigned int anon_mmap:1;
 	unsigned int opened:1;
+	unsigned int mail_read_mmaped:1;
 	unsigned int inconsistent:1;
 	unsigned int nodiskspace:1;
 };
@@ -376,7 +377,7 @@
 	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
 	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
 	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
-	0, 0, 0, 0, 0, 0
+	0, 0, 0, 0, 0, 0, 0
 
 /* defaults - same as above but prefixed with mail_index_. */
 int mail_index_open(MailIndex *index, int update_recent, int fast);
@@ -433,6 +434,8 @@
 
 /* Max. mmap()ed size for a message */
 #define MAIL_MMAP_BLOCK_SIZE (1024*256)
+/* Block size when read()ing message. */
+#define MAIL_READ_BLOCK_SIZE (1024*8)
 
 /* Delete unused non-local temp files after 24h. Just to be sure we don't
    delete it too early. The temp files don't harm much anyway. */




More information about the dovecot-cvs mailing list