From c72053a75ce8d42f8a9b3ab1e4a344b302cbaec8 Mon Sep 17 00:00:00 2001 From: arvidn Date: Sat, 5 Nov 2016 20:28:55 -0400 Subject: [PATCH] remove unused clear_read_cache function --- include/libtorrent/disk_interface.hpp | 1 - include/libtorrent/disk_io_thread.hpp | 1 - src/disk_io_thread.cpp | 17 ----------------- 3 files changed, 19 deletions(-) diff --git a/include/libtorrent/disk_interface.hpp b/include/libtorrent/disk_interface.hpp index c6e09d52d..79b09f750 100644 --- a/include/libtorrent/disk_interface.hpp +++ b/include/libtorrent/disk_interface.hpp @@ -82,7 +82,6 @@ namespace libtorrent virtual void async_tick_torrent(piece_manager* storage , std::function handler) = 0; - virtual void clear_read_cache(piece_manager* storage) = 0; virtual void async_clear_piece(piece_manager* storage, int index , std::function handler) = 0; virtual void clear_piece(piece_manager* storage, int index) = 0; diff --git a/include/libtorrent/disk_io_thread.hpp b/include/libtorrent/disk_io_thread.hpp index af229c7f5..f3142e3d8 100644 --- a/include/libtorrent/disk_io_thread.hpp +++ b/include/libtorrent/disk_io_thread.hpp @@ -320,7 +320,6 @@ namespace libtorrent void async_tick_torrent(piece_manager* storage , std::function handler) override; - void clear_read_cache(piece_manager* storage) override; void async_clear_piece(piece_manager* storage, int index , std::function handler) override; // this is not asynchronous and requires that the piece does not diff --git a/src/disk_io_thread.cpp b/src/disk_io_thread.cpp index b08f8779c..4a1bf44ce 100644 --- a/src/disk_io_thread.cpp +++ b/src/disk_io_thread.cpp @@ -1944,23 +1944,6 @@ namespace libtorrent add_job(j); } - void disk_io_thread::clear_read_cache(piece_manager* storage) - { - std::unique_lock l(m_cache_mutex); - - jobqueue_t jobs; - auto const& cache = storage->cached_pieces(); - - // note that i is incremented in the body! - for (auto i = cache.begin(), end(cache.end()); i != end; ) - { - jobqueue_t temp; - if (m_disk_cache.evict_piece(*(i++), temp)) - jobs.append(temp); - } - fail_jobs(storage_error(boost::asio::error::operation_aborted), jobs); - } - void disk_io_thread::async_clear_piece(piece_manager* storage, int index , std::function handler) {