Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dCache
cta
Commits
ef0809de
Commit
ef0809de
authored
Jun 05, 2014
by
David COME
Browse files
Factorized error reporting to the disk write task
parent
603b0c8b
Changes
1
Hide whitespace changes
Inline
Side-by-side
castor/tape/tapeserver/daemon/TapeReadTask.hpp
View file @
ef0809de
...
...
@@ -126,17 +126,15 @@ public:
}
//if we end up there because openReadFile brought us here
//then mb is not valid, we need to get a block
//then mb is not valid, we need to get a block
//that will be done in reportErrorToDiskTask()
//or directly call reportErrorToDiskTask with the mem block
if
(
!
mb
)
{
mb
=
m_mm
.
getFreeBlock
();
mb
->
m_fSeq
=
m_fileToRecall
->
fseq
();
mb
->
m_fileid
=
m_fileToRecall
->
fileid
();
reportErrorToDiskTask
();
}
else
{
reportErrorToDiskTask
(
mb
);
}
//mark the block failed and push it
mb
->
markAsFailed
();
m_fifo
.
pushDataBlock
(
mb
);
m_fifo
.
pushDataBlock
(
NULL
);
return
;
}
// In all cases, we have to signal the end of the tape read to the disk write
...
...
@@ -144,20 +142,27 @@ public:
m_fifo
.
pushDataBlock
(
NULL
);
lc
.
log
(
LOG_DEBUG
,
"File read completed"
);
}
/**
* Get a valid block and ask to to do the report to the disk write task
*/
void
reportErrorToDiskTask
(){
MemBlock
*
mb
=
m_mm
.
getFreeBlock
();
mb
->
m_fSeq
=
m_fileToRecall
->
fseq
();
mb
->
m_fileid
=
m_fileToRecall
->
fileid
();
//mark the block failed and push it
reportErrorToDiskTask
(
mb
);
}
private:
/**
* Do the actual report to the disk write task
* @param mb We assume that mb is a valid mem block
*/
void
reportErrorToDiskTask
(
MemBlock
*
mb
){
//mark the block failed and push it
mb
->
markAsFailed
();
m_fifo
.
pushDataBlock
(
mb
);
m_fifo
.
pushDataBlock
(
NULL
);
}
private:
/**
* Open the file on the tape. In case of failure, log and throw
* Copying the auto_ptr on the calling point will give us the ownership of the
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment