Changeset 10075


Ignore:
Timestamp:
Feb 2, 2010, 3:01:25 AM (13 years ago)
Author:
charles
Message:

(trunk libT) #2849 "When possible, use fallocate64() for file preallocation" -- implemented for 1.90

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.ac

    r10046 r10075  
    9494AC_HEADER_TIME
    9595
    96 AC_CHECK_FUNCS([pread pwrite lrintf strlcpy daemon dirname basename strcasecmp localtime_r posix_fallocate memmem strtold syslog])
     96AC_CHECK_FUNCS([pread pwrite lrintf strlcpy daemon dirname basename strcasecmp localtime_r fallocate64 posix_fallocate memmem strtold syslog])
    9797AC_PROG_INSTALL
    9898AC_PROG_MAKE_SET
  • trunk/libtransmission/fdlimit.c

    r10031 r10075  
    4444#endif
    4545
     46#ifdef HAVE_FALLOCATE64
     47  /* FIXME can't find the right #include voodoo to pick up the declaration.. */
     48  extern int fallocate64( int fd, int mode, uint64_t offset, uint64_t len );
     49#endif
     50
    4651#ifdef HAVE_XFS_XFS_H
    4752 #include <xfs/xfs.h>
     
    147152    if( fd >= 0 )
    148153    {
     154# ifdef HAVE_FALLOCATE64
     155       if( !success )
     156       {
     157           success = !fallocate64( fd, 0, 0, length );
     158       }
     159# endif
    149160# ifdef HAVE_XFS_XFS_H
    150161        if( !success && platform_test_xfs_fd( fd ) )
  • trunk/libtransmission/session.c

    r10045 r10075  
    297297    tr_bencDictAddBool( d, TR_PREFS_KEY_PEX_ENABLED,              TRUE );
    298298    tr_bencDictAddBool( d, TR_PREFS_KEY_PORT_FORWARDING,          TRUE );
     299#ifdef HAVE_FALLOCATE64
     300    tr_bencDictAddInt ( d, TR_PREFS_KEY_PREALLOCATION,            TR_PREALLOCATE_FULL );
     301#else
    299302    tr_bencDictAddInt ( d, TR_PREFS_KEY_PREALLOCATION,            TR_PREALLOCATE_SPARSE );
     303#endif
    300304    tr_bencDictAddStr ( d, TR_PREFS_KEY_PROXY,                    "" );
    301305    tr_bencDictAddBool( d, TR_PREFS_KEY_PROXY_AUTH_ENABLED,       FALSE );
Note: See TracChangeset for help on using the changeset viewer.