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
d081f568
Commit
d081f568
authored
Apr 22, 2014
by
David COME
Browse files
Moved the computation of the number of blocks to a function
parent
34fb8fe1
Changes
2
Hide whitespace changes
Inline
Side-by-side
castor/tape/tapeserver/daemon/MigrationTaskInjector.cpp
View file @
d081f568
...
...
@@ -71,7 +71,7 @@ namespace daemon {
tape
::
utils
::
suppresUnusedVariable
(
sp
);
m_lc
.
log
(
LOG_INFO
,
"Logged file to migrate"
);
const
u_signed64
neededBlock
=
fileSize
/
blockCapacity
+
(
(
fileSize
%
blockCapacity
==
0
)
?
0
:
1
);
const
u_signed64
neededBlock
=
howManyBlocksNeeded
(
fileSize
,
blockCapacity
);
std
::
auto_ptr
<
TapeWriteTask
>
twt
(
new
TapeWriteTask
(
neededBlock
,
removeOwningList
((
*
it
)
->
clone
()),
m_memManager
));
std
::
auto_ptr
<
DiskReadTask
>
drt
(
new
DiskReadTask
(
*
twt
,
removeOwningList
((
*
it
)
->
clone
()),
neededBlock
));
...
...
castor/tape/tapeserver/daemon/MigrationTaskInjector.hpp
View file @
d081f568
...
...
@@ -69,6 +69,12 @@ public:
void
requestInjection
(
int
maxFiles
,
int
byteSizeThreshold
,
bool
lastCall
);
private:
/*Compute how many blocks are needed for a file of fileSize bytes*/
size_t
howManyBlocksNeeded
(
size_t
fileSize
,
size_t
blockCapacity
){
return
fileSize
/
blockCapacity
+
((
fileSize
%
blockCapacity
==
0
)
?
0
:
1
);
}
/**
* A request of files to migrate. We request EITHER
* - a maximum of nbMaxFiles files
...
...
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