Skip to content

Commit

Permalink
Use file size in info file.
Browse files Browse the repository at this point in the history
  • Loading branch information
alja authored and abh3 committed Jun 30, 2016
1 parent dd14414 commit 32252ae
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/XrdFileCache/XrdFileCacheFile.cc
Expand Up @@ -207,9 +207,10 @@ bool File::InitiateClose()
m_stateCond.Lock();
m_stopping = true;
m_stateCond.UnLock();
m_prefetchState = kCanceled;
if (m_cfi.IsComplete()) return false; // AMT maybe map size is here more meaningfull, but might hold block state lock
return true;
m_prefetchState = kCanceled;
m_cfi.CheckComplete();
bool complete = m_cfi.IsComplete();
return !complete;
}

//______________________________________________________________________________
Expand Down Expand Up @@ -270,8 +271,9 @@ bool File::Open()
m_fileSize = m_input->FSize();
int ss = (m_fileSize - 1)/m_cfi.GetBufferSize() + 1;
clLog()->Info(XrdCl::AppMsg, "Creating new file info with size %lld. Reserve space for %d blocks %s", m_fileSize, ss, m_input->Path());
m_cfi.ResizeBits(ss, Cache::GetInstance().RefConfiguration().m_prefetch);
m_cfi.SetFileSize(m_fileSize);
m_cfi.WriteHeader(m_infoFile);
m_infoFile->Fsync();
}
else
{
Expand Down

0 comments on commit 32252ae

Please sign in to comment.