Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
c8ed555a
Commit
c8ed555a
authored
Mar 31, 2013
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scsi_debug: switch to ->show_info()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
cac19703
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
32 deletions
+21
-32
drivers/scsi/scsi_debug.c
drivers/scsi/scsi_debug.c
+21
-32
No files found.
drivers/scsi/scsi_debug.c
View file @
c8ed555a
...
@@ -2823,31 +2823,27 @@ static const char * scsi_debug_info(struct Scsi_Host * shp)
...
@@ -2823,31 +2823,27 @@ static const char * scsi_debug_info(struct Scsi_Host * shp)
/* scsi_debug_proc_info
/* scsi_debug_proc_info
* Used if the driver currently has no own support for /proc/scsi
* Used if the driver currently has no own support for /proc/scsi
*/
*/
static
int
scsi_debug_proc_info
(
struct
Scsi_Host
*
host
,
char
*
buffer
,
char
**
start
,
off_t
offset
,
static
int
scsi_debug_write_info
(
struct
Scsi_Host
*
host
,
char
*
buffer
,
int
length
)
int
length
,
int
inout
)
{
{
int
len
,
pos
,
begin
;
char
arr
[
16
];
int
orig_length
;
int
opts
;
int
minLen
=
length
>
15
?
15
:
length
;
orig_length
=
length
;
if
(
!
capable
(
CAP_SYS_ADMIN
)
||
!
capable
(
CAP_SYS_RAWIO
))
return
-
EACCES
;
if
(
inout
==
1
)
{
memcpy
(
arr
,
buffer
,
minLen
);
char
arr
[
16
];
arr
[
minLen
]
=
'\0'
;
int
minLen
=
length
>
15
?
15
:
length
;
if
(
1
!=
sscanf
(
arr
,
"%d"
,
&
opts
))
return
-
EINVAL
;
scsi_debug_opts
=
opts
;
if
(
scsi_debug_every_nth
!=
0
)
scsi_debug_cmnd_count
=
0
;
return
length
;
}
if
(
!
capable
(
CAP_SYS_ADMIN
)
||
!
capable
(
CAP_SYS_RAWIO
))
static
int
scsi_debug_show_info
(
struct
seq_file
*
m
,
struct
Scsi_Host
*
host
)
return
-
EACCES
;
{
memcpy
(
arr
,
buffer
,
minLen
);
seq_printf
(
m
,
"scsi_debug adapter driver, version "
arr
[
minLen
]
=
'\0'
;
if
(
1
!=
sscanf
(
arr
,
"%d"
,
&
pos
))
return
-
EINVAL
;
scsi_debug_opts
=
pos
;
if
(
scsi_debug_every_nth
!=
0
)
scsi_debug_cmnd_count
=
0
;
return
length
;
}
begin
=
0
;
pos
=
len
=
sprintf
(
buffer
,
"scsi_debug adapter driver, version "
"%s [%s]
\n
"
"%s [%s]
\n
"
"num_tgts=%d, shared (ram) size=%d MB, opts=0x%x, "
"num_tgts=%d, shared (ram) size=%d MB, opts=0x%x, "
"every_nth=%d(curr:%d)
\n
"
"every_nth=%d(curr:%d)
\n
"
...
@@ -2862,15 +2858,7 @@ static int scsi_debug_proc_info(struct Scsi_Host *host, char *buffer, char **sta
...
@@ -2862,15 +2858,7 @@ static int scsi_debug_proc_info(struct Scsi_Host *host, char *buffer, char **sta
scsi_debug_sector_size
,
sdebug_cylinders_per
,
sdebug_heads
,
scsi_debug_sector_size
,
sdebug_cylinders_per
,
sdebug_heads
,
sdebug_sectors_per
,
num_aborts
,
num_dev_resets
,
num_bus_resets
,
sdebug_sectors_per
,
num_aborts
,
num_dev_resets
,
num_bus_resets
,
num_host_resets
,
dix_reads
,
dix_writes
,
dif_errors
);
num_host_resets
,
dix_reads
,
dix_writes
,
dif_errors
);
if
(
pos
<
offset
)
{
return
0
;
len
=
0
;
begin
=
pos
;
}
*
start
=
buffer
+
(
offset
-
begin
);
/* Start of wanted data */
len
-=
(
offset
-
begin
);
if
(
len
>
length
)
len
=
length
;
return
len
;
}
}
static
ssize_t
sdebug_delay_show
(
struct
device_driver
*
ddp
,
char
*
buf
)
static
ssize_t
sdebug_delay_show
(
struct
device_driver
*
ddp
,
char
*
buf
)
...
@@ -3957,7 +3945,8 @@ int scsi_debug_queuecommand_lck(struct scsi_cmnd *SCpnt, done_funct_t done)
...
@@ -3957,7 +3945,8 @@ int scsi_debug_queuecommand_lck(struct scsi_cmnd *SCpnt, done_funct_t done)
static
DEF_SCSI_QCMD
(
scsi_debug_queuecommand
)
static
DEF_SCSI_QCMD
(
scsi_debug_queuecommand
)
static
struct
scsi_host_template
sdebug_driver_template
=
{
static
struct
scsi_host_template
sdebug_driver_template
=
{
.
proc_info
=
scsi_debug_proc_info
,
.
show_info
=
scsi_debug_show_info
,
.
write_info
=
scsi_debug_write_info
,
.
proc_name
=
sdebug_proc_name
,
.
proc_name
=
sdebug_proc_name
,
.
name
=
"SCSI DEBUG"
,
.
name
=
"SCSI DEBUG"
,
.
info
=
scsi_debug_info
,
.
info
=
scsi_debug_info
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment