minor cleanup refactor (#1252)

This commit is contained in:
Alden Torres 2016-10-24 20:19:01 -04:00 committed by Arvid Norberg
parent 5341be1e84
commit 8bdbaec872
5 changed files with 4 additions and 20 deletions

View File

@ -33,10 +33,6 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_BLOCK_CACHE
#define TORRENT_BLOCK_CACHE
#include "libtorrent/aux_/disable_warnings_push.hpp"
#include <boost/shared_array.hpp>
#include "libtorrent/aux_/disable_warnings_pop.hpp"
#include <cstdint>
#include <list>
#include <vector>
@ -47,7 +43,6 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/io_service_fwd.hpp"
#include "libtorrent/hasher.hpp"
#include "libtorrent/sliding_average.hpp"
#include "libtorrent/time.hpp"
#include "libtorrent/tailqueue.hpp"
#include "libtorrent/linked_list.hpp"
#include "libtorrent/disk_buffer_pool.hpp"

View File

@ -463,7 +463,6 @@ namespace libtorrent
static bool wait_for_job(job_queue& jobq, disk_io_thread_pool& threads
, std::unique_lock<std::mutex>& l);
void add_completed_job(disk_io_job* j);
void add_completed_jobs(jobqueue_t& jobs);
void add_completed_jobs_impl(jobqueue_t& jobs
, jobqueue_t& completed_jobs);

View File

@ -932,7 +932,7 @@ namespace libtorrent
choking_algorithm,
seed_choking_algorithm,
// ``cache_size`` is the disk write and read cache. It is specified
// ``cache_size`` is the disk write and read cache. It is specified
// in units of 16 KiB blocks. Buffers that are part of a peer's send
// or receive buffer also count against this limit. Send and receive
// buffers will never be denied to be allocated, but they will cause

View File

@ -32,12 +32,9 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/config.hpp"
#include "libtorrent/block_cache.hpp"
#include "libtorrent/disk_buffer_pool.hpp"
#include "libtorrent/assert.hpp"
#include "libtorrent/time.hpp"
#include "libtorrent/disk_io_job.hpp"
#include "libtorrent/storage.hpp"
#include "libtorrent/io_service_fwd.hpp"
#include "libtorrent/error.hpp"
#include "libtorrent/disk_io_thread.hpp" // disk_operation_failed
#include "libtorrent/invariant_check.hpp"

View File

@ -2335,7 +2335,7 @@ namespace libtorrent
TORRENT_PIECE_ASSERT(pe->blocks[i].buf, pe);
TORRENT_PIECE_ASSERT(ph->offset == i * block_size, pe);
ph->offset += int(iov.iov_len);
ph->h.update(pe->blocks[i].buf, int(iov.iov_len));
ph->h.update({pe->blocks[i].buf, iov.iov_len});
}
else
{
@ -2366,7 +2366,7 @@ namespace libtorrent
TORRENT_PIECE_ASSERT(ph->offset == i * block_size, pe);
ret = j->storage->get_storage_impl()->readv(iov, j->piece
, ph->offset, file_flags, j->error);
, ph->offset, file_flags, j->error);
if (ret < 0)
{
@ -2401,7 +2401,7 @@ namespace libtorrent
TORRENT_PIECE_ASSERT(ph->offset == i * block_size, pe);
ph->offset += int(iov.iov_len);
ph->h.update(static_cast<char const*>(iov.iov_base), int(iov.iov_len));
ph->h.update({static_cast<char const*>(iov.iov_base), iov.iov_len});
l.lock();
m_disk_cache.insert_blocks(pe, i, &iov, 1, j);
@ -3324,13 +3324,6 @@ namespace libtorrent
return disk_buffer_holder(*this, ret);
}
void disk_io_thread::add_completed_job(disk_io_job* j)
{
jobqueue_t tmp;
tmp.push_back(j);
add_completed_jobs(tmp);
}
void disk_io_thread::add_completed_jobs(jobqueue_t& jobs)
{
jobqueue_t new_completed_jobs;