g_file_set_contents(): use posix_fallocate()

Extents-based filesystems like knowing in advance how much data will be
written to a file in order to prevent fragmentation.  If we have it, use
posix_fallocate() before writing data in g_file_set_contents().

https://bugzilla.gnome.org/show_bug.cgi?id=701560
This commit is contained in:
Ryan Lortie
2013-06-03 15:43:01 -04:00
parent b935059738
commit d3be43fcc5
2 changed files with 8 additions and 1 deletions

View File

@@ -1056,7 +1056,7 @@ AC_MSG_RESULT($glib_ssize_type)
# Check for some functions
AC_CHECK_FUNCS(lstat strerror strsignal memmove vsnprintf stpcpy strcasecmp strncasecmp poll getcwd vasprintf setenv unsetenv getc_unlocked readlink symlink fdwalk memmem)
AC_CHECK_FUNCS(chown lchmod lchown fchmod fchown link utimes getgrgid getpwuid getresuid)
AC_CHECK_FUNCS(getmntent_r setmntent endmntent hasmntopt getfsstat getvfsstat)
AC_CHECK_FUNCS(getmntent_r setmntent endmntent hasmntopt getfsstat getvfsstat posix_fallocate)
# Check for high-resolution sleep functions
AC_CHECK_FUNCS(splice)
AC_CHECK_FUNCS(prlimit)