diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2011-03-22 17:14:09 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2011-07-25 03:48:08 -0400 |
commit | 8304bbceee505742925b487fd8ea56e1f8b4b805 (patch) | |
tree | 4776c640eb8aab7e8a957f9890a7e49a48855d2d /drivers | |
parent | 55bdabdf41b6ee99e22e9d78a895b001fb1d852e (diff) |
iscsi: Add Serial Number Arithmetic LT and GT into iscsi_proto.h
This patch moves the iscsi_sna_lt() and iscsi_sna_lte(), along with
iscsi_sna_gt() and iscsi_sna_gte() from iscsi_target_mod into
static inlines inside of include/scsi/iscsi_proto.h
This patch also includes the ISCSI_HDR_LEN and ISCSI_CRC_LEN
definitions.
(Added JesperJ simpliciation for iscsi_sna_* usage)
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/libiscsi.c | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c index 57175a7d2ef0..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 | |||
90 | static 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 */ | ||
97 | static 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 | |||
103 | inline void iscsi_conn_queue_work(struct iscsi_conn *conn) | 87 | inline 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; |