mirror of
https://github.com/transmission/transmission
synced 2024-12-25 09:13:06 +00:00
(trunk libT) on platforms that support it, use POSIX_FADV_SEQUENTIAL instead of POSIX_FADV_RANDOM. (http://trac.transmissionbt.com/ticket/1521#comment:25)
This commit is contained in:
parent
04fb0919eb
commit
ea93eab02d
1 changed files with 3 additions and 3 deletions
|
@ -320,8 +320,8 @@ TrOpenFile( int i,
|
||||||
|
|
||||||
/* open the file */
|
/* open the file */
|
||||||
flags = doWrite ? ( O_RDWR | O_CREAT ) : O_RDONLY;
|
flags = doWrite ? ( O_RDWR | O_CREAT ) : O_RDONLY;
|
||||||
#ifdef O_RANDOM
|
#ifdef O_SEQUENTIAL
|
||||||
flags |= O_RANDOM
|
flags |= O_SEQUENTIAL;
|
||||||
#endif
|
#endif
|
||||||
#ifdef O_LARGEFILE
|
#ifdef O_LARGEFILE
|
||||||
flags |= O_LARGEFILE;
|
flags |= O_LARGEFILE;
|
||||||
|
@ -342,7 +342,7 @@ TrOpenFile( int i,
|
||||||
preallocateFileSparse( file->fd, desiredFileSize );
|
preallocateFileSparse( file->fd, desiredFileSize );
|
||||||
|
|
||||||
#ifdef HAVE_POSIX_FADVISE
|
#ifdef HAVE_POSIX_FADVISE
|
||||||
posix_fadvise( file->fd, 0, 0, POSIX_FADV_RANDOM );
|
posix_fadvise( file->fd, 0, 0, POSIX_FADV_SEQUENTIAL );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
tr_free( filename );
|
tr_free( filename );
|
||||||
|
|
Loading…
Reference in a new issue