[dovecot-cvs] dovecot/src/lib file-cache.c, 1.12.2.7, 1.12.2.8 file-cache.h, 1.5, 1.5.2.1

tss at dovecot.org tss at dovecot.org
Fri Feb 16 10:53:43 UTC 2007


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

Modified Files:
      Tag: branch_1_0
	file-cache.c file-cache.h 
Log Message:
Made file_cache_set_size() public.



Index: file-cache.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/file-cache.c,v
retrieving revision 1.12.2.7
retrieving revision 1.12.2.8
diff -u -d -r1.12.2.7 -r1.12.2.8
--- file-cache.c	4 Jan 2007 14:04:10 -0000	1.12.2.7
+++ file-cache.c	16 Feb 2007 10:53:41 -0000	1.12.2.8
@@ -46,7 +46,7 @@
 	file_cache_invalidate(cache, 0, cache->mmap_length);
 }
 
-static int file_cache_set_size(struct file_cache *cache, uoff_t size)
+int file_cache_set_size(struct file_cache *cache, uoff_t size)
 {
 	size_t page_size = mmap_get_page_size();
 	uoff_t diff = size % page_size;

Index: file-cache.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/file-cache.h,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -u -d -r1.5 -r1.5.2.1
--- file-cache.h	14 Jan 2006 18:47:22 -0000	1.5
+++ file-cache.h	16 Feb 2007 10:53:41 -0000	1.5.2.1
@@ -10,6 +10,11 @@
 /* Change cached file descriptor. Invalidates the whole cache. */
 void file_cache_set_fd(struct file_cache *cache, int fd);
 
+/* Change the memory allocated for the cache. This can be used to immediately
+   set the maximum size so there's no need to grow the memory area with
+   possibly slow copying. */
+int file_cache_set_size(struct file_cache *cache, uoff_t size);
+
 /* Read data from file, returns how many bytes was actually read or -1 if
    error occurred. */
 ssize_t file_cache_read(struct file_cache *cache, uoff_t offset, size_t size);



More information about the dovecot-cvs mailing list