target: Pass 2nd param of transport_split_cdb by value

Since sectors is not modified, it's more straightforward to do this.

Signed-off-by: Andy Grover <agrover@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
This commit is contained in:
Andy Grover 2011-06-28 10:31:18 -07:00 committed by Nicholas Bellinger
parent d0229ae3fe
commit 3a86720567
4 changed files with 17 additions and 18 deletions

View File

@ -42,13 +42,13 @@
*/
void split_cdb_XX_6(
unsigned long long lba,
u32 *sectors,
u32 sectors,
unsigned char *cdb)
{
cdb[1] = (lba >> 16) & 0x1f;
cdb[2] = (lba >> 8) & 0xff;
cdb[3] = lba & 0xff;
cdb[4] = *sectors & 0xff;
cdb[4] = sectors & 0xff;
}
/* split_cdb_XX_10():
@ -57,11 +57,11 @@ void split_cdb_XX_6(
*/
void split_cdb_XX_10(
unsigned long long lba,
u32 *sectors,
u32 sectors,
unsigned char *cdb)
{
put_unaligned_be32(lba, &cdb[2]);
put_unaligned_be16(*sectors, &cdb[7]);
put_unaligned_be16(sectors, &cdb[7]);
}
/* split_cdb_XX_12():
@ -70,11 +70,11 @@ void split_cdb_XX_10(
*/
void split_cdb_XX_12(
unsigned long long lba,
u32 *sectors,
u32 sectors,
unsigned char *cdb)
{
put_unaligned_be32(lba, &cdb[2]);
put_unaligned_be32(*sectors, &cdb[6]);
put_unaligned_be32(sectors, &cdb[6]);
}
/* split_cdb_XX_16():
@ -83,11 +83,11 @@ void split_cdb_XX_12(
*/
void split_cdb_XX_16(
unsigned long long lba,
u32 *sectors,
u32 sectors,
unsigned char *cdb)
{
put_unaligned_be64(lba, &cdb[2]);
put_unaligned_be32(*sectors, &cdb[10]);
put_unaligned_be32(sectors, &cdb[10]);
}
/*
@ -97,9 +97,9 @@ void split_cdb_XX_16(
*/
void split_cdb_XX_32(
unsigned long long lba,
u32 *sectors,
u32 sectors,
unsigned char *cdb)
{
put_unaligned_be64(lba, &cdb[12]);
put_unaligned_be32(*sectors, &cdb[28]);
put_unaligned_be32(sectors, &cdb[28]);
}

View File

@ -1,10 +1,10 @@
#ifndef TARGET_CORE_SCDB_H
#define TARGET_CORE_SCDB_H
extern void split_cdb_XX_6(unsigned long long, u32 *, unsigned char *);
extern void split_cdb_XX_10(unsigned long long, u32 *, unsigned char *);
extern void split_cdb_XX_12(unsigned long long, u32 *, unsigned char *);
extern void split_cdb_XX_16(unsigned long long, u32 *, unsigned char *);
extern void split_cdb_XX_32(unsigned long long, u32 *, unsigned char *);
extern void split_cdb_XX_6(unsigned long long, u32, unsigned char *);
extern void split_cdb_XX_10(unsigned long long, u32, unsigned char *);
extern void split_cdb_XX_12(unsigned long long, u32, unsigned char *);
extern void split_cdb_XX_16(unsigned long long, u32, unsigned char *);
extern void split_cdb_XX_32(unsigned long long, u32, unsigned char *);
#endif /* TARGET_CORE_SCDB_H */

View File

@ -4728,8 +4728,7 @@ static u32 transport_allocate_tasks(
scsi_command_size(cmd->t_task_cdb));
/* Update new cdb with updated lba/sectors */
cmd->transport_split_cdb(task->task_lba,
&task->task_sectors, cdb);
cmd->transport_split_cdb(task->task_lba, task->task_sectors, cdb);
/*
* Perform the SE OBJ plugin and/or Transport plugin specific

View File

@ -479,7 +479,7 @@ struct se_cmd {
struct list_head se_queue_node;
struct target_core_fabric_ops *se_tfo;
int (*transport_emulate_cdb)(struct se_cmd *);
void (*transport_split_cdb)(unsigned long long, u32 *, unsigned char *);
void (*transport_split_cdb)(unsigned long long, u32, unsigned char *);
void (*transport_wait_for_tasks)(struct se_cmd *, int, int);
void (*transport_complete_callback)(struct se_cmd *);
int (*transport_qf_callback)(struct se_cmd *);