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
8521f378
Commit
8521f378
authored
Oct 22, 2002
by
James Bottomley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SCSI] move build commandblocks to before attach so attach can send I/O
parent
a049055c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
28 deletions
+37
-28
drivers/scsi/hosts.c
drivers/scsi/hosts.c
+5
-4
drivers/scsi/scsi.c
drivers/scsi/scsi.c
+9
-5
drivers/scsi/scsi_scan.c
drivers/scsi/scsi_scan.c
+21
-17
drivers/scsi/sr.c
drivers/scsi/sr.c
+2
-2
No files found.
drivers/scsi/hosts.c
View file @
8521f378
...
...
@@ -561,15 +561,16 @@ int scsi_register_host(Scsi_Host_Template *shost_tp)
shost
=
list_entry
(
lh
,
struct
Scsi_Host
,
sh_list
);
for
(
sdev
=
shost
->
host_queue
;
sdev
;
sdev
=
sdev
->
next
)
if
(
sdev
->
host
->
hostt
==
shost_tp
)
{
scsi_build_commandblocks
(
sdev
);
if
(
sdev
->
current_queue_depth
==
0
)
goto
out_of_space
;
for
(
sdev_tp
=
scsi_devicelist
;
sdev_tp
;
sdev_tp
=
sdev_tp
->
next
)
if
(
sdev_tp
->
attach
)
(
*
sdev_tp
->
attach
)
(
sdev
);
if
(
sdev
->
attached
)
{
scsi_build_commandblocks
(
sdev
);
if
(
sdev
->
current_queue_depth
==
0
)
goto
out_of_space
;
if
(
!
sdev
->
attached
)
{
scsi_release_commandblocks
(
sdev
);
}
}
}
...
...
drivers/scsi/scsi.c
View file @
8521f378
...
...
@@ -2019,18 +2019,22 @@ int scsi_register_device(struct Scsi_Device_Template *tpnt)
shpnt
=
scsi_host_get_next
(
shpnt
))
{
for
(
SDpnt
=
shpnt
->
host_queue
;
SDpnt
;
SDpnt
=
SDpnt
->
next
)
{
scsi_build_commandblocks
(
SDpnt
);
if
(
SDpnt
->
current_queue_depth
==
0
)
{
out_of_space
=
1
;
continue
;
}
if
(
tpnt
->
attach
)
(
*
tpnt
->
attach
)
(
SDpnt
);
/*
* If this driver attached to the device, and don't have any
* command blocks for this device, allocate some.
*/
if
(
SDpnt
->
attached
&&
SDpnt
->
current_queue_depth
==
0
)
{
if
(
SDpnt
->
attached
)
SDpnt
->
online
=
TRUE
;
scsi_build_commandblocks
(
SDpnt
);
if
(
SDpnt
->
current_queue_depth
==
0
)
out_of_space
=
1
;
}
else
scsi_release_commandblocks
(
SDpnt
);
}
}
...
...
drivers/scsi/scsi_scan.c
View file @
8521f378
...
...
@@ -1995,24 +1995,28 @@ static void scsi_scan_selected_lun(struct Scsi_Host *shost, uint channel,
sdevscan
->
scsi_level
=
scsi_find_scsi_level
(
channel
,
id
,
shost
);
res
=
scsi_probe_and_add_lun
(
sdevscan
,
&
sdev
,
NULL
);
scsi_free_sdev
(
sdevscan
);
if
(
res
==
SCSI_SCAN_LUN_PRESENT
)
{
BUG_ON
(
sdev
==
NULL
);
for
(
sdt
=
scsi_devicelist
;
sdt
;
sdt
=
sdt
->
next
)
if
(
sdt
->
init
&&
sdt
->
dev_noticed
)
(
*
sdt
->
init
)
();
for
(
sdt
=
scsi_devicelist
;
sdt
;
sdt
=
sdt
->
next
)
if
(
sdt
->
attach
)
{
(
*
sdt
->
attach
)
(
sdev
);
if
(
sdev
->
attached
)
{
scsi_build_commandblocks
(
sdev
);
if
(
sdev
->
current_queue_depth
==
0
)
printk
(
ALLOC_FAILURE_MSG
,
__FUNCTION__
);
}
}
if
(
res
!=
SCSI_SCAN_LUN_PRESENT
)
return
;
BUG_ON
(
sdev
==
NULL
);
scsi_build_commandblocks
(
sdev
);
if
(
sdev
->
current_queue_depth
==
0
)
{
printk
(
ALLOC_FAILURE_MSG
,
__FUNCTION__
);
return
;
}
for
(
sdt
=
scsi_devicelist
;
sdt
;
sdt
=
sdt
->
next
)
if
(
sdt
->
init
&&
sdt
->
dev_noticed
)
(
*
sdt
->
init
)
();
for
(
sdt
=
scsi_devicelist
;
sdt
;
sdt
=
sdt
->
next
)
if
(
sdt
->
attach
)
(
*
sdt
->
attach
)
(
sdev
);
if
(
!
sdev
->
attached
)
scsi_release_commandblocks
(
sdev
);
}
/**
...
...
drivers/scsi/sr.c
View file @
8521f378
...
...
@@ -481,11 +481,11 @@ static int sr_attach(Scsi_Device * SDp)
if
(
i
>=
sr_template
.
dev_max
)
panic
(
"scsi_devices corrupt (sr)"
);
scsi_CDs
[
i
].
device
=
SDp
;
if
(
sr_init_one
(
cpnt
,
i
))
goto
fail
;
scsi_CDs
[
i
].
device
=
SDp
;
sr_template
.
nr_dev
++
;
if
(
sr_template
.
nr_dev
>
sr_template
.
dev_max
)
panic
(
"scsi_devices corrupt (sr)"
);
...
...
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