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
4ecbc558
Commit
4ecbc558
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] cm206.c
* switched to private queue * set ->queue
parent
411d439b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
16 deletions
+17
-16
drivers/cdrom/cm206.c
drivers/cdrom/cm206.c
+17
-16
No files found.
drivers/cdrom/cm206.c
View file @
4ecbc558
...
...
@@ -198,7 +198,6 @@
#include <asm/io.h>
#define MAJOR_NR CM206_CDROM_MAJOR
#define DEVICE_NR(device) (minor(device))
#include <linux/blk.h>
...
...
@@ -302,6 +301,7 @@ struct cm206_struct {
#define PLAY_TO cd->toc[0]
/* toc[0] records end-time in play */
static
struct
cm206_struct
*
cd
;
/* the main memory structure */
static
struct
request_queue
cm206_queue
;
static
spinlock_t
cm206_lock
=
SPIN_LOCK_UNLOCKED
;
/* First, we define some polling functions. These are actually
...
...
@@ -851,24 +851,25 @@ static void do_cm206_request(request_queue_t * q)
long
int
i
,
cd_sec_no
;
int
quarter
,
error
;
uch
*
source
,
*
dest
;
struct
request
*
req
;
while
(
1
)
{
/* repeat until all requests have been satisfied */
if
(
blk_queue_empty
(
QUEUE
))
while
(
1
)
{
/* repeat until all requests have been satisfied */
if
(
blk_queue_empty
(
q
))
return
;
if
(
CURRENT
->
cmd
!=
READ
)
{
debug
((
"Non-read command %d on cdrom
\n
"
,
CURRENT
->
cmd
));
end_request
(
CURRENT
,
0
);
req
=
elv_next_request
(
q
);
if
(
req
->
cmd
!=
READ
)
{
debug
((
"Non-read command %d on cdrom
\n
"
,
req
->
cmd
));
end_request
(
req
,
0
);
continue
;
}
spin_unlock_irq
(
q
->
queue_lock
);
error
=
0
;
for
(
i
=
0
;
i
<
CURRENT
->
nr_sectors
;
i
++
)
{
for
(
i
=
0
;
i
<
req
->
nr_sectors
;
i
++
)
{
int
e1
,
e2
;
cd_sec_no
=
(
CURRENT
->
sector
+
i
)
/
BLOCKS_ISO
;
/* 4 times 512 bytes */
quarter
=
(
CURRENT
->
sector
+
i
)
%
BLOCKS_ISO
;
dest
=
CURRENT
->
buffer
+
i
*
LINUX_BLOCK_SIZE
;
cd_sec_no
=
(
req
->
sector
+
i
)
/
BLOCKS_ISO
;
/* 4 times 512 bytes */
quarter
=
(
req
->
sector
+
i
)
%
BLOCKS_ISO
;
dest
=
req
->
buffer
+
i
*
LINUX_BLOCK_SIZE
;
/* is already in buffer memory? */
if
(
cd
->
sector_first
<=
cd_sec_no
&&
cd_sec_no
<
cd
->
sector_last
)
{
...
...
@@ -890,7 +891,7 @@ static void do_cm206_request(request_queue_t * q)
}
}
spin_lock_irq
(
q
->
queue_lock
);
end_request
(
CURRENT
,
!
error
);
end_request
(
req
,
!
error
);
}
}
...
...
@@ -1504,10 +1505,10 @@ int __init cm206_init(void)
printk
(
KERN_INFO
"Cannot register for cdrom %d!
\n
"
,
MAJOR_NR
);
goto
out_cdrom
;
}
blk_init_queue
(
&
cm206_queue
,
do_cm206_request
,
&
cm206_lock
);
blk_queue_hardsect_size
(
&
cm206_queue
,
2048
);
disk
->
queue
=
&
cm206_queue
;
add_disk
(
disk
);
blk_init_queue
(
BLK_DEFAULT_QUEUE
(
MAJOR_NR
),
do_cm206_request
,
&
cm206_lock
);
blk_queue_hardsect_size
(
BLK_DEFAULT_QUEUE
(
MAJOR_NR
),
2048
);
memset
(
cd
,
0
,
sizeof
(
*
cd
));
/* give'm some reasonable value */
cd
->
sector_last
=
-
1
;
/* flag no data buffered */
...
...
@@ -1570,7 +1571,7 @@ void __exit cm206_exit(void)
printk
(
"Can't unregister major cm206
\n
"
);
return
;
}
blk_cleanup_queue
(
BLK_DEFAULT_QUEUE
(
MAJOR_NR
)
);
blk_cleanup_queue
(
&
cm206_queue
);
free_irq
(
cm206_irq
,
NULL
);
kfree
(
cd
);
release_region
(
cm206_base
,
16
);
...
...
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