It, hopefully, fixes compilation problems on CentOS 5.2 as well as on vanilla kernels <2.6.28
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@638 d57e44dd-8a1f-0410-8b47-8ef2f437770f
WARNING! This commit changes external SCST interface, so it can break compilation of your out of SCST SVN tree target driver or dev handler. To fix it, simply supply the preferred exection context to scst_cmd_done() and/or scst_tgt_cmd_done().
Thanks to Bart Van Assche <bart.vanassche@gmail.com> for pointing on it.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@556 d57e44dd-8a1f-0410-8b47-8ef2f437770f
declarations by inserting the keyword static where appropriate.
This patch has been verified by rereading the patch carefully, and by verifying
that SCST source code still compiles fine.
Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@539 d57e44dd-8a1f-0410-8b47-8ef2f437770f
CONFIG_INFINIBAND_SRPT. This is a reminiscent from the time when the SRPT code
resided in the directory drivers/infiniband/ulp/srpt. Since this code has been moved
into the directory drivers/scst/srpt, the path below renames this config option
into CONFIG_SCST_SRPT. The other changes present in this patch are:
- Removed srpt/src/Makefile.infiniband.Linux-2.6.2[45].patch since these files are obsolete.
- Rewrote Kconfig help text slightly.
The patch below has been tested by verifying that the 2.6.26.5 kernel + SCST
patch still compiles cleanly with CONFIG_SCST_SRPT=m.
Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@518 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This patch has been tested by verifying that:
- the patched Linux 2.6.25.17 and 2.6.26.5 kernel trees still compile when
CONFIG_INFINIBAND_SRPT=m is present in .config (verified that
make -k modules only complains about a missing qla2xxx-target directory).
- the SCST out-of-tree source code still compiles fine against the 2.6.25 kernel
(make -s clean && make -C srpt -s clean && make -s scst iscsi-scst && make -C srpt -s).
- checkpatch output is identical for the output of scripts/generate-kernel-patch 2.6.25
and scripts/generate-kernel-patch 2.6.26.
Based on patch from Vu Pham <vu@mellanox.com>
Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@516 d57e44dd-8a1f-0410-8b47-8ef2f437770f
ERROR: return is not a function, parentheses are not required
This patch has been tested by verifying that the newly generated patch still
applies without warnings to the 2.6.25.17 kernel and that the patched kernel
still compiles.
Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@513 d57e44dd-8a1f-0410-8b47-8ef2f437770f
an external module. When applying the SCST kernel patch to the mainstream
kernel tree with debugging and/or tracing enabled however, the resulting code
triggers a compiler error. This is because the symbols DEBUG and TRACING
conflict with symbols with the same named defined in unrelated kernel headers.
The patch below resolves these conflicts by renaming the following preprocessor
symbols:
- DEBUG into CONFIG_SCST_DEBUG.
- DEBUG_DIGEST_FAILURES into CONFIG_SCST_ISCSI_DEBUG_DIGEST_FAILURES.
- DEBUG_OOM into CONFIG_SCST_DEBUG_OOM.
- DEBUG_RETRY into CONFIG_SCST_DEBUG_RETRY.
- DEBUG_SN into CONFIG_SCST_DEBUG_SN.
- DEBUG_TM into CONFIG_SCST_DEBUG_TM.
- EXTRACHECKS into CONFIG_SCST_EXTRACHECKS.
- SCST_HIGHMEM into CONFIG_SCST_HIGHMEM.
- STRICT_SERIALIZING into CONFIG_SCST_STRICT_SERIALIZING.
- TM_DBG_GO_OFFLINE into CONFIG_SCST_TM_DBG_GO_OFFLINE. Mapped 0/1 values
into macro undefined / macro defined.
- TRACING into CONFIG_SCST_TRACING.
- USE_EXPECTED_VALUES into CONFIG_SCST_USE_EXPECTED_VALUES.
- In qla_isp/linux/isp_scst.c, renamed DEBUG into DEBUG_ISP_SCST.
- In qla_isp/..., renamed SCSI_TARGET in SCST_SCSI_TARGET.
- In qla_isp/..., renamed SCSI_TARGET_DEV in SCST_SCSI_TARGET_DEV.
Additionally, all CONFIG_SCSI_TARGET* macro's are renamed into CONFIG_SCST* in
order to avoid confusion between the STGT CONFIG-symbols and the SCST CONFIG-
symbols.
The following additional options are now configurable through Kconfig:
- CONFIG_SCST_ISCSI_DEBUG_DIGEST_FAILURES
- CONFIG_SCST_STRICT_SERIALIZING
- CONFIG_SCST_STRICT_SECURITY
- CONFIG_SCST_ALLOW_PASSTHROUGH_IO_SUBMIT_IN_SIRQ
- CONFIG_SCST_ABORT_CONSIDER_FINISHED_TASKS_AS_NOT_EXISTING
- CONFIG_SCST_USE_EXPECTED_VALUES
- CONFIG_SCST_DEBUG_OOM
- CONFIG_SCST_DEBUG_RETRY
- CONFIG_SCST_DEBUG_SN
- CONFIG_SCST_DEBUG_TM
- CONFIG_SCST_TM_DBG_GO_OFFLINE
The patch below has been verified as follows:
- Verified that the following command does not print any new warning messages:
make -s clean && make -C srpt -s clean && make -s scst iscsi-scst && make -C srpt -s
- Verified as follows that the internal SCST patches still apply cleanly:
for p in *patch; do patch -p0 --dry-run -f -s <$p; done
- Checked that the patch generated by generate-kernel-patch still applies
cleanly to the 2.6.25.7 kernel, and that the patched kernel tree still
compiles, installs and boots fine, that the iscsi-scst, ib_srpt,
scst_disk and scst_vdisk modules still load, and that iSCSI communication
still works fine. All SCST kernel configuration options that could be
enabled have been enabled during this test.
Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@453 d57e44dd-8a1f-0410-8b47-8ef2f437770f
- changing Makefile to compile srpt out-of scst tree and in release mode
- fixing checkpath warnings for kernel inclusion
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@450 d57e44dd-8a1f-0410-8b47-8ef2f437770f
The patch below fixes the following checkpatch warning:
__func__ should be used instead of gcc specific __FUNCTION__
This patch has been tested as follows:
- Checked that make -C ib_srpt still works.
- Checked that the patch generated by generate-kernel-patch still applies
cleanly to the 2.6.25.4 kernel, that the patched kernel still compiles,
installs and boots and that the scst, iscsi-scst and ib_srpt modules still
load (I performed rm -rf /lib/modules/2.6.25.4* before starting kernel
compilation).
Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@409 d57e44dd-8a1f-0410-8b47-8ef2f437770f
The patch below fixes the checkpatch complaints on kfree():
WARNING: kfree(NULL) is safe this check is probabally not required
This patch has been verified as follows:
- Verified that checkpatch does no longer complain about kfree().
- Verified that make -s clean && make -s iscsi scst && make -s -C srpt
still works and does not trigger any new compiler warnings.
- Checked that the patch generated by generate-kernel-patch still applies
cleanly to the 2.6.25.4 kernel, and that the patched kernel tree still
compiles, installs and boots fine, and that the iscsi-scst, ib_srpt,
scst_disk and scst_vdisk modules still load.
Note: I'm not sure any of the above verifications did trigger the code paths
changed by this patch.
Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@402 d57e44dd-8a1f-0410-8b47-8ef2f437770f
The patch below fixes the following categories of checkpatch complaints:
- ERROR: switch and case should be at the same indent
- ERROR: do not initialise statics to 0 or NULL
- ERROR: use tabs not spaces
I have verified that the SCST source code still compiles.
Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@398 d57e44dd-8a1f-0410-8b47-8ef2f437770f
The patch below fixes the following class of checkpatch.pl errors:
ERROR("(foo*)" should be "(foo *)".
Or: another whitespace-only change.
I have verified that the output of svn diff -w -x is empty for this patch.
Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@383 d57e44dd-8a1f-0410-8b47-8ef2f437770f
The patch below fixes another category of checkpatch warnings, namely:
ERROR: "foo * bar" should be "foo *bar"
This patch has been verified by checking that the output of svn diff -x -w is
empty.
Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@382 d57e44dd-8a1f-0410-8b47-8ef2f437770f
The patch below implements the following changes:
- Fixes the remaining warnings reported by checkpatch.pl with regard to the use
of whitespace in C code.
- Adds double qoutes around some #warning messages, such that checkpatch.pl
does no longer try to interprete the text behind the #warning preprocessor
directive.
- Adds an extra conversion to the generate-kernel-patch script that removes
the single space from before goto-labels while generating the kernel patch.
This patch has been tested as follows:
- Verified that svn diff -x -w only shows changes in the #warning preprocessor directives.
- Verified the output of svn diff by reading it.
- Verified that checkpatch.pl does no longer complain on the use of whitespace
(searched through the checkpatch.pl output for the text ' space').
- Verified that the patch generated by the generate-kernel-patch script still
applies cleanly to the 2.6.24 kernel, and that the patched kernel still compiles cleanly.
Please let me know if I have to resubmit parts of this patch to other SCST authors.
Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@381 d57e44dd-8a1f-0410-8b47-8ef2f437770f
One of the Linux kernel patch submission requirements is that source files do
not contain trailing whitespace. The patch below removes trailing whitespace
from .c and .h source files.
Note: it might be more convenient to run the script I used to generate this
patch than to review and apply the patch below. This is how I generated and
verified the patch below:
cat <<EOF >./strip-trailing-whitespace
#!/bin/bash
trap "rm -f $t" EXIT
t=/tmp/temporary-file.$$
for f in "$@"
do
sed 's/[ ]*$//' <"$f" >"$t" && mv "$t" "$f"
done
EOF
chmod a+x ./strip-trailing-whitespace
find -name '*.[ch]' | xargs ./strip-trailing-whitespace
svn diff -x -w
Signed-off-by: <bart.vanassche@gmail.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@377 d57e44dd-8a1f-0410-8b47-8ef2f437770f
By this time I have reworked the update of scripts/generate-kernel-patch'>scripts/generate-kernel-patch.
These are the changes that were already present in version 1 of this patch
and that have been kept in this patch:
- The SCST code has been moved from drivers/scsi/scsi_tgt to drivers/scst.
- Moved SCST header files from include/scsi_tgt to include/scst.
- Added iscsi-scst in drivers/scst/iscsi-scst.
For the time being the generate-kernel-patch does no longer try to add the
qla2x00t driver in drivers/scst/qla2x00-target -- I have not yet been able to
figure out how to get qla2x00t/qla2x00-target compiled without the initiator
code.
Just as in version 1 of this patch, the following files in the Subversion
repository have been renamed to reflect the above changes:
- Renamed scst/kernel/in-tree/Makefile.scsi.Linux-2.6.24.patch'>scst/kernel/in-tree/Makefile.scsi.Linux-2.6.24.patch to
scst/kernel/in-tree/Makefile.drivers.Linux-2.6.24.patch'>scst/kernel/in-tree/Makefile.drivers.Linux-2.6.24.patch.
- Renamed Kconfig'>scst/kernel/in-tree/Kconfig.scsi.Linux-2.6.24.patch to
scst/kernel/in-tree/Kconfig.drivers.Linux-2.6.24.patch'>scst/kernel/in-tree/Kconfig.drivers.Linux-2.6.24.patch.
- Renamed scst/kernel/in-tree/Makefile.scsi_tgt'>scst/kernel/in-tree/Makefile.scsi_tgt to
scst/kernel/in-tree/Makefile.scst'>scst/kernel/in-tree/Makefile.scst.
- Renamed scst/kernel/in-tree/Kconfig.scsi_tgt'>scst/kernel/in-tree/Kconfig.scsi_tgt to
scst/kernel/in-tree/Kconfig.scst'>scst/kernel/in-tree/Kconfig.scst.
Because of the above changes the include path specified in the following
Makefiles had to be changed:
- scst/kernel/in-tree/Makefile.dev_handlers'>scst/kernel/in-tree/Makefile.dev_handlers
- srpt/src/Makefile.in_kernel'>srpt/src/Makefile.in_kernel
Other changes:
- I have added menu/endmenu entries in file scst/kernel/in-tree/Kconfig.scst
such that the SCST entries become visible when running make xconfig or make
menuconfig.
- Elaborated the SCST help texts a little bit (in file
scst/kernel/in-tree/Kconfig.scst).
New in version 2 of this patch:
- Moved remaining patches in the generate-kernel-patch script to separate
files.
- Added support for the 2.6.25 kernel.
This patch has been tested as follows:
mkdir -p tmp
cd tmp
rm -rf linux-2.6.25.3 /lib/modules/2.6.25.3-scst
tar xjf ~vanasscb/software/downloads/linux-2.6.25.3.tar.bz2
cd linux-2.6.25.3
cp ../.config-2.6.25 .
(cd ~vanasscb/software/scst
&& ~vanasscb/software/scst/scripts/generate-kernel-patch \
2.6.25) | patch -p1
make oldconfig
diff ../.config .
make xconfig
make menuconfig
make -j5 bzImage modules
make modules_install install
cp -r /lib/firmware/$(uname -r) /lib/firmware/2.6.25.3-scst
update-initramfs -k 2.6.25.3-scst -c
reboot
modprobe iscsi-scst
modprobe ib_srpt
lsmod | grep -E 'scst|ib_srpt'
dmesg
Signed-off-by: bart.vanassche@gmail.com
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@373 d57e44dd-8a1f-0410-8b47-8ef2f437770f
The script generate-kernel-patch generates a kernel tree based on the sources
and the in-tree kernel patches in the SCST Subversion repository. When I
submitted the first version of the generate-kernel-patch script most but not
all in-tree patches were present as separate files in the SCST Subversion
repository. The patch below moves the two remaining patches that are contained
inline in the generate-kernel-patch script to separate files. This should
make it possible to use the script on future Linux kernels without having to
modify the script itself. The patch below does not contain functional
changes, it only moves two patches out of the script.
Modified:
* scripts/generate-kernel-patch'>scripts/generate-kernel-patch
Added:
* srpt/src/Makefile.infiniband.Linux-2.6.24.patch'>srpt/src/Makefile.infiniband.Linux-2.6.24.patch
* srpt/src/Kconfig.infiniband.Linux-2.6.24.patch'>srpt/src/Kconfig.infiniband.Linux-2.6.24.patch
Also Makefile and Kconfig files were renamed (".drivers." was replaced by ".scsi.")
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@369 d57e44dd-8a1f-0410-8b47-8ef2f437770f
- Added Makefile.scsi.Linux-2.6.24.patch and Kconfig.scsi.Linux-2.6.24.patch
- Updated Makefile.scsi_tgt to reflect move of the SCST device handlers from scst/src/ to scst/src/dev_handlers/
- Added Makefile.dev_handlers
- SCST include path fixed in srpt/ Makefile.in_kernel
- Added script for converting the SCST source tree to a kernel patch. More comment on it:
The SCST source tree as it exists in the current Subversion repository will
have to be maintained for some time. And if SCST is submitted for inclusion
in the mainline kernel, this tree will have to be converted to a kernel
patch, reviewer comments will have to be processed, and the patch will have
to be resubmitted. So it's convenient to have a script available that
converts the Subversion source tree into a kernel patch. The patch below does
just that: convert the scst and srpt directories into a kernel patch
(iscsi-scst support will be added later on). I have tested the script
contained in the patch below as follows:
rm -rf linux-2.6.24
rm -rf /lib/modules/2.6.24-scst
tar xjf ~vanasscb/software/downloads/linux-2.6.24.tar.bz2
cd linux-2.6.24
cp ../.config .
(cd ~vanasscb/software/scst
&& ~vanasscb/software/scst/scripts/generate-kernel-patch \
2.6.24) | patch -p1
make -j5 bzImage modules && make modules_install install
cp -r /lib/firmware/$(uname -r) /lib/firmware/2.6.24-scst
update-initramfs -k 2.6.24-scst -c
reboot
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@366 d57e44dd-8a1f-0410-8b47-8ef2f437770f
- Minor external interface change: now target drivers should set for aborted commands SCST_CMD_DELIVERY_ABORTED status via scst_set_delivery_status(). In-tree drivers updated.
- Fixed broken compilation if put_page_callback patch not applied to the kernel. Reported by Erez Zilber <erezz@Voltaire.COM>
- Fixed several minor problems reported by David Berton <davidbrt@yahoo.com>
- Fixed __exit misuse, when such functions called from __init functions.
- Docs updated.
- Other minor changes and cleanups.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@364 d57e44dd-8a1f-0410-8b47-8ef2f437770f