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
c40bcba2
Commit
c40bcba2
authored
Oct 17, 2002
by
Alexander Viro
Committed by
Linus Torvalds
Oct 17, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] sr.c
* set ->queue * removed DEVICE_NR() * switched request handling to ->rq_disk
parent
41e18abb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
26 deletions
+6
-26
drivers/scsi/sr.c
drivers/scsi/sr.c
+6
-26
No files found.
drivers/scsi/sr.c
View file @
c40bcba2
...
@@ -51,7 +51,6 @@
...
@@ -51,7 +51,6 @@
#define MAJOR_NR SCSI_CDROM_MAJOR
#define MAJOR_NR SCSI_CDROM_MAJOR
#define LOCAL_END_REQUEST
#define LOCAL_END_REQUEST
#define DEVICE_NR(device) (minor(device))
#include <linux/blk.h>
#include <linux/blk.h>
#include "scsi.h"
#include "scsi.h"
#include "hosts.h"
#include "hosts.h"
...
@@ -196,8 +195,7 @@ static void rw_intr(Scsi_Cmnd * SCpnt)
...
@@ -196,8 +195,7 @@ static void rw_intr(Scsi_Cmnd * SCpnt)
int
this_count
=
SCpnt
->
bufflen
>>
9
;
int
this_count
=
SCpnt
->
bufflen
>>
9
;
int
good_sectors
=
(
result
==
0
?
this_count
:
0
);
int
good_sectors
=
(
result
==
0
?
this_count
:
0
);
int
block_sectors
=
0
;
int
block_sectors
=
0
;
int
device_nr
=
DEVICE_NR
(
SCpnt
->
request
->
rq_dev
);
Scsi_CD
*
cd
=
SCpnt
->
request
->
rq_disk
->
private_data
;
Scsi_CD
*
cd
=
&
scsi_CDs
[
device_nr
];
#ifdef DEBUG
#ifdef DEBUG
printk
(
"sr.c done: %x %p
\n
"
,
result
,
SCpnt
->
request
->
bh
->
b_data
);
printk
(
"sr.c done: %x %p
\n
"
,
result
,
SCpnt
->
request
->
bh
->
b_data
);
...
@@ -247,31 +245,14 @@ static void rw_intr(Scsi_Cmnd * SCpnt)
...
@@ -247,31 +245,14 @@ static void rw_intr(Scsi_Cmnd * SCpnt)
scsi_io_completion
(
SCpnt
,
good_sectors
,
block_sectors
);
scsi_io_completion
(
SCpnt
,
good_sectors
,
block_sectors
);
}
}
static
request_queue_t
*
sr_find_queue
(
kdev_t
dev
)
{
Scsi_CD
*
cd
;
if
(
minor
(
dev
)
>=
sr_template
.
dev_max
)
return
NULL
;
cd
=
&
scsi_CDs
[
minor
(
dev
)];
if
(
!
cd
->
device
)
return
NULL
;
return
&
cd
->
device
->
request_queue
;
}
static
int
sr_init_command
(
Scsi_Cmnd
*
SCpnt
)
static
int
sr_init_command
(
Scsi_Cmnd
*
SCpnt
)
{
{
int
dev
,
devm
,
block
=
0
,
this_count
,
s_size
;
int
block
=
0
,
this_count
,
s_size
;
Scsi_CD
*
cd
;
Scsi_CD
*
cd
=
SCpnt
->
request
->
rq_disk
->
private_data
;
devm
=
minor
(
SCpnt
->
request
->
rq_dev
);
SCSI_LOG_HLQUEUE
(
1
,
printk
(
"Doing sr request, dev = %s, block = %d
\n
"
,
disk
->
disk_name
,
block
));
dev
=
DEVICE_NR
(
SCpnt
->
request
->
rq_dev
);
cd
=
&
scsi_CDs
[
dev
];
SCSI_LOG_HLQUEUE
(
1
,
printk
(
"Doing sr request, dev = %d, block = %d
\n
"
,
devm
,
block
));
if
(
!
cd
->
device
||
!
cd
->
device
->
online
)
{
if
(
dev
>=
sr_template
.
nr_dev
||
!
cd
->
device
||
!
cd
->
device
->
online
)
{
SCSI_LOG_HLQUEUE
(
2
,
printk
(
"Finishing %ld sectors
\n
"
,
SCpnt
->
request
->
nr_sectors
));
SCSI_LOG_HLQUEUE
(
2
,
printk
(
"Finishing %ld sectors
\n
"
,
SCpnt
->
request
->
nr_sectors
));
SCSI_LOG_HLQUEUE
(
2
,
printk
(
"Retry with 0x%p
\n
"
,
SCpnt
));
SCSI_LOG_HLQUEUE
(
2
,
printk
(
"Retry with 0x%p
\n
"
,
SCpnt
));
return
0
;
return
0
;
...
@@ -742,8 +723,6 @@ void sr_finish()
...
@@ -742,8 +723,6 @@ void sr_finish()
{
{
int
i
;
int
i
;
blk_dev
[
MAJOR_NR
].
queue
=
sr_find_queue
;
for
(
i
=
0
;
i
<
sr_template
.
nr_dev
;
++
i
)
{
for
(
i
=
0
;
i
<
sr_template
.
nr_dev
;
++
i
)
{
struct
gendisk
*
disk
;
struct
gendisk
*
disk
;
Scsi_CD
*
cd
=
&
scsi_CDs
[
i
];
Scsi_CD
*
cd
=
&
scsi_CDs
[
i
];
...
@@ -795,6 +774,7 @@ void sr_finish()
...
@@ -795,6 +774,7 @@ void sr_finish()
register_cdrom
(
&
cd
->
cdi
);
register_cdrom
(
&
cd
->
cdi
);
set_capacity
(
disk
,
cd
->
capacity
);
set_capacity
(
disk
,
cd
->
capacity
);
disk
->
private_data
=
cd
;
disk
->
private_data
=
cd
;
disk
->
queue
=
&
cd
->
device
->
request_queue
;
add_disk
(
disk
);
add_disk
(
disk
);
}
}
}
}
...
...
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