aboutsummaryrefslogtreecommitdiffstats
path: root/src/kvstorage_file.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-12-14 19:34:50 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-12-14 19:34:50 +0300
commit44311f4235463a8d4d3c4128242bbd7c9d2a203b (patch)
tree61cf649234696840338a76e6c83a8d5b8f45460f /src/kvstorage_file.c
parent4499fc92189905fde71139822d784ab7819b181c (diff)
downloadrspamd-44311f4235463a8d4d3c4128242bbd7c9d2a203b.tar.gz
rspamd-44311f4235463a8d4d3c4128242bbd7c9d2a203b.zip
Detect and use fallocate/posix_fallocate.
Diffstat (limited to 'src/kvstorage_file.c')
-rw-r--r--src/kvstorage_file.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/kvstorage_file.c b/src/kvstorage_file.c
index 154ccf279..73e5a8a88 100644
--- a/src/kvstorage_file.c
+++ b/src/kvstorage_file.c
@@ -142,6 +142,7 @@ file_open_fd (const gchar *path, gsize *len, gint flags)
if ((flags & O_CREAT) != 0) {
/* Open file */
if ((fd = open (path, flags, S_IRUSR|S_IWUSR|S_IRGRP)) != -1) {
+ rspamd_fallocate (fd, 0, *len);
#ifdef HAVE_FADVISE
posix_fadvise (fd, 0, *len, POSIX_FADV_SEQUENTIAL);
#endif