diff --git a/src/XrdFileCache/XrdFileCacheFile.cc b/src/XrdFileCache/XrdFileCacheFile.cc index ecfb941969e..532a670f10a 100644 --- a/src/XrdFileCache/XrdFileCacheFile.cc +++ b/src/XrdFileCache/XrdFileCacheFile.cc @@ -757,6 +757,10 @@ void File::WriteBlockToDisk(Block* b) XrdSysCondVarHelper _lck(m_downloadCond); m_cfi.SetBitWritten(pfIdx); + + if (b->m_prefetch) + m_cfi.SetBitPrefetch(); + // clLog()->Dump(XrdCl::AppMsg, "File::WriteToDisk() dec_ref_count %d %s", pfIdx, lPath()); dec_ref_count(b); @@ -999,4 +1003,4 @@ void DirectResponseHandler::Done(int res) { m_cond.Signal(); } -} \ No newline at end of file +} diff --git a/src/XrdFileCache/XrdFileCacheInfo.hh b/src/XrdFileCache/XrdFileCacheInfo.hh index 4f3fc138216..bda5a892a0b 100644 --- a/src/XrdFileCache/XrdFileCacheInfo.hh +++ b/src/XrdFileCache/XrdFileCacheInfo.hh @@ -261,14 +261,16 @@ inline bool Info::TestBit(int i) const return (m_buff_written[cn] & cfiBIT(off)) == cfiBIT(off); } -// AMT could have only one function to test bit and pass an argument, but would loose clarity + inline bool Info::TestPrefetchBit(int i) const { + if (m_buff_prefetch) return false; + const int cn = i/8; assert(cn < GetSizeInBytes()); const int off = i - cn*8; - return (m_buff_written[cn] & cfiBIT(off)) == cfiBIT(off); + return (m_buff_prefetch[cn] & cfiBIT(off)) == cfiBIT(off); } inline int Info::GetNDownloadedBlocks() const @@ -361,4 +363,4 @@ inline long long Info::GetBufferSize() const // XrdFileCacheInfoBlock //---------------------------------------------------------------- } -#endif \ No newline at end of file +#endif