[dovecot-cvs] dovecot/src/lib file-cache.c, 1.19, 1.20 file-cache.h, 1.5, 1.6
tss at dovecot.org
tss at dovecot.org
Fri Feb 16 10:53:46 UTC 2007
Update of /var/lib/cvs/dovecot/src/lib
In directory talvi:/tmp/cvs-serv1230
Modified Files:
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.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- file-cache.c 4 Jan 2007 14:04:13 -0000 1.19
+++ file-cache.c 16 Feb 2007 10:53:43 -0000 1.20
@@ -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.6
diff -u -d -r1.5 -r1.6
--- file-cache.h 14 Jan 2006 18:47:22 -0000 1.5
+++ file-cache.h 16 Feb 2007 10:53:43 -0000 1.6
@@ -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