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
0ad2455c
Commit
0ad2455c
authored
Apr 27, 2017
by
Cristina Moraru
Browse files
Change the drive interface for RAO
Signed-off-by:
Cristina Moraru
<
cristina-gabriela.moraru@cern.ch
>
parent
d5a8098c
Changes
8
Hide whitespace changes
Inline
Side-by-side
tapeserver/castor/tape/tapeserver/SCSI/Constants.hpp
View file @
0ad2455c
...
...
@@ -742,9 +742,7 @@ namespace SCSI {
class
modeRAO
{
public:
enum
{
DEFAULT_RRAO_ALLOCATION
=
64000
};
static
const
uint16_t
DEFAULT_RRAO_ALLOCATION
=
64000
;
};
}
// namespace SCSI
}
// namespace tape
...
...
tapeserver/castor/tape/tapeserver/SCSI/Structures.hpp
View file @
0ad2455c
...
...
@@ -1217,8 +1217,8 @@ namespace SCSI {
udsLimitsPage_t
()
{
zeroStruct
(
this
);
}
int
maxSupported
;
int
maxSize
;
unsigned
int
maxSupported
;
unsigned
int
maxSize
;
};
/**
...
...
@@ -1310,8 +1310,8 @@ namespace SCSI {
zeroStruct
(
this
);
}
unsigned
char
fseq
[
10
];
int
begin
;
int
end
;
u
int
64_t
begin
;
u
int
64_t
end
;
};
}
...
...
tapeserver/castor/tape/tapeserver/drive/DriveGeneric.cpp
View file @
0ad2455c
...
...
@@ -821,8 +821,8 @@ void drive::DriveGeneric::generateRAO(std::list<SCSI::Structures::RAO::blockLims
SCSI
::
ExceptionLauncher
(
sgh
,
"SCSI error in DriveGeneric::requestRAO"
);
}
void
drive
::
DriveGeneric
::
receiveRAO
(
int
offset
,
int
allocationLength
)
{
void
drive
::
DriveGeneric
::
receiveRAO
(
std
::
list
<
SCSI
::
Structures
::
RAO
::
blockLims
>
&
files
,
int
offset
,
int
allocationLength
)
{
SCSI
::
Structures
::
LinuxSGIO_t
sgh
;
SCSI
::
Structures
::
RAO
::
recieveRAO_t
cdb
;
SCSI
::
Structures
::
senseData_t
<
255
>
senseBuff
;
...
...
@@ -850,16 +850,19 @@ void drive::DriveGeneric::receiveRAO(int offset, int allocationLength) {
uint32_t
desc_list_len
=
SCSI
::
Structures
::
toU32
(
params
.
raoDescriptorListLength
);
for
(
uint32_t
i
=
0
;
i
<
desc_list_len
/
sizeof
(
SCSI
::
Structures
::
RAO
::
udsDescriptor
);
++
i
)
{
std
::
cout
<<
params
.
udsDescriptors
[
i
].
udsName
<<
":"
<<
SCSI
::
Structures
::
toU64
(
params
.
udsDescriptors
[
i
].
beginLogicalObjID
)
<<
":"
<<
SCSI
::
Structures
::
toU64
(
params
.
udsDescriptors
[
i
].
endLogicalObjID
)
<<
std
::
endl
;
SCSI
::
Structures
::
RAO
::
blockLims
bl
;
strncpy
((
char
*
)
bl
.
fseq
,
(
char
*
)
params
.
udsDescriptors
[
i
].
udsName
,
10
);
bl
.
begin
=
SCSI
::
Structures
::
toU64
(
params
.
udsDescriptors
[
i
].
beginLogicalObjID
);
bl
.
end
=
SCSI
::
Structures
::
toU64
(
params
.
udsDescriptors
[
i
].
endLogicalObjID
);
files
.
emplace_back
(
bl
);
}
}
void
drive
::
DriveGeneric
::
queryRAO
(
std
::
list
<
SCSI
::
Structures
::
RAO
::
blockLims
>
&
files
)
{
SCSI
::
Structures
::
RAO
::
udsLimitsPage_t
limits
=
getLimitUDS
(
);
generateRAO
(
files
,
limits
.
maxSupported
);
receiveRAO
(
0
,
(
new
SCSI
::
modeRAO
())
->
DEFAULT_RRAO_ALLOCATION
);
void
drive
::
DriveGeneric
::
queryRAO
(
std
::
list
<
SCSI
::
Structures
::
RAO
::
blockLims
>
&
files
,
int
maxSupported
)
{
generateRAO
(
files
,
maxSupported
);
files
.
clear
(
);
receiveRAO
(
files
,
0
,
SCSI
::
modeRAO
::
DEFAULT_RRAO_ALLOCATION
);
}
/**
...
...
tapeserver/castor/tape/tapeserver/drive/DriveGeneric.hpp
View file @
0ad2455c
...
...
@@ -452,13 +452,19 @@ namespace drive {
*/
virtual
bool
isEncryptionCapEnabled
();
/**
* Query the drive for the maximum number and size of User Data Segments (UDS)
* @return udsLimitsPage_t class. A pair of the above mentioned parameters
*/
virtual
SCSI
::
Structures
::
RAO
::
udsLimitsPage_t
getLimitUDS
();
/**
* Query the drive for the Recommended Access Order (RAO)
* for a series of files
* @param filename The name of the file containing the sequential order of
* a list of files [line format: ID:BLOCK_START:BLOCK_END]
*/
virtual
void
queryRAO
(
std
::
list
<
SCSI
::
Structures
::
RAO
::
blockLims
>
&
files
);
virtual
void
queryRAO
(
std
::
list
<
SCSI
::
Structures
::
RAO
::
blockLims
>
&
files
,
int
maxSupported
);
protected:
SCSI
::
DeviceInfo
m_SCSIInfo
;
...
...
@@ -493,12 +499,6 @@ namespace drive {
virtual
void
setLogicalBlockProtection
(
const
unsigned
char
method
,
unsigned
char
methodLength
,
const
bool
enableLPBforRead
,
const
bool
enableLBBforWrite
);
/**
* Query the drive for the maximum number and size of User Data Segments (UDS)
* @return udsLimitsPage_t class. A pair of the above mentioned parameters
*/
virtual
SCSI
::
Structures
::
RAO
::
udsLimitsPage_t
getLimitUDS
();
/**
* Send to the drive the command to generate the Recommended Access Order for
...
...
@@ -514,7 +514,8 @@ namespace drive {
* @param offset
* @param allocationLength
*/
virtual
void
receiveRAO
(
int
offset
,
int
allocationLength
);
virtual
void
receiveRAO
(
std
::
list
<
SCSI
::
Structures
::
RAO
::
blockLims
>
&
files
,
int
offset
,
int
allocationLength
);
};
class
DriveT10000
:
public
DriveGeneric
{
...
...
tapeserver/castor/tape/tapeserver/drive/DriveInterface.hpp
View file @
0ad2455c
...
...
@@ -232,7 +232,8 @@ namespace drive {
virtual
lbpToUse
getLbpToUse
()
=
0
;
virtual
bool
hasTapeInPlace
()
=
0
;
virtual
void
queryRAO
(
std
::
list
<
SCSI
::
Structures
::
RAO
::
blockLims
>
&
files
)
=
0
;
virtual
SCSI
::
Structures
::
RAO
::
udsLimitsPage_t
getLimitUDS
()
=
0
;
virtual
void
queryRAO
(
std
::
list
<
SCSI
::
Structures
::
RAO
::
blockLims
>
&
files
,
int
maxSupported
)
=
0
;
/**
* The configuration of the tape drive as parsed from the TPCONFIG file.
...
...
tapeserver/castor/tape/tapeserver/drive/FakeDrive.cpp
View file @
0ad2455c
...
...
@@ -22,6 +22,7 @@
*****************************************************************************/
#include
"castor/tape/tapeserver/drive/FakeDrive.hpp"
#include
"castor/tape/tapeserver/SCSI/Structures.hpp"
#include
<iostream>
namespace
{
...
...
@@ -297,8 +298,13 @@ bool castor::tape::tapeserver::drive::FakeDrive::hasTapeInPlace() {
return
true
;
}
castor
::
tape
::
SCSI
::
Structures
::
RAO
::
udsLimitsPage_t
castor
::
tape
::
tapeserver
::
drive
::
FakeDrive
::
getLimitUDS
()
{
throw
cta
::
exception
::
Exception
(
"In DriveFakeDrive::getLimitUDS: Not implemented."
);
}
void
castor
::
tape
::
tapeserver
::
drive
::
FakeDrive
::
queryRAO
(
std
::
list
<
SCSI
::
Structures
::
RAO
::
blockLims
>
&
files
)
{
std
::
list
<
SCSI
::
Structures
::
RAO
::
blockLims
>
&
files
,
int
maxSupported
)
{
throw
cta
::
exception
::
Exception
(
"In DriveFakeDrive::queryRAO: Not implemented."
);
}
...
...
tapeserver/castor/tape/tapeserver/drive/FakeDrive.hpp
View file @
0ad2455c
...
...
@@ -109,7 +109,8 @@ namespace drive {
virtual
bool
isTapeBlank
();
virtual
lbpToUse
getLbpToUse
();
virtual
bool
hasTapeInPlace
();
virtual
void
queryRAO
(
std
::
list
<
SCSI
::
Structures
::
RAO
::
blockLims
>
&
files
);
virtual
castor
::
tape
::
SCSI
::
Structures
::
RAO
::
udsLimitsPage_t
getLimitUDS
();
virtual
void
queryRAO
(
std
::
list
<
SCSI
::
Structures
::
RAO
::
blockLims
>
&
files
,
int
maxSupported
);
};
}}}}
tapeserver/castor/tape/tapeserver/file/BasicReadWriteTest.cpp
View file @
0ad2455c
...
...
@@ -259,8 +259,8 @@ int main (int argc, char *argv[])
else
{
throw
-
1
;
}
drive
->
queryRAO
(
files
);
castor
::
tape
::
SCSI
::
Structures
::
RAO
::
udsLimitsPage_t
limits
=
drive
->
getLimitUDS
();
drive
->
queryRAO
(
files
,
limits
.
maxSupported
);
}
}
...
...
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