This patch fixes some occurrences of the following 3.3 checkpatch warning:
WARNING: Too many leading tabs - consider code refactoring
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4173 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Fix three occurrences of the following warnings reported by the checkpatch
script included with Linux kernel version 3.3:
WARNING: min() should probably be min_t()
WARNING: max() should probably be max_t()
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4172 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Make it more clear that scst_mgmt_cmd.tag refers to the tag of the
command to abort and not to the tag of the ABORT TASK command itself.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4171 d57e44dd-8a1f-0410-8b47-8ef2f437770f
The LUN argument is ignored while processing SCST_UNREG_SESS_TM, so don't
pass LUN information when issuing that task management function.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4170 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This patch:
* fixes signatures for log_debug and log_pdu macros
* collapses __log_<LEVEL> functions into one
* adds conditional logging
Here conditional logging means that the logging priority and logging level may
vary depending on some dynamic parameters. This is helpful when software is
able to recover from errors which occur periodically and hence, there is no
need to pollute system logs with tons of repetitive non-critical lines.
The following macros are added to support this feature:
* log_info_cond
* log_warning_cond
* log_error_cond
They take an additional first parameter called "level". If it is 0 then they
act as their non-cond counterparts, otherwise they act like log_debug with the
specified level.
Those who are not interested in conditional logging are not affected: they can
continue using plain old logging macros without any changes.
Signed-off-by: Sergey Myasnikov <tigra564@gmail.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4161 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This patch moves the following utility functions from iscsi_scstd.c to misc.c
and makes them public (i.e. non-static):
* set_non_blocking
* sock_set_keepalive
Signed-off-by: Sergey Myasnikov <tigra564@gmail.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4160 d57e44dd-8a1f-0410-8b47-8ef2f437770f
for disk or CD-ROM devices, so make sure scst_vdisk rejects it.
+
added the corresponding cleanups in scst_lib.c and fileio/common.c + updated scst_scsi_op_table
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4156 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Fixed this by destroying cm_id before QP instead of after. The following
messages were logged if the use-after-free occurred:
mlx4_core 0000:08:00.0: command 0x19 failed: fw status = 0x9
ib_srpt: ***ERROR***: srpt_init_ch_qp() failed (-9)
ib_srpt: ***ERROR***: rejected SRP_LOGIN_REQ because creating a new RDMA channel failed.
ib_srpt: Rejecting login with reason 0x10001
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4139 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Recent versions of the checkpatch script complain about strict_strtoul()
and simple_strtoul(), so convert calls to these functions into a call to
kstrtoul() or sscanf(). Convert loops that scan for the
next-(non-)whitespace character into a call to scst_get_next_lexem().
Make __scst_process_luns_mgmt_store() a little more strict by checking
for extraneous parameters past the last argument. Fix the value "res"
returned for the SCST_TRACE_ACTION_VALUE processing code.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4137 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Replace a loop by a single instruction, namely bsr (bit scan reverse).
From the disassembler output of scst_calc_block_shift() on an x86_64
system:
0x0000000000001493 <+35>: bsr %edx,%ecx
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4134 d57e44dd-8a1f-0410-8b47-8ef2f437770f