diff src/lib-index/mail-cache-private.h @ 15313:51f2be9aa8ad

lib-index: Added MAIL_INDEX_OPEN_FLAG_SAVEONLY to do only minimal reads from cache file.
author Timo Sirainen <tss@iki.fi>
date Thu, 18 Oct 2012 05:22:36 +0300
parents 0d1de37ad9d8
children 1b46c1bf9d1e 55e84bb452e6
line wrap: on
line diff
--- a/src/lib-index/mail-cache-private.h	Thu Oct 18 05:16:54 2012 +0300
+++ b/src/lib-index/mail-cache-private.h	Thu Oct 18 05:22:36 2012 +0300
@@ -130,9 +130,14 @@
 	ino_t st_ino;
 	dev_t st_dev;
 
+	size_t mmap_length;
+	/* a) mmaping the whole file */
 	void *mmap_base;
-	size_t mmap_length;
+	/* b) using file cache */
 	struct file_cache *file_cache;
+	/* c) using small read() calls with MAIL_INDEX_OPEN_FLAG_SAVEONLY */
+	uoff_t read_offset;
+	buffer_t *read_buf;
 	/* mail_cache_map() increases this always. */
 	unsigned int remap_counter;
 
@@ -169,6 +174,7 @@
 	unsigned int hdr_modified:1;
 	unsigned int field_header_write_pending:1;
 	unsigned int compressing:1;
+	unsigned int map_with_read:1;
 };
 
 struct mail_cache_loop_track {