$ cd scst-1.0.1.1
THIS STEP IS SPECIFIC FOR SLES 10 sp2 distribution:
- . Save the following patch to /tmp/scst_sles10_sp2.patch
-
-/************************ Start scst_sless_sp2.patch *********************/
-
-diff -Naur scst-1.0.1.1-orig/src/scst_lib.c scst-1.0.1.1/src/scst_lib.c
---- scst-1.0.1.1-orig/src/scst_lib.c 2010-03-05 18:17:22.000000000 -0800
-+++ scst-1.0.1.1/src/scst_lib.c 2010-03-05 18:22:50.000000000 -0800
-@@ -1680,7 +1680,7 @@
- return res;
- }
-
--#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16)
- static void scst_req_done(struct scsi_cmnd *scsi_cmd)
- {
- struct scsi_request *req;
-@@ -1743,7 +1743,7 @@
- TRACE_EXIT();
- return;
- }
--#else /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18) */
-+#else /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16) */
- static void scst_send_release(struct scst_device *dev)
- {
- struct scsi_device *scsi_dev;
-@@ -1790,7 +1790,7 @@
- TRACE_EXIT();
- return;
- }
--#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18) */
-+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16) */
-
- /* scst_mutex supposed to be held */
- static void scst_clear_reservation(struct scst_tgt_dev *tgt_dev)
-@@ -2038,7 +2038,7 @@
- sBUG_ON(cmd->inc_blocking || cmd->needs_unblocking ||
- cmd->dec_on_dev_needed);
-
--#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16)
- #if defined(CONFIG_SCST_EXTRACHECKS)
- if (cmd->scsi_req) {
- PRINT_ERROR("%s: %s", __func__, "Cmd with unfreed "
-@@ -2212,7 +2212,7 @@
- return;
- }
-
--#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16)
- int scst_alloc_request(struct scst_cmd *cmd)
- {
- int res = 0;
-diff -Naur scst-1.0.1.1-orig/src/scst_main.c scst-1.0.1.1/src/scst_main.c
---- scst-1.0.1.1-orig/src/scst_main.c 2010-03-05 18:17:22.000000000 -0800
-+++ scst-1.0.1.1/src/scst_main.c 2010-03-05 18:34:48.000000000 -0800
-@@ -1676,7 +1676,7 @@
-
- TRACE_ENTRY();
-
--#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16)
- {
- struct scsi_request *req;
- BUILD_BUG_ON(SCST_SENSE_BUFFERSIZE !=
-diff -Naur scst-1.0.1.1-orig/src/scst_priv.h scst-1.0.1.1/src/scst_priv.h
---- scst-1.0.1.1-orig/src/scst_priv.h 2010-03-05 18:17:22.000000000 -0800
-+++ scst-1.0.1.1/src/scst_priv.h 2010-03-05 18:35:07.000000000 -0800
-@@ -27,7 +27,7 @@
- #include <scsi/scsi_device.h>
- #include <scsi/scsi_host.h>
-
--#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16)
- #include <scsi/scsi_request.h>
- #endif
-
-@@ -322,7 +322,7 @@
- void scst_check_retries(struct scst_tgt *tgt);
- void scst_tgt_retry_timer_fn(unsigned long arg);
-
--#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16)
- int scst_alloc_request(struct scst_cmd *cmd);
- void scst_release_request(struct scst_cmd *cmd);
-
-diff -Naur scst-1.0.1.1-orig/src/scst_targ.c scst-1.0.1.1/src/scst_targ.c
---- scst-1.0.1.1-orig/src/scst_targ.c 2010-03-05 18:17:22.000000000 -0800
-+++ scst-1.0.1.1/src/scst_targ.c 2010-03-05 18:36:03.000000000 -0800
-@@ -1273,7 +1273,7 @@
- return context;
- }
-
--#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16)
- static inline struct scst_cmd *scst_get_cmd(struct scsi_cmnd *scsi_cmd,
- struct scsi_request **req)
- {
-@@ -1325,7 +1325,7 @@
- TRACE_EXIT();
- return;
- }
--#else /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18) */
-+#else /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16) */
- static void scst_cmd_done(void *data, char *sense, int result, int resid)
- {
- struct scst_cmd *cmd;
-@@ -1347,7 +1347,7 @@
- TRACE_EXIT();
- return;
- }
--#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18) */
-+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16) */
-
- static void scst_cmd_done_local(struct scst_cmd *cmd, int next_state,
- enum scst_exec_context pref_context)
-@@ -1881,7 +1881,7 @@
- static int scst_do_real_exec(struct scst_cmd *cmd)
- {
- int res = SCST_EXEC_NOT_COMPLETED;
--#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 18)
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 16)
- int rc;
- #endif
- bool atomic = scst_cmd_atomic(cmd);
-@@ -1948,7 +1948,7 @@
- }
- #endif
-
--#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16)
- if (unlikely(scst_alloc_request(cmd) != 0)) {
- if (atomic) {
- res = SCST_EXEC_NEED_THREAD;
-@@ -1999,7 +1999,7 @@
- scst_set_cmd_error(cmd, SCST_LOAD_SENSE(scst_sense_hardw_error));
- goto out_done;
-
--#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16)
- out_busy:
- scst_set_busy(cmd);
- /* go through */
-
-/************************ End scst_sless10_sp2.patch ***********************/
-
- . $ patch -p1 < /tmp/scst_sles10_sp2.patch
+ $ patch -p1 -i <path to OFED>/docs/scst/scst_sles10_sp2.patch
For all distributions:
$ make && make install
-1c. Creating file /tmp/scst.patch.
-
NOTES: FOR SLES 11 distribution, skip this step and go directly to step (2)
- . Other distributions please save the following patch to /tmp/scst.patch
-
-/************************ Start scst.patch *********************/
-diff -Naur scst/scst.h scst.wk/scst.h
---- scst/scst.h 2009-08-14 17:09:47.000000000 -0700
-+++ scst.wk/scst.h 2009-08-14 17:01:28.000000000 -0700
-@@ -2581,7 +2581,7 @@
- void scst_aen_done(struct scst_aen *aen);
-
- #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)
--
-+#ifndef RHEL_RELEASE_CODE
- static inline struct page *sg_page(struct scatterlist *sg)
- {
- return sg->page;
-@@ -2610,6 +2610,7 @@
- sg->length = len;
- }
-
-+#endif
- #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) */
-
- static inline void sg_clear(struct scatterlist *sg)
-/************************ End scst.patch *********************/
-
-
-1d. patch scst.h header file with /tmp/scst.patch
+1c. patch scst.h header file with scst.patch
$ cd /usr/local/include/scst
- $ patch -p1 < /tmp/scst.patch
+ $ patch -p1 -i <path to OFED>/docs/scst/scst.patch
2. Download/install OFED-1.5.1 package - SRP target is part of OFED package
--- /dev/null
+diff -Naur scst-1.0.1.1-orig/src/scst_lib.c scst-1.0.1.1/src/scst_lib.c
+--- scst-1.0.1.1-orig/src/scst_lib.c 2010-03-05 18:17:22.000000000 -0800
++++ scst-1.0.1.1/src/scst_lib.c 2010-03-05 18:22:50.000000000 -0800
+@@ -1680,7 +1680,7 @@
+ return res;
+ }
+
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16)
+ static void scst_req_done(struct scsi_cmnd *scsi_cmd)
+ {
+ struct scsi_request *req;
+@@ -1743,7 +1743,7 @@
+ TRACE_EXIT();
+ return;
+ }
+-#else /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18) */
++#else /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16) */
+ static void scst_send_release(struct scst_device *dev)
+ {
+ struct scsi_device *scsi_dev;
+@@ -1790,7 +1790,7 @@
+ TRACE_EXIT();
+ return;
+ }
+-#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18) */
++#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16) */
+
+ /* scst_mutex supposed to be held */
+ static void scst_clear_reservation(struct scst_tgt_dev *tgt_dev)
+@@ -2038,7 +2038,7 @@
+ sBUG_ON(cmd->inc_blocking || cmd->needs_unblocking ||
+ cmd->dec_on_dev_needed);
+
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16)
+ #if defined(CONFIG_SCST_EXTRACHECKS)
+ if (cmd->scsi_req) {
+ PRINT_ERROR("%s: %s", __func__, "Cmd with unfreed "
+@@ -2212,7 +2212,7 @@
+ return;
+ }
+
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16)
+ int scst_alloc_request(struct scst_cmd *cmd)
+ {
+ int res = 0;
+diff -Naur scst-1.0.1.1-orig/src/scst_main.c scst-1.0.1.1/src/scst_main.c
+--- scst-1.0.1.1-orig/src/scst_main.c 2010-03-05 18:17:22.000000000 -0800
++++ scst-1.0.1.1/src/scst_main.c 2010-03-05 18:34:48.000000000 -0800
+@@ -1676,7 +1676,7 @@
+
+ TRACE_ENTRY();
+
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16)
+ {
+ struct scsi_request *req;
+ BUILD_BUG_ON(SCST_SENSE_BUFFERSIZE !=
+diff -Naur scst-1.0.1.1-orig/src/scst_priv.h scst-1.0.1.1/src/scst_priv.h
+--- scst-1.0.1.1-orig/src/scst_priv.h 2010-03-05 18:17:22.000000000 -0800
++++ scst-1.0.1.1/src/scst_priv.h 2010-03-05 18:35:07.000000000 -0800
+@@ -27,7 +27,7 @@
+ #include <scsi/scsi_device.h>
+ #include <scsi/scsi_host.h>
+
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16)
+ #include <scsi/scsi_request.h>
+ #endif
+
+@@ -322,7 +322,7 @@
+ void scst_check_retries(struct scst_tgt *tgt);
+ void scst_tgt_retry_timer_fn(unsigned long arg);
+
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16)
+ int scst_alloc_request(struct scst_cmd *cmd);
+ void scst_release_request(struct scst_cmd *cmd);
+
+diff -Naur scst-1.0.1.1-orig/src/scst_targ.c scst-1.0.1.1/src/scst_targ.c
+--- scst-1.0.1.1-orig/src/scst_targ.c 2010-03-05 18:17:22.000000000 -0800
++++ scst-1.0.1.1/src/scst_targ.c 2010-03-05 18:36:03.000000000 -0800
+@@ -1273,7 +1273,7 @@
+ return context;
+ }
+
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16)
+ static inline struct scst_cmd *scst_get_cmd(struct scsi_cmnd *scsi_cmd,
+ struct scsi_request **req)
+ {
+@@ -1325,7 +1325,7 @@
+ TRACE_EXIT();
+ return;
+ }
+-#else /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18) */
++#else /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16) */
+ static void scst_cmd_done(void *data, char *sense, int result, int resid)
+ {
+ struct scst_cmd *cmd;
+@@ -1347,7 +1347,7 @@
+ TRACE_EXIT();
+ return;
+ }
+-#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18) */
++#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16) */
+
+ static void scst_cmd_done_local(struct scst_cmd *cmd, int next_state,
+ enum scst_exec_context pref_context)
+@@ -1881,7 +1881,7 @@
+ static int scst_do_real_exec(struct scst_cmd *cmd)
+ {
+ int res = SCST_EXEC_NOT_COMPLETED;
+-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 18)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 16)
+ int rc;
+ #endif
+ bool atomic = scst_cmd_atomic(cmd);
+@@ -1948,7 +1948,7 @@
+ }
+ #endif
+
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16)
+ if (unlikely(scst_alloc_request(cmd) != 0)) {
+ if (atomic) {
+ res = SCST_EXEC_NEED_THREAD;
+@@ -1999,7 +1999,7 @@
+ scst_set_cmd_error(cmd, SCST_LOAD_SENSE(scst_sense_hardw_error));
+ goto out_done;
+
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16)
+ out_busy:
+ scst_set_busy(cmd);
+ /* go through */
+