Introduce the new sg_rq_state enumerations for tracking the
lifetime of a sg_request. SG_RQ_DATA_THRESHOLD is a
default value that if the data length of a request exceeds
then, after that request is completed, the data buffer will
be freed up as the sg_request object is placed on the free
list.
Complete the locking and structure changes of ioctl and debug
('cat /proc/scsi/sg/debug') handling.
Signed-off-by: Douglas Gilbert
---
This was the code that was "#if 0'-ed out 2 patches ago. It
also shuts checkpatch.pl up as it doesn't like that technique
but offers no viable substitute.
The intention is to add two new ioctls as proposed by Linus Torvalds:
SG_IOSUBMIT and SG_IORECEIVE to replace the write()/read() async
interface.
But first, clean up the driver and remove the SG_MAX_QUEUE limit of
no more than 16 queued commands on a file descriptor at a time. A
free list has
Introduce the SG_LOG macro to replace long-winded
'SCSI_LOG_TIMEOUT(3, sg_printk ...' debug messages. Use __func__
wherever appropriate to make the debug messages more portable.
Signed-off-by: Douglas Gilbert
---
drivers/scsi/sg.c | 162 +-
1 file
Split scsi/sg.h into a smaller scsi/sg.h which includes a new header:
uapi/scsi/sg.h . Overall expand the twin header files with new
functionality in this patchset and functionality to be added in the
next patchset to implement SG_IOSUBMIT and friends. Adjust format to
modern kernel conventions.
Rework ioctl handling, report clearly to the log which ioctl has
been invoked. Add a new "IOWR" ioctl: SG_SET_GET_EXTENDED which
permits several integer and boolean values to be "_SET_" (i.e.
passed into the driver, potentially changing its actions) and/or
read from the driver (the "_GET_" part)
= 30901;/* 2 digits for each
component */
#ifdef CONFIG_SCSI_PROC_FS
#include
-static char *sg_version_date = "20181019";
+static char *sg_version_date = "20181020";
static int sg_proc_init(void);
#endif
@@ -95,6 +95,10 @@ enum sg_rq_state {
#define SG_DEF_TIME_
Remove fixed 16 sg_request object array and replace with an active
rq_list plus a request free list. Add finer grained spin lock to
sg_request and do a major rework on locking. sg_request objects now
are only de-allocated when the owning file descriptor is closed.
This simplifies locking issues.
Remove typedefs and use better type names like bool and u8 where
appropriate. Rename some variables and functions for clarity.
Adjust formatting (e.g. function definitions) to be more
consistent across the driver.
Signed-off-by: Douglas Gilbert
---
The intention is to move to sg_version_num
On Fri, Oct 19, 2018 at 12:19:09PM +0300, Dan Carpenter wrote:
> We only want the value to be zero or one.
>
> It's not a big deal, but say we passed set value to INT_MIN, then
> disable_enclosure_messages_show() would return that 12 bytes of "buf"
> are initialized but actually only 3 are. I
10 matches
Mail list logo