From 1c4f37163ca9e96ea84f9f1577830022c27ac60d Mon Sep 17 00:00:00 2001
From: Juliusz Chroboczek <jch@pps.jussieu.fr>
Date: Mon, 9 Nov 2009 07:18:00 +0100
Subject: [PATCH 3/3] Don't force sequential readahead when opening files.
This is no longer necessary now that we have proper prefetching.
---
libtransmission/fdlimit.c | 15 ---------------
1 files changed, 0 insertions(+), 15 deletions(-)
diff --git a/libtransmission/fdlimit.c b/libtransmission/fdlimit.c
index 06ca001..880dd7b 100644
a
|
b
|
TrOpenFile( tr_session * session, |
365 | 365 | |
366 | 366 | /* open the file */ |
367 | 367 | flags = doWrite ? ( O_RDWR | O_CREAT ) : O_RDONLY; |
368 | | #ifdef O_SEQUENTIAL |
369 | | flags |= O_SEQUENTIAL; |
370 | | #endif |
371 | 368 | #ifdef O_LARGEFILE |
372 | 369 | flags |= O_LARGEFILE; |
373 | 370 | #endif |
… |
… |
TrOpenFile( tr_session * session, |
394 | 391 | if( doWrite && !alreadyExisted && ( preallocationMode == TR_PREALLOCATE_SPARSE ) ) |
395 | 392 | preallocateFileSparse( file->fd, desiredFileSize ); |
396 | 393 | |
397 | | #ifdef HAVE_POSIX_FADVISE |
398 | | /* this doubles the OS level readahead buffer, which in practice |
399 | | * turns out to be a good thing, because many (most?) clients request |
400 | | * chunks of blocks in order. |
401 | | * It's okay for this to fail silently, so don't let it affect errno */ |
402 | | { |
403 | | const int err = errno; |
404 | | posix_fadvise( file->fd, 0, 0, POSIX_FADV_SEQUENTIAL ); |
405 | | errno = err; |
406 | | } |
407 | | #endif |
408 | | |
409 | 394 | return 0; |
410 | 395 | } |
411 | 396 | |