Skip to content
GitLab
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
1946ef83
Commit
1946ef83
authored
Apr 07, 2014
by
David COME
Browse files
Added function to read/write data from WriteFile/ReadFile
parent
023d9d95
Changes
2
Hide whitespace changes
Inline
Side-by-side
castor/tape/tapeserver/daemon/DiskWriteTask.hpp
View file @
1946ef83
...
...
@@ -95,7 +95,7 @@ public:
using
log
::
LogContext
;
using
log
::
Param
;
try
{
tape
::
diskFile
::
WriteFile
writer
(
m_recallingFile
->
path
());
tape
::
diskFile
::
WriteFile
ourFile
(
m_recallingFile
->
path
());
int
blockId
=
0
;
while
(
!
m_fifo
.
finished
())
{
...
...
@@ -114,9 +114,9 @@ public:
lc
.
log
(
LOG_ERR
,
"received a bad block for writing"
);
throw
castor
::
tape
::
Exception
(
"received a bad block for writing"
);
}
writer
.
write
(
mb
->
m_payload
.
get
(),
mb
->
m_payload
.
size
()
);
mb
->
m_payload
.
write
(
ourFile
);
}
writer
.
close
();
ourFile
.
close
();
reporter
.
reportCompletedJob
(
*
m_recallingFile
);
return
true
;
}
...
...
castor/tape/tapeserver/daemon/MemBlock.hpp
View file @
1946ef83
...
...
@@ -25,6 +25,7 @@
#pragma once
#include
"castor/tape/tapeserver/daemon/Exception.hpp"
#include
"castor/tape/tapeserver/file/File.hpp"
#include
<memory>
namespace
castor
{
...
...
@@ -57,12 +58,27 @@ public:
char
*
get
(){
return
m_payload
;
}
char
const
*
get
()
const
{
return
m_payload
;
}
void
read
(
tape
::
diskFile
::
ReadFile
&
from
){
m_size
=
from
.
read
(
m_payload
,
m_capacity
);
}
void
write
(
tape
::
diskFile
::
WriteFile
&
to
){
to
.
write
(
m_payload
,
m_size
);
}
private:
char
*
m_payload
;
size_t
m_capacity
;
size_t
m_size
;
};
class
MemBlock
{
public:
static
const
int
uninitialised_value
=
-
1
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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