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
3f89c09a
Commit
3f89c09a
authored
Aug 29, 2017
by
Cristina Moraru
Browse files
Fix illegal ioctl command
Signed-off-by:
Cristina Moraru
<
cristina-gabriela.moraru@cern.ch
>
parent
8c7d0ba6
Changes
4
Hide whitespace changes
Inline
Side-by-side
tapeserver/castor/tape/tapeserver/SCSI/Constants.hpp
View file @
3f89c09a
...
...
@@ -740,10 +740,6 @@ namespace SCSI {
*/
const
unsigned
char
controlDataProtectionModePageLengthAddition
=
4
;
class
modeRAO
{
public:
static
const
uint16_t
DEFAULT_RRAO_ALLOCATION
=
64000
;
};
}
// namespace SCSI
}
// namespace tape
}
// namespace castor
tapeserver/castor/tape/tapeserver/SCSI/Structures.hpp
View file @
3f89c09a
...
...
@@ -85,7 +85,16 @@ namespace SCSI {
template
<
typename
T
>
void
setDataBuffer
(
T
*
dataBuff
)
{
dxferp
=
dataBuff
;
dxfer_len
=
sizeof
(
T
);
}
// If dataBuff is a pointer to a variable length array, sizeof will return
// the size of one element. This function allows to manually set the buffer size
template
<
typename
T
>
void
setDataBuffer
(
T
*
dataBuff
,
unsigned
int
dataBuffSize
)
{
dxferp
=
dataBuff
;
dxfer_len
=
dataBuffSize
;
}
sg_io_hdr_t
*
operator
&
()
{
return
(
sg_io_hdr_t
*
)
this
;
}
};
...
...
tapeserver/castor/tape/tapeserver/drive/DriveGeneric.cpp
View file @
3f89c09a
...
...
@@ -763,7 +763,7 @@ SCSI::Structures::RAO::udsLimits drive::DriveGeneric::getLimitUDS() {
cdb
.
serviceAction
=
0x1d
;
cdb
.
udsLimits
=
1
;
SCSI
::
Structures
::
setU32
(
cdb
.
allocationLength
,
SCSI
::
modeRAO
::
DEFAULT_RRAO_ALLOCATION
);
SCSI
::
Structures
::
setU32
(
cdb
.
allocationLength
,
sizeof
(
SCSI
::
Structures
::
RAO
::
udsLimitsPage_t
)
);
sgh
.
setCDB
(
&
cdb
);
sgh
.
setSenseBuffer
(
&
senseBuff
);
...
...
@@ -814,7 +814,7 @@ void drive::DriveGeneric::generateRAO(std::list<SCSI::Structures::RAO::blockLims
sgh
.
setCDB
(
&
cdb
);
sgh
.
setSenseBuffer
(
&
senseBuff
);
sgh
.
setDataBuffer
(
dataBuff
.
get
());
sgh
.
setDataBuffer
(
dataBuff
.
get
()
,
real_params_len
);
sgh
.
dxfer_direction
=
SG_DXFER_TO_DEV
;
/* Manage both system error and SCSI errors. */
...
...
@@ -824,8 +824,7 @@ void drive::DriveGeneric::generateRAO(std::list<SCSI::Structures::RAO::blockLims
SCSI
::
ExceptionLauncher
(
sgh
,
"SCSI error in DriveGeneric::requestRAO"
);
}
void
drive
::
DriveGeneric
::
receiveRAO
(
std
::
list
<
SCSI
::
Structures
::
RAO
::
blockLims
>
&
files
,
int
offset
,
int
allocationLength
)
{
void
drive
::
DriveGeneric
::
receiveRAO
(
std
::
list
<
SCSI
::
Structures
::
RAO
::
blockLims
>
&
files
)
{
SCSI
::
Structures
::
LinuxSGIO_t
sgh
;
SCSI
::
Structures
::
RAO
::
recieveRAO_t
cdb
;
SCSI
::
Structures
::
senseData_t
<
255
>
senseBuff
;
...
...
@@ -840,12 +839,11 @@ void drive::DriveGeneric::receiveRAO(std::list<SCSI::Structures::RAO::blockLims>
cdb
.
udsLimits
=
0
;
cdb
.
serviceAction
=
0x1d
;
SCSI
::
Structures
::
setU32
(
cdb
.
allocationLength
,
allocationLength
);
SCSI
::
Structures
::
setU32
(
cdb
.
raoListOffset
,
offset
);
SCSI
::
Structures
::
setU32
(
cdb
.
allocationLength
,
real_params_len
);
sgh
.
setCDB
(
&
cdb
);
sgh
.
setSenseBuffer
(
&
senseBuff
);
sgh
.
setDataBuffer
(
dataBuff
.
get
());
sgh
.
setDataBuffer
(
dataBuff
.
get
()
,
real_params_len
);
sgh
.
dxfer_direction
=
SG_DXFER_FROM_DEV
;
/* Manage both system error and SCSI errors. */
...
...
@@ -874,7 +872,7 @@ void drive::DriveGeneric::receiveRAO(std::list<SCSI::Structures::RAO::blockLims>
void
drive
::
DriveGeneric
::
queryRAO
(
std
::
list
<
SCSI
::
Structures
::
RAO
::
blockLims
>
&
files
,
int
maxSupported
)
{
generateRAO
(
files
,
maxSupported
);
receiveRAO
(
files
,
0
,
SCSI
::
modeRAO
::
DEFAULT_RRAO_ALLOCATION
);
receiveRAO
(
files
);
}
/**
...
...
tapeserver/castor/tape/tapeserver/drive/DriveGeneric.hpp
View file @
3f89c09a
...
...
@@ -514,8 +514,7 @@ namespace drive {
* @param offset
* @param allocationLength
*/
virtual
void
receiveRAO
(
std
::
list
<
SCSI
::
Structures
::
RAO
::
blockLims
>
&
files
,
int
offset
,
int
allocationLength
);
virtual
void
receiveRAO
(
std
::
list
<
SCSI
::
Structures
::
RAO
::
blockLims
>
&
files
);
};
class
DriveT10000
:
public
DriveGeneric
{
...
...
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