aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libiscsi.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-07-27 16:21:40 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-07-27 16:21:40 -0400
commit91d41fdf31f74e6e2e5f3cb018eca4200e36e202 (patch)
tree81ef11f06bd8047031a2d93706dc263fa1bacd56 /drivers/scsi/libiscsi.c
parentc1095c6da518b0b64e724f629051fa67655cd8d9 (diff)
parent277c5f27a2c86a9a733c0ec0f6a9b1032dfa3e15 (diff)
Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending
* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending: target: Convert to DIV_ROUND_UP_SECTOR_T usage for sectors / dev_max_sectors kernel.h: Add DIV_ROUND_UP_ULL and DIV_ROUND_UP_SECTOR_T macro usage iscsi-target: Add iSCSI fabric support for target v4.1 iscsi: Add Serial Number Arithmetic LT and GT into iscsi_proto.h iscsi: Use struct scsi_lun in iscsi structs instead of u8[8] iscsi: Resolve iscsi_proto.h naming conflicts with drivers/target/iscsi
Diffstat (limited to 'drivers/scsi/libiscsi.c')
-rw-r--r--drivers/scsi/libiscsi.c22
1 files changed, 3 insertions, 19 deletions
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index d7a4120034a2..256a999d010b 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -84,22 +84,6 @@ MODULE_PARM_DESC(debug_libiscsi_eh,
84 __func__, ##arg); \ 84 __func__, ##arg); \
85 } while (0); 85 } while (0);
86 86
87/* Serial Number Arithmetic, 32 bits, less than, RFC1982 */
88#define SNA32_CHECK 2147483648UL
89
90static int iscsi_sna_lt(u32 n1, u32 n2)
91{
92 return n1 != n2 && ((n1 < n2 && (n2 - n1 < SNA32_CHECK)) ||
93 (n1 > n2 && (n2 - n1 < SNA32_CHECK)));
94}
95
96/* Serial Number Arithmetic, 32 bits, less than, RFC1982 */
97static int iscsi_sna_lte(u32 n1, u32 n2)
98{
99 return n1 == n2 || ((n1 < n2 && (n2 - n1 < SNA32_CHECK)) ||
100 (n1 > n2 && (n2 - n1 < SNA32_CHECK)));
101}
102
103inline void iscsi_conn_queue_work(struct iscsi_conn *conn) 87inline void iscsi_conn_queue_work(struct iscsi_conn *conn)
104{ 88{
105 struct Scsi_Host *shost = conn->session->host; 89 struct Scsi_Host *shost = conn->session->host;
@@ -360,7 +344,7 @@ static int iscsi_prep_scsi_cmd_pdu(struct iscsi_task *task)
360 struct iscsi_conn *conn = task->conn; 344 struct iscsi_conn *conn = task->conn;
361 struct iscsi_session *session = conn->session; 345 struct iscsi_session *session = conn->session;
362 struct scsi_cmnd *sc = task->sc; 346 struct scsi_cmnd *sc = task->sc;
363 struct iscsi_cmd *hdr; 347 struct iscsi_scsi_req *hdr;
364 unsigned hdrlength, cmd_len; 348 unsigned hdrlength, cmd_len;
365 itt_t itt; 349 itt_t itt;
366 int rc; 350 int rc;
@@ -374,7 +358,7 @@ static int iscsi_prep_scsi_cmd_pdu(struct iscsi_task *task)
374 if (rc) 358 if (rc)
375 return rc; 359 return rc;
376 } 360 }
377 hdr = (struct iscsi_cmd *) task->hdr; 361 hdr = (struct iscsi_scsi_req *)task->hdr;
378 itt = hdr->itt; 362 itt = hdr->itt;
379 memset(hdr, 0, sizeof(*hdr)); 363 memset(hdr, 0, sizeof(*hdr));
380 364
@@ -830,7 +814,7 @@ static void iscsi_scsi_cmd_rsp(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
830 struct iscsi_task *task, char *data, 814 struct iscsi_task *task, char *data,
831 int datalen) 815 int datalen)
832{ 816{
833 struct iscsi_cmd_rsp *rhdr = (struct iscsi_cmd_rsp *)hdr; 817 struct iscsi_scsi_rsp *rhdr = (struct iscsi_scsi_rsp *)hdr;
834 struct iscsi_session *session = conn->session; 818 struct iscsi_session *session = conn->session;
835 struct scsi_cmnd *sc = task->sc; 819 struct scsi_cmnd *sc = task->sc;
836 820