[dovecot-cvs] dovecot: If we're using posix_fallocate(), make it allocate only...

dovecot at dovecot.org dovecot at dovecot.org
Tue May 29 20:04:27 EEST 2007


details:   http://hg.dovecot.org/dovecot/rev/052f000ad273
changeset: 5667:052f000ad273
user:      Timo Sirainen <tss at iki.fi>
date:      Tue May 29 20:04:22 2007 +0300
description:
If we're using posix_fallocate(), make it allocate only from EOF to where we
want, instead of from the beginning of the file which tries to look for
holes inside the file.

diffstat:

1 file changed, 1 insertion(+), 1 deletion(-)
src/lib/file-set-size.c |    2 +-

diffs (12 lines):

diff -r a0e59849a03d -r 052f000ad273 src/lib/file-set-size.c
--- a/src/lib/file-set-size.c	Tue May 29 00:22:56 2007 +0300
+++ b/src/lib/file-set-size.c	Tue May 29 20:04:22 2007 +0300
@@ -28,7 +28,7 @@ int file_set_size(int fd, off_t size)
 		return 0;
 
 #ifdef HAVE_POSIX_FALLOCATE
-	return posix_fallocate(fd, 0, size);
+	return posix_fallocate(fd, st.st_size, size - st.st_size);
 #else
 	/* start growing the file */
 	offset = st.st_size;


More information about the dovecot-cvs mailing list