Make sure that the definition of swap() is guarded by
"#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)" only instead
of "#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 28)" and
"#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)".
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5592 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Move all management commands from scst_delayed_mgmt_cmd_list to the
active command list during resume instead of only the first one.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5589 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Add support for 32-bit LUN numbers. As soon as the patches that add
64-bit LUN support are upstream this patch will also make 64-bit
LUN support available in scst_local.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5588 d57e44dd-8a1f-0410-8b47-8ef2f437770f
The datatype of scsi_device.lun will be changed from u32 into u64
in the near future. Update SCST accordingly. These changes have
been implemented such that these are compatible with 32-bit and
64-bit LUNs.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5587 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Make the code slightly easier to read by introducing temporary
variables for the expressions 'tgt_dev->sess' and 'sess->tgt->tgtt'.
This patch does not change any functionality.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5586 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Avoid that building scst with W=1 triggers compiler warnings about
variables that are set but not used. See also the documentation of
the gcc compiler flag -Wunused-but-set-variable.
This patch does not change any functionality.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5585 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Avoid that building the scst kernel module fails on RHEL 5 due to
a missing kvasprintf() implementation.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5584 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
This avoids that the following checkpatch complaint is triggered:
Do not include the paragraph about writing to the Free Software Foundation's
mailing address from the sample GPL notice. The FSF has changed addresses in
the past, and may do so again. Linux already includes a copy of the GPL.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5572 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Change a few occurrences of "conformation" into "confirmation". See also the
QLogic 2500 Series Firmware Interface Specification.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5555 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Add an attribute called "read_zero" to vdisk_nullio devices that
controls whether or not READs from a vdisk_nullio device return
zeroed data buffers.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5539 d57e44dd-8a1f-0410-8b47-8ef2f437770f
After SCST_FLAG_SUSPENDED has been cleared it is essential that
scst_do_job_init() reexamines scst_init_cmd_list to avoid that
commands get stuck in the command init list. This patch fixes the
following race condition that can occur if SCST_FLAG_SUSPENDED
has been set and if scst_init_cmd_list is not empty:
* scst_do_job_init() returns to scst_init_thread() and leaves the
commands that were on the init list on that list.
* scst_init_thread() invokes test_init_cmd_list().
* test_init_cmd_list() returns false because SCST_FLAG_SUSPENDED
has been set.
* scst_resume_activity() clears SCST_FLAG_SUSPENDED and invokes
wake_up_all(&scst_init_cmd_list_waitQ). However, since
scst_init_thread() has not yet added the init thread back to
scst_init_cmd_list_waitQ this wake_up_all() call doesn't do
anything.
* scst_init_thread() adds the init thread to scst_init_cmd_list_waitQ
and unlocks scst_init_lock.
Additionally, remove an unneeded smp_mb__after_clear_bit() call.
wake_up_all() guarantees that if it wakes up a thread that that
thread sees all store operations that were performed by the thread
that invoked wake_up_all() and that preceeded the wake_up_all()
invocation.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5524 d57e44dd-8a1f-0410-8b47-8ef2f437770f
The possible return values of scst_init_cmd() are -1, 0 and 1. Mention
this in the comment header above that function.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5523 d57e44dd-8a1f-0410-8b47-8ef2f437770f