From ff6d116e49890a7f784975e00ae9f53a381bae1f Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Tue, 13 Apr 2010 17:25:45 +0000 Subject: [PATCH] Minor mainline kernel related fixes and cleanups git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1609 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- doc/sgv_cache.txt | 2 +- iscsi-scst/kernel/event.c | 1 - iscsi-scst/kernel/target.c | 2 ++ scripts/generate-kernel-patch | 13 +++++---- scst/kernel/in-tree/Kconfig.scst | 37 +++++++++--------------- scst/kernel/in-tree/Makefile.scst-2.6.33 | 3 +- 6 files changed, 26 insertions(+), 32 deletions(-) diff --git a/doc/sgv_cache.txt b/doc/sgv_cache.txt index 64d5ceeba..133ebff46 100644 --- a/doc/sgv_cache.txt +++ b/doc/sgv_cache.txt @@ -230,5 +230,5 @@ to track and limit allocated by one or more SGV caches memory. Runtime information and statistics. -Runtime information and statistics is available in /proc/scsi_tgt/sgv. +Runtime information and statistics is available in /sys/kernel/scst_tgt/sgv. diff --git a/iscsi-scst/kernel/event.c b/iscsi-scst/kernel/event.c index acf83c391..c9dacc003 100644 --- a/iscsi-scst/kernel/event.c +++ b/iscsi-scst/kernel/event.c @@ -14,7 +14,6 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * Some functions are based on audit code. */ #include diff --git a/iscsi-scst/kernel/target.c b/iscsi-scst/kernel/target.c index d506a0afc..4983ab818 100644 --- a/iscsi-scst/kernel/target.c +++ b/iscsi-scst/kernel/target.c @@ -500,6 +500,8 @@ ssize_t iscsi_sysfs_send_event(uint32_t tid, enum iscsi_kern_event_code code, res = event_send(tid, 0, 0, info->info_cookie, code, param1, param2); if (res <= 0) { PRINT_ERROR("event_send() failed: %d", res); + if (res == 0) + res = -EFAULT; goto out_free; } diff --git a/scripts/generate-kernel-patch b/scripts/generate-kernel-patch index 9360a4f7a..3003ced0e 100755 --- a/scripts/generate-kernel-patch +++ b/scripts/generate-kernel-patch @@ -248,7 +248,7 @@ done scst_debug="scst/include/scst_debug.h scst/src/scst_debug.c" scst_proc="scst/src/scst_proc.c" -scst_sgv="scst/include/scst_sgv.h scst/src/scst_mem.h scst/src/scst_mem.c" +scst_sgv="scst/include/scst_sgv.h scst/src/scst_mem.h scst/src/scst_mem.c doc/sgv_cache.txt" scst_user="scst/include/scst_user.h scst/src/dev_handlers/scst_user.c" scst_vdisk="scst/src/dev_handlers/scst_vdisk.c" separate_patches="scst_debug scst_proc scst_sgv scst_user scst_vdisk" @@ -309,6 +309,8 @@ do fi if [ "${f#scst/include}" != "${f}" ]; then add_file "${f}" "include/scst/${f#scst/include/}" + elif [ "${f#doc}" != "${f}" ]; then + add_file "${f}" "Documentation/scst/${f#doc/}" else add_file "${f}" "drivers/scst/${f#scst/src/}" fi @@ -316,9 +318,10 @@ do | process_patch "${s}.diff" done -add_file "scst/README_in-tree" "Documentation/scst/README.scst" \ -| process_patch "scst_core_doc.diff" - +{ + add_file "scst/README_in-tree" "Documentation/scst/README.scst" + add_file "scst/SysfsRules" "Documentation/scst/SysfsRules" +} | process_patch "scst_core_doc.diff" # Directory drivers/scst/dev_handlers/ @@ -370,7 +373,7 @@ do fi done -add_file "iscsi-scst/include/iscsi_scst_itf_ver.h" "include/scst/iscsi_scst_itf_ver.h" | process_patch "" +add_file "iscsi-scst/include/iscsi_scst_itf_ver.h" "include/scst/iscsi_scst_itf_ver.h" add_file "iscsi-scst/kernel/Makefile.in-kernel" \ "drivers/scst/iscsi-scst/Makefile" diff --git a/scst/kernel/in-tree/Kconfig.scst b/scst/kernel/in-tree/Kconfig.scst index feab9f97a..83de13c56 100644 --- a/scst/kernel/in-tree/Kconfig.scst +++ b/scst/kernel/in-tree/Kconfig.scst @@ -2,7 +2,7 @@ menu "SCSI target (SCST) support" config SCST tristate "SCSI target (SCST) support" - depends on SCSI && PROC_FS + depends on SCSI help SCSI target (SCST) is designed to provide unified, consistent interface between SCSI target drivers and Linux kernel and @@ -12,66 +12,59 @@ config SCST config SCST_DISK tristate "SCSI target disk support" default SCST - depends on SCSI && PROC_FS && SCST + depends on SCSI && SCST help SCST pass-through device handler for disk device. config SCST_TAPE tristate "SCSI target tape support" default SCST - depends on SCSI && PROC_FS && SCST + depends on SCSI && SCST help SCST pass-through device handler for tape device. config SCST_CDROM tristate "SCSI target CDROM support" default SCST - depends on SCSI && PROC_FS && SCST + depends on SCSI && SCST help SCST pass-through device handler for CDROM device. config SCST_MODISK tristate "SCSI target MO disk support" default SCST - depends on SCSI && PROC_FS && SCST + depends on SCSI && SCST help SCST pass-through device handler for MO disk device. config SCST_CHANGER tristate "SCSI target changer support" default SCST - depends on SCSI && PROC_FS && SCST + depends on SCSI && SCST help SCST pass-through device handler for changer device. config SCST_PROCESSOR tristate "SCSI target processor support" default SCST - depends on SCSI && PROC_FS && SCST + depends on SCSI && SCST help SCST pass-through device handler for processor device. config SCST_RAID tristate "SCSI target storage array controller (RAID) support" default SCST - depends on SCSI && PROC_FS && SCST + depends on SCSI && SCST help SCST pass-through device handler for raid storage array controller (RAID) device. config SCST_VDISK tristate "SCSI target virtual disk and/or CDROM support" default SCST - depends on SCSI && PROC_FS && SCST + depends on SCSI && SCST help SCST device handler for virtual disk and/or CDROM device. -config SCST_USER - tristate "SCSI user space virtual target devices support" - default SCST - depends on SCSI && PROC_FS && SCST && ! HIGHMEM - help - SCST device handler for virtual user space device. - config SCST_STRICT_SERIALIZING bool "Strict serialization" depends on SCST @@ -164,7 +157,7 @@ config SCST_TRACING default y help Enable SCSI middle level tracing support. Tracing can be controlled - dynamically via /proc/scsi_tgt/trace_level. The traced information + dynamically via sysfs interface. The traced information is sent to the kernel log and may be very helpful when analyzing the cause of a communication problem between initiator and target. @@ -240,16 +233,14 @@ config SCST_MEASURE_LATENCY depends on SCST help This option enables commands processing latency measurement - facility in SCST. It will provide in /proc/scsi_tgt/latency - file average commands processing latency. You can clear - already measured results by writing 0 in this file. Note, you - need a non-preemtible kernel to have correct results. + facility in SCST. It will provide in the sysfs interface + average commands processing latency statistics. You can clear + already measured results by writing 0 in the corresponding sysfs file. + Note, you need a non-preemtible kernel to have correct results. If unsure, say "N". source "drivers/scst/iscsi-scst/Kconfig" -source "drivers/scst/qla2xxx-target/Kconfig" source "drivers/scst/srpt/Kconfig" -source "drivers/scst/scst_local/Kconfig" endmenu diff --git a/scst/kernel/in-tree/Makefile.scst-2.6.33 b/scst/kernel/in-tree/Makefile.scst-2.6.33 index 0d899ce13..32db60d49 100644 --- a/scst/kernel/in-tree/Makefile.scst-2.6.33 +++ b/scst/kernel/in-tree/Makefile.scst-2.6.33 @@ -3,10 +3,9 @@ ccflags-y += -Iinclude/scst -Wno-unused-parameter scst-y += scst_main.o scst-y += scst_targ.o scst-y += scst_lib.o -scst-y += scst_proc.o +scst-y += scst_sysfs.o scst-y += scst_mem.o scst-y += scst_debug.o obj-$(CONFIG_SCST) += scst.o dev_handlers/ iscsi-scst/ qla2xxx-target/ srpt/ \ scst_local/ -