[dovecot-cvs] dovecot/src/lib-index/mbox mbox-index.c,1.45,1.46

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


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

Modified Files:
	mbox-index.c 
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: mbox-index.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-index/mbox/mbox-index.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- mbox-index.c	20 Nov 2002 17:06:46 -0000	1.45
+++ mbox-index.c	21 Nov 2002 20:31:03 -0000	1.46
@@ -71,9 +71,19 @@
 	}
 
 	if (index->mbox_inbuf == NULL) {
-		index->mbox_inbuf =
-			i_buffer_create_mmap(index->mbox_fd, default_pool,
-					     MAIL_MMAP_BLOCK_SIZE, 0, 0, FALSE);
+		if (index->mail_read_mmaped) {
+			index->mbox_inbuf =
+				i_buffer_create_mmap(index->mbox_fd,
+						     default_pool,
+						     MAIL_MMAP_BLOCK_SIZE,
+						     0, 0, FALSE);
+		} else {
+			index->mbox_inbuf =
+				i_buffer_create_file(index->mbox_fd,
+						     default_pool,
+						     MAIL_READ_BLOCK_SIZE,
+						     FALSE);
+		}
 	}
 
 	i_buffer_set_read_limit(index->mbox_inbuf, 0);




More information about the dovecot-cvs mailing list