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
1815a7a3
Commit
1815a7a3
authored
Oct 05, 2002
by
James Bottomley
Browse files
Options
Browse Files
Download
Plain Diff
Merge mulgrave.(none):/home/jejb/BK/scsi-sd-cache-2.5
into mulgrave.(none):/home/jejb/BK/scsi-for-linus-2.5
parents
5b29b6c5
f6d999f9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
12 deletions
+21
-12
drivers/scsi/sd.c
drivers/scsi/sd.c
+21
-12
No files found.
drivers/scsi/sd.c
View file @
1815a7a3
...
...
@@ -580,10 +580,6 @@ static int sd_release(struct inode *inode, struct file *filp)
if
(
sd_template
.
module
)
__MOD_DEC_USE_COUNT
(
sd_template
.
module
);
/* check that we actually have a write back cache to synchronize */
if
(
sdkp
->
WCE
)
sd_synchronize_cache
(
dsk_nr
,
1
);
return
0
;
}
...
...
@@ -1474,9 +1470,6 @@ static void sd_detach(Scsi_Device * sdp)
for
(
dsk_nr
=
0
;
dsk_nr
<
sd_template
.
dev_max
;
dsk_nr
++
)
{
sdkp
=
sd_dsk_arr
[
dsk_nr
];
if
(
sdkp
->
device
==
sdp
)
{
sdkp
->
device
=
NULL
;
sdkp
->
capacity
=
0
;
/* sdkp->detaching = 1; */
break
;
}
}
...
...
@@ -1484,6 +1477,16 @@ static void sd_detach(Scsi_Device * sdp)
if
(
dsk_nr
>=
sd_template
.
dev_max
)
return
;
/* check that we actually have a write back cache to synchronize */
if
(
sdkp
->
WCE
)
{
printk
(
KERN_NOTICE
"Synchronizing SCSI cache: "
);
sd_synchronize_cache
(
dsk_nr
,
1
);
printk
(
"
\n
"
);
}
sdkp
->
device
=
NULL
;
sdkp
->
capacity
=
0
;
/* sdkp->detaching = 1; */
if
(
sdkp
->
has_been_registered
)
{
sdkp
->
has_been_registered
=
0
;
dev
=
MKDEV_SD
(
dsk_nr
);
...
...
@@ -1548,6 +1551,7 @@ static void __exit exit_sd(void)
static
int
sd_notifier
(
struct
notifier_block
*
nbt
,
unsigned
long
event
,
void
*
buf
)
{
int
i
;
char
*
msg
=
"Synchronizing SCSI caches: "
;
if
(
!
(
event
==
SYS_RESTART
||
event
==
SYS_HALT
||
event
==
SYS_POWER_OFF
))
...
...
@@ -1557,9 +1561,16 @@ static int sd_notifier(struct notifier_block *nbt, unsigned long event, void *bu
if
(
!
sdkp
||
!
sdkp
->
device
)
continue
;
if
(
sdkp
->
WCE
)
if
(
sdkp
->
WCE
)
{
if
(
msg
)
{
printk
(
KERN_NOTICE
"%s"
,
msg
);
msg
=
NULL
;
}
sd_synchronize_cache
(
i
,
1
);
}
}
if
(
!
msg
)
printk
(
"
\n
"
);
return
NOTIFY_OK
;
}
...
...
@@ -1579,7 +1590,7 @@ static int sd_synchronize_cache(int index, int verbose)
sd_dskname
(
index
,
buf
);
printk
(
"%s
: synchronizing cache...
"
,
buf
);
printk
(
"%s
"
,
buf
);
}
SRpnt
=
scsi_allocate_request
(
SDpnt
);
...
...
@@ -1607,9 +1618,7 @@ static int sd_synchronize_cache(int index, int verbose)
the_result
=
SRpnt
->
sr_result
;
scsi_release_request
(
SRpnt
);
if
(
verbose
)
{
if
(
the_result
==
0
)
{
printk
(
"OK
\n
"
);
}
else
{
if
(
the_result
!=
0
)
{
printk
(
"FAILED
\n
status = %x, message = %02x, host = %d, driver = %02x
\n
"
,
status_byte
(
the_result
),
msg_byte
(
the_result
),
...
...
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