Avoid that checkpatch reports the following warning:
WARNING: type 'long long unsigned' should be specified in 'unsigned long long' order.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5885 d57e44dd-8a1f-0410-8b47-8ef2f437770f
For SCST devices with a short name determining which SCST command
threads serve a given LUN requires an (expensive) walk of the
process table. For SCST devices with a long name it is not possible
to determine unambiguously which command threads serve a given
LUN. Hence add a thread_pid sysfs attribute that makes it easy to
figure out which command threads serve a LUN.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5851 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Instead of adding sg[idx].offset to addr and immediately subtracting
sg[idx].offset again, leave out both arithmetic operations.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5735 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Since scst.h contains a backport of the definition of set_cpus_allowed_ptr(),
the set_cpus_allowed() invocations are superfluous. Hence remove these.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5734 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Avoid that the checkpatch tool included in Linux kernel v3.16 reports the
following warning:
macros should not use a trailing semicolon
This patch does not change any functionality.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5724 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Start at the proper offset in the receive buffer if sg[0].offset != 0.
Return the proper data to the initiator if sg[0].offset != 0.
This patch reworks trunk r5281, "iscsi-scst: fix offset
calculation", February 13, 2014.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5683 d57e44dd-8a1f-0410-8b47-8ef2f437770f
With CONFIG_BUG=y both BUG() and BUG_ON(1) halt the system. However,
with CONFIG_BUG=n BUG() halts the system but BUG_ON(1) not. To avoid
such subtleties, change BUG_ON(1) into BUG().
See also patch Josh Triplett, "bug: Make BUG() always stop the machine",
7 April 2014 (commit ID a4b5d580e07875f9be29f62a57c67fbbdbb40ba2).
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5618 d57e44dd-8a1f-0410-8b47-8ef2f437770f
The cpus_*() functions were deprecated via patch "cpumask:
introduce new API, without changing anything" (November 2008,
commit ID 2d3854a37e8b). Hence switch from the cpus_*() API to
the cpumask_*() API.
This patch has the intended side effect of not adding the "[key]"
property to cpumask sysfs attributes that contain the default
cpumask. The current code namely reads uninitialized bits on
systems where nr_cpu_ids < NR_CPUS because cpus_equal() compares
more bits than those that were set by cpumask_copy().
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5596 d57e44dd-8a1f-0410-8b47-8ef2f437770f
The lockdep_assert_held() macro is a convenient debugging tool.
However, it is inconvenient to surround each invocation of that
macro by an #ifdef/#endif pair. Hence make it easier to use this
macro with older kernel versions.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5573 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Assign one major number per thread pool instead of as many major
numbers as there are threads in a thread pool. Do not increment
'major' if thread pool allocation fails. Micro-optimize
iscsi_threads_pool_get() by eliminating the assignment to 'fn'
and the write via snprintf() into name[].
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5520 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Fix the following checkpatch 3.14 warning:
Unnecessary parentheses - maybe == should be = ?
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5435 d57e44dd-8a1f-0410-8b47-8ef2f437770f
May be not completed, because this kernel has too many internal issues
reported after enabling "Kernel hacking" config options
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5163 d57e44dd-8a1f-0410-8b47-8ef2f437770f
The following procfs-related changes have been included in kernel 3.10:
- The PDE() macro has been removed from <linux/proc_fs.h>.
- The create_proc_entry() function has been removed.
- The proc_info field has been removed from struct scsi_host_template.
Unbreak the procfs build for kernel versions >= 3.10
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5148 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Avoid that sparse complains about a local symbol not having been declared
static (scst_pool_dep_map and scst_conn_dep_map). Also avoid that sparse
reports these two variables as unused in the procfs build.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5110 d57e44dd-8a1f-0410-8b47-8ef2f437770f
the timeout value. The problem is that if commands were started at
00:00:05 and 00:00:10 and the timeout value was 15 seconds and the
first command completed ok, then conn_rsp_timer_fn would have run
at 00:00:20 and rescheduled the next conn_rsp_timer_fn run for 15
secs from that time (00:00:35). But, we would have wanted to check on
the second command at 15 secs after its write_start time which is
00:00:25.
This patch has us reschedule the next conn_rsp_timer_fn run for
the req's write_start time + its timeout.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5093 d57e44dd-8a1f-0410-8b47-8ef2f437770f
1. If we have a nop in flight then we do not really need to send
more to test if the other side is still there. Either that nop
will timeout and conn will be dropped or it will complete
and last_rcv_time will be updated.
2. We are sending nop-ins every nop_in_interval seconds, but if
we got a data half way in to the window, then when conn_nop_in_delayed_work_fn
is run it was scheduling the next check to be nop_in_interval more
seconds. With the current settings this could end up with us waiting
59 secs before sending a nop and about 130 secs for it to timeout, when
at 61 it should be timing out and getting cleaned up already. This patch
has us take into account when the last time we got data to try and
reschedule the next nop check closer to nop_in_interval from that time.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5092 d57e44dd-8a1f-0410-8b47-8ef2f437770f
when a command/data is in the process of being sent. The snd
buffer space goes to zero and sendpage returns -EAGAIN. We then
wait for space to open. If space never opens then the cmd rsp timer
fires and the session/connection is dropped.
During that time we could try to send a nop as a ping, but it
is stuck behind that other command that got EAGAIN and we are
waiting for space to open to send them. We would expect the
nop in timer to fire before the cmd rsp timer, but it cannot
becuase the nop is sitting in the internal iscsi-scst queue.
This patch just has us start the timer ont he nop in right
away.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5091 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This patch does not change any functionality other than the message
printed when it takes more than one second before the completion is
signalled.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5086 d57e44dd-8a1f-0410-8b47-8ef2f437770f