Skip to content

Commit

Permalink
Fixes in prefetch statistics.
Browse files Browse the repository at this point in the history
  • Loading branch information
alja committed Oct 26, 2016
1 parent 0c92c58 commit ff6f3d4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/XrdFileCache/XrdFileCacheFile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -999,4 +1003,4 @@ void DirectResponseHandler::Done(int res)
{
m_cond.Signal();
}
}
}
8 changes: 5 additions & 3 deletions src/XrdFileCache/XrdFileCacheInfo.hh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -361,4 +363,4 @@ inline long long Info::GetBufferSize() const
// XrdFileCacheInfoBlock
//----------------------------------------------------------------
}
#endif
#endif

0 comments on commit ff6f3d4

Please sign in to comment.