Skip to content

Commit

Permalink
Add asserts.
Browse files Browse the repository at this point in the history
  • Loading branch information
alja authored and osschar committed Mar 9, 2016
1 parent 993d770 commit 86d9415
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/XrdFileCache/XrdFileCacheFile.cc
Expand Up @@ -466,7 +466,7 @@ int File::Read(char* iUserBuff, long long iUserOff, int iUserSize)
// XXXX Or just push it and handle errors in one place later?

inc_ref_count(bi->second);
clLog()->Dump(XrdCl::AppMsg, "File::Read() inc_ref_count for existing b=%p %d %s", (void*)bi->second, block_idx, lPath());
clLog()->Dump(XrdCl::AppMsg, "File::Read() inc_ref_count for existing block %p %d %s", (void*)bi->second, block_idx, lPath());
blks_to_process.push_front(bi->second);
m_stats.m_BytesRam++; // AMT what if block fails
}
Expand All @@ -484,7 +484,7 @@ int File::Read(char* iUserBuff, long long iUserOff, int iUserSize)
{
clLog()->Dump(XrdCl::AppMsg, "File::Read() inc_ref_count new %d %s", block_idx, lPath());
Block *b = RequestBlock(block_idx, false);
break; //AMT ???
assert(b);
inc_ref_count(b);
blks_to_process.push_back(b);
m_stats.m_BytesRam++;
Expand Down Expand Up @@ -680,6 +680,7 @@ void File::WriteBlockToDisk(Block* b)
int pfIdx = (b->m_offset - m_offset)/m_cfi.GetBufferSize();

m_downloadCond.Lock();
assert((m_cfi.TestBit(pfIdx) == false) && "Block not yet fetched.");
m_cfi.SetBitFetched(pfIdx);
m_downloadCond.UnLock();

Expand Down

0 comments on commit 86d9415

Please sign in to comment.