[dovecot-cvs] dovecot/src/lib-index mail-cache-private.h, 1.36, 1.37 mail-cache.c, 1.90, 1.91

tss at dovecot.org tss at dovecot.org
Wed Dec 20 06:20:28 UTC 2006


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

Modified Files:
	mail-cache-private.h mail-cache.c 
Log Message:
Prefix COMPRESS_* defines with MAIL_CACHE_.



Index: mail-cache-private.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-cache-private.h,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- mail-cache-private.h	15 Dec 2006 18:10:54 -0000	1.36
+++ mail-cache-private.h	20 Dec 2006 06:20:25 -0000	1.37
@@ -8,17 +8,17 @@
 #define MAIL_CACHE_VERSION 1
 
 /* Never compress the file if it's smaller than this */
-#define COMPRESS_MIN_SIZE (1024*50)
+#define MAIL_CACHE_COMPRESS_MIN_SIZE (1024*50)
 
 /* Don't bother remembering holes smaller than this */
 #define MAIL_CACHE_MIN_HOLE_SIZE 1024
 
 /* Compress the file when deleted space reaches n% of total size */
-#define COMPRESS_PERCENTAGE 20
+#define MAIL_CACHE_COMPRESS_PERCENTAGE 20
 
 /* Compress the file when n% of rows contain continued rows.
    200% means that there's 2 continued rows per record. */
-#define COMPRESS_CONTINUED_PERCENTAGE 200
+#define MAIL_CACHE_COMPRESS_CONTINUED_PERCENTAGE 200
 
 /* Initial size for the file */
 #define MAIL_CACHE_INITIAL_SIZE (sizeof(struct mail_cache_header) + 10240)

Index: mail-cache.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-cache.c,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -d -r1.90 -r1.91
--- mail-cache.c	15 Dec 2006 16:55:40 -0000	1.90
+++ mail-cache.c	20 Dec 2006 06:20:26 -0000	1.91
@@ -475,16 +475,17 @@
         cont_percentage = hdr->continued_record_count * 100 /
 		(cache->index->map->records_count == 0 ? 1 :
 		 cache->index->map->records_count);
-	if (cont_percentage >= COMPRESS_CONTINUED_PERCENTAGE &&
-	    hdr->used_file_size >= COMPRESS_MIN_SIZE) {
+	if (cont_percentage >= MAIL_CACHE_COMPRESS_CONTINUED_PERCENTAGE &&
+	    hdr->used_file_size >= MAIL_CACHE_COMPRESS_MIN_SIZE) {
 		/* too many continued rows, compress */
 		cache->need_compress_file_seq = hdr->file_seq;
 	}
 
 	/* see if we've reached the max. deleted space in file */
-	max_del_space = hdr->used_file_size / 100 * COMPRESS_PERCENTAGE;
+	max_del_space = hdr->used_file_size / 100 *
+		MAIL_CACHE_COMPRESS_PERCENTAGE;
 	if (hdr->deleted_space >= max_del_space &&
-	    hdr->used_file_size >= COMPRESS_MIN_SIZE)
+	    hdr->used_file_size >= MAIL_CACHE_COMPRESS_MIN_SIZE)
 		cache->need_compress_file_seq = hdr->file_seq;
 }
 



More information about the dovecot-cvs mailing list