Fix for user space part of the iSCSI target, which refused connections in the procfs...
authorvlnb <vlnb@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Fri, 6 Nov 2009 19:28:27 +0000 (19:28 +0000)
committervlnb <vlnb@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Fri, 6 Nov 2009 19:28:27 +0000 (19:28 +0000)
git-svn-id: https://scst.svn.sourceforge.net/svnroot/scst/trunk@1326 d57e44dd-8a1f-0410-8b47-8ef2f437770f

iscsi-scst/Makefile
iscsi-scst/include/iscsi_scst_ver.h
iscsi-scst/usr/target.c

index 2a7d31f..eb5e270 100644 (file)
@@ -15,6 +15,7 @@ SBINDIR := /usr/local/sbin
 INITDIR := /etc/init.d
 RCDIR := /etc/rc.d
 KMOD := $(shell pwd)/kernel
+INCDIR := $(shell pwd)/include
 
 ifeq ($(KVER),)
   ifeq ($(KDIR),)
@@ -120,7 +121,13 @@ perf2debug:
        rm $(KMOD)/Makefile.aa
 
 disable_proc:
+       sed -i.aa s/"^#define CONFIG_SCST_PROC"/"\/* #define CONFIG_SCST_PROC *\/"/ $(INCDIR)/iscsi_scst_ver.h
+       @cmp $(INCDIR)/iscsi_scst_ver.h $(INCDIR)/iscsi_scst_ver.h.aa >/dev/null; if [[ $$? = 0 ]]; then rm $(INCDIR)/iscsi_scst_ver.h.aa; echo "sed failed"; false; fi
+       rm $(INCDIR)/iscsi_scst_ver.h.aa
 
 enable_proc:
+       sed -i.aa s/"\/\* #define CONFIG_SCST_PROC \*\/"/"#define CONFIG_SCST_PROC"/ $(INCDIR)/iscsi_scst_ver.h
+       @cmp $(INCDIR)/iscsi_scst_ver.h $(INCDIR)/iscsi_scst_ver.h.aa >/dev/null; if [[ $$? = 0 ]]; then rm $(INCDIR)/iscsi_scst_ver.h.aa; echo "sed failed"; false; fi
+       rm $(INCDIR)/iscsi_scst_ver.h.aa
 
 .PHONY: all mods progs install clean extraclean debug2release release2debug debug2perf perf2debug disable_proc enable_proc
index a00cef8..fd3f8a1 100644 (file)
  *  GNU General Public License for more details.
  */
 
-#define ISCSI_VERSION_STRING   "1.0.2/0.4.17r214"
+#define CONFIG_SCST_PROC
+
+#ifdef CONFIG_SCST_PROC
+#define ISCSI_VERSION_STRING_SUFFIX  "-procfs"
+#else
+#define ISCSI_VERSION_STRING_SUFFIX
+#endif
+
+#define ISCSI_VERSION_STRING   "1.0.2/0.4.17r214" ISCSI_VERSION_STRING_SUFFIX
index 0959934..6a3bba3 100644 (file)
@@ -155,6 +155,9 @@ int target_add(u32 *tid, char *name)
        INIT_LIST_HEAD(&target->sessions_list);
        INIT_LIST_HEAD(&target->isns_head);
        target->tid = *tid;
+#ifdef CONFIG_SCST_PROC
+       target->tgt_enabled = 1;
+#endif
        insque(&target->tlist, &targets_list);
 
        isns_target_register(name);