diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2012-12-06 00:39:14 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2012-12-06 00:39:14 +0900 |
| commit | 56c498bcbfa1b7645c75e39142ac9f6c6ca369c6 (patch) | |
| tree | a539d2585134ce545dcfcaee0ee4436e4049cd10 /src/Piece.cc | |
| parent | 9ed8502e742452568695181014410fe924f45e26 (diff) | |
Clear write cache on Segment::clear and Piece::clearAllBlock
Diffstat (limited to 'src/Piece.cc')
| -rw-r--r-- | src/Piece.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Piece.cc b/src/Piece.cc index 1f7e4596..f1e59cd9 100644 --- a/src/Piece.cc +++ b/src/Piece.cc @@ -78,9 +78,12 @@ void Piece::completeBlock(size_t blockIndex) { bitfield_->unsetUseBit(blockIndex); } -void Piece::clearAllBlock() { +void Piece::clearAllBlock(WrDiskCache* diskCache) { bitfield_->clearAllBit(); bitfield_->clearAllUseBit(); + if(diskCache && wrCache_) { + clearWrCache(diskCache); + } } void Piece::setAllBlock() { |
