scst_lib: Fix parsing the FIXED bit for tape devices

This patch restores support for the FIXED bit in tape commands. This
patch is necessary since some time ago SCST_TRANSFER_LEN_TYPE_FIXED has
been changed from 1 into 4. From the SVN change log:

r4896 | vlnb | 2013-06-06 21:43:51 -0700 (Thu, 06 Jun 2013) | 9 lines
scst_lib: Rework the CDB parsing routines
Factor out common code into a new function.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5084 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2013-10-31 04:35:15 +00:00
parent 6c9ea47b23
commit a8546ee31c
2 changed files with 2 additions and 2 deletions

View File

@@ -313,7 +313,7 @@ static int tape_done(struct scst_cmd *cmd)
cmd->cdb[1], TransferLength, Residue);
if (TransferLength > Residue) {
int resp_data_len = TransferLength - Residue;
if (cmd->cdb[1] & SCST_TRANSFER_LEN_TYPE_FIXED) {
if (cmd->cdb[1] & 1) {
/*
* No need for locks here, since
* *_detach() can not be called, when

View File

@@ -7130,7 +7130,7 @@ int scst_tape_generic_parse(struct scst_cmd *cmd)
cmd->data_len = cmd->bufflen;
}
if (cmd->op_flags & SCST_TRANSFER_LEN_TYPE_FIXED & cmd->cdb[1]) {
if (cmd->op_flags & SCST_TRANSFER_LEN_TYPE_FIXED && cmd->cdb[1] & 1) {
int block_size = cmd->dev->block_size;
cmd->bufflen = cmd->bufflen * block_size;
cmd->data_len = cmd->data_len * block_size;