From 1c5b344c854edb97da21ce1f1798535121ccf09e Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sat, 15 Aug 2009 15:52:10 +0000 Subject: [PATCH] (trunk libT) remove dead code noticed by geirha --- libtransmission/fdlimit.c | 15 --------------- libtransmission/fdlimit.h | 14 +------------- libtransmission/inout.c | 3 --- 3 files changed, 1 insertion(+), 31 deletions(-) diff --git a/libtransmission/fdlimit.c b/libtransmission/fdlimit.c index 1de978b50..38d196c36 100644 --- a/libtransmission/fdlimit.c +++ b/libtransmission/fdlimit.c @@ -477,21 +477,6 @@ tr_fdFileCheckout( int torrentId, return o->fd; } -void -tr_fdFileReturn( int fd ) -{ - struct tr_openfile * o; - const struct tr_openfile * end; - - for( o=gFd->openFiles, end=o+gFd->openFileLimit; o!=end; ++o ) - { - if( o->fd != fd ) - continue; - dbgmsg( "releasing file \"%s\"", o->filename ); - break; - } -} - void tr_fdFileClose( const char * filename ) { diff --git a/libtransmission/fdlimit.h b/libtransmission/fdlimit.h index 377496dd0..1e81706fb 100644 --- a/libtransmission/fdlimit.h +++ b/libtransmission/fdlimit.h @@ -53,9 +53,7 @@ int64_t tr_lseek( int fd, int64_t offset, int whence ); * * A small pool of open files is kept to avoid the overhead of * continually opening and closing the same files when downloading - * piece data. It's also used to ensure only one caller can - * write to the file at a time. Callers check out a file, use it, - * and then check it back in via tr_fdFileReturn() when done. + * piece data. * * - if `folder' doesn't exist, errno is set to ENOENT. * - if doWrite is true, subfolders in torrentFile are created if necessary. @@ -64,7 +62,6 @@ int64_t tr_lseek( int fd, int64_t offset, int whence ); * on success, a file descriptor >= 0 is returned. * on failure, a -1 is returned and errno is set. * - * @see tr_fdFileReturn * @see tr_fdFileClose */ int tr_fdFileCheckout( int torrentId, @@ -74,14 +71,6 @@ int tr_fdFileCheckout( int torrentId, tr_preallocation_mode preallocationMode, uint64_t desiredFileSize ); -/** - * Returns an fd from tr_fdFileCheckout() so that other clients may borrow it. - * - * @see tr_fdFileCheckout - * @see tr_fdFileClose - */ -void tr_fdFileReturn( int file ); - /** * Closes a file that's being held by our file repository. * @@ -89,7 +78,6 @@ void tr_fdFileReturn( int file ); * If the file is currently checked out, it will be closed upon its return. * * @see tr_fdFileCheckout - * @see tr_fdFileReturn */ void tr_fdFileClose( const char * filename ); diff --git a/libtransmission/inout.c b/libtransmission/inout.c index 20a3c9a9c..42c109ed9 100644 --- a/libtransmission/inout.c +++ b/libtransmission/inout.c @@ -113,9 +113,6 @@ readOrWriteBytes( const tr_torrent * tor, if( ( !err ) && ( !fileExists ) && ( ioMode == TR_IO_WRITE ) ) tr_statsFileCreated( tor->session ); - if( fd >= 0 ) - tr_fdFileReturn( fd ); - return err; }