mirror of
https://github.com/transmission/transmission
synced 2024-12-25 01:03:01 +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 */
|
||||
flags = doWrite ? ( O_RDWR | O_CREAT ) : O_RDONLY;
|
||||
#ifdef O_RANDOM
|
||||
flags |= O_RANDOM
|
||||
#ifdef O_SEQUENTIAL
|
||||
flags |= O_SEQUENTIAL;
|
||||
#endif
|
||||
#ifdef O_LARGEFILE
|
||||
flags |= O_LARGEFILE;
|
||||
|
@ -342,7 +342,7 @@ TrOpenFile( int i,
|
|||
preallocateFileSparse( file->fd, desiredFileSize );
|
||||
|
||||
#ifdef HAVE_POSIX_FADVISE
|
||||
posix_fadvise( file->fd, 0, 0, POSIX_FADV_RANDOM );
|
||||
posix_fadvise( file->fd, 0, 0, POSIX_FADV_SEQUENTIAL );
|
||||
#endif
|
||||
|
||||
tr_free( filename );
|
||||
|
|
Loading…
Reference in a new issue