aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Grover <agrover@redhat.com>2011-06-28 13:31:18 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2011-07-22 05:37:48 -0400
commit3a86720567fd92819b449df10db85a2f73447d87 (patch)
tree2d971854eabe7b4bc8ff091b0e9d91dca8377bbe
parentd0229ae3fed59b4009e33f836d9ad4e312294d46 (diff)
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>
-rw-r--r--drivers/target/target_core_scdb.c20
-rw-r--r--drivers/target/target_core_scdb.h10
-rw-r--r--drivers/target/target_core_transport.c3
-rw-r--r--include/target/target_core_base.h2
4 files changed, 17 insertions, 18 deletions
diff --git a/drivers/target/target_core_scdb.c b/drivers/target/target_core_scdb.c
index dc6fed037ab3..72843441d4fa 100644
--- a/drivers/target/target_core_scdb.c
+++ b/drivers/target/target_core_scdb.c
@@ -42,13 +42,13 @@
42 */ 42 */
43void split_cdb_XX_6( 43void split_cdb_XX_6(
44 unsigned long long lba, 44 unsigned long long lba,
45 u32 *sectors, 45 u32 sectors,
46 unsigned char *cdb) 46 unsigned char *cdb)
47{ 47{
48 cdb[1] = (lba >> 16) & 0x1f; 48 cdb[1] = (lba >> 16) & 0x1f;
49 cdb[2] = (lba >> 8) & 0xff; 49 cdb[2] = (lba >> 8) & 0xff;
50 cdb[3] = lba & 0xff; 50 cdb[3] = lba & 0xff;
51 cdb[4] = *sectors & 0xff; 51 cdb[4] = sectors & 0xff;
52} 52}
53 53
54/* split_cdb_XX_10(): 54/* split_cdb_XX_10():
@@ -57,11 +57,11 @@ void split_cdb_XX_6(
57 */ 57 */
58void split_cdb_XX_10( 58void split_cdb_XX_10(
59 unsigned long long lba, 59 unsigned long long lba,
60 u32 *sectors, 60 u32 sectors,
61 unsigned char *cdb) 61 unsigned char *cdb)
62{ 62{
63 put_unaligned_be32(lba, &cdb[2]); 63 put_unaligned_be32(lba, &cdb[2]);
64 put_unaligned_be16(*sectors, &cdb[7]); 64 put_unaligned_be16(sectors, &cdb[7]);
65} 65}
66 66
67/* split_cdb_XX_12(): 67/* split_cdb_XX_12():
@@ -70,11 +70,11 @@ void split_cdb_XX_10(
70 */ 70 */
71void split_cdb_XX_12( 71void split_cdb_XX_12(
72 unsigned long long lba, 72 unsigned long long lba,
73 u32 *sectors, 73 u32 sectors,
74 unsigned char *cdb) 74 unsigned char *cdb)
75{ 75{
76 put_unaligned_be32(lba, &cdb[2]); 76 put_unaligned_be32(lba, &cdb[2]);
77 put_unaligned_be32(*sectors, &cdb[6]); 77 put_unaligned_be32(sectors, &cdb[6]);
78} 78}
79 79
80/* split_cdb_XX_16(): 80/* split_cdb_XX_16():
@@ -83,11 +83,11 @@ void split_cdb_XX_12(
83 */ 83 */
84void split_cdb_XX_16( 84void split_cdb_XX_16(
85 unsigned long long lba, 85 unsigned long long lba,
86 u32 *sectors, 86 u32 sectors,
87 unsigned char *cdb) 87 unsigned char *cdb)
88{ 88{
89 put_unaligned_be64(lba, &cdb[2]); 89 put_unaligned_be64(lba, &cdb[2]);
90 put_unaligned_be32(*sectors, &cdb[10]); 90 put_unaligned_be32(sectors, &cdb[10]);
91} 91}
92 92
93/* 93/*
@@ -97,9 +97,9 @@ void split_cdb_XX_16(
97 */ 97 */
98void split_cdb_XX_32( 98void split_cdb_XX_32(
99 unsigned long long lba, 99 unsigned long long lba,
100 u32 *sectors, 100 u32 sectors,
101 unsigned char *cdb) 101 unsigned char *cdb)
102{ 102{
103 put_unaligned_be64(lba, &cdb[12]); 103 put_unaligned_be64(lba, &cdb[12]);
104 put_unaligned_be32(*sectors, &cdb[28]); 104 put_unaligned_be32(sectors, &cdb[28]);
105} 105}
diff --git a/drivers/target/target_core_scdb.h b/drivers/target/target_core_scdb.h
index 98cd1c01ed83..48e9ccc9585e 100644
--- a/drivers/target/target_core_scdb.h
+++ b/drivers/target/target_core_scdb.h
@@ -1,10 +1,10 @@
1#ifndef TARGET_CORE_SCDB_H 1#ifndef TARGET_CORE_SCDB_H
2#define TARGET_CORE_SCDB_H 2#define TARGET_CORE_SCDB_H
3 3
4extern void split_cdb_XX_6(unsigned long long, u32 *, unsigned char *); 4extern void split_cdb_XX_6(unsigned long long, u32, unsigned char *);
5extern void split_cdb_XX_10(unsigned long long, u32 *, unsigned char *); 5extern void split_cdb_XX_10(unsigned long long, u32, unsigned char *);
6extern void split_cdb_XX_12(unsigned long long, u32 *, unsigned char *); 6extern void split_cdb_XX_12(unsigned long long, u32, unsigned char *);
7extern void split_cdb_XX_16(unsigned long long, u32 *, unsigned char *); 7extern void split_cdb_XX_16(unsigned long long, u32, unsigned char *);
8extern void split_cdb_XX_32(unsigned long long, u32 *, unsigned char *); 8extern void split_cdb_XX_32(unsigned long long, u32, unsigned char *);
9 9
10#endif /* TARGET_CORE_SCDB_H */ 10#endif /* TARGET_CORE_SCDB_H */
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index 267113c1607c..b499d14f4637 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -4728,8 +4728,7 @@ static u32 transport_allocate_tasks(
4728 scsi_command_size(cmd->t_task_cdb)); 4728 scsi_command_size(cmd->t_task_cdb));
4729 4729
4730 /* Update new cdb with updated lba/sectors */ 4730 /* Update new cdb with updated lba/sectors */
4731 cmd->transport_split_cdb(task->task_lba, 4731 cmd->transport_split_cdb(task->task_lba, task->task_sectors, cdb);
4732 &task->task_sectors, cdb);
4733 4732
4734 /* 4733 /*
4735 * Perform the SE OBJ plugin and/or Transport plugin specific 4734 * Perform the SE OBJ plugin and/or Transport plugin specific
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
index bb9ef9f715a3..d97618a2ee95 100644
--- a/include/target/target_core_base.h
+++ b/include/target/target_core_base.h
@@ -479,7 +479,7 @@ struct se_cmd {
479 struct list_head se_queue_node; 479 struct list_head se_queue_node;
480 struct target_core_fabric_ops *se_tfo; 480 struct target_core_fabric_ops *se_tfo;
481 int (*transport_emulate_cdb)(struct se_cmd *); 481 int (*transport_emulate_cdb)(struct se_cmd *);
482 void (*transport_split_cdb)(unsigned long long, u32 *, unsigned char *); 482 void (*transport_split_cdb)(unsigned long long, u32, unsigned char *);
483 void (*transport_wait_for_tasks)(struct se_cmd *, int, int); 483 void (*transport_wait_for_tasks)(struct se_cmd *, int, int);
484 void (*transport_complete_callback)(struct se_cmd *); 484 void (*transport_complete_callback)(struct se_cmd *);
485 int (*transport_qf_callback)(struct se_cmd *); 485 int (*transport_qf_callback)(struct se_cmd *);