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
nexedi
linux
Commits
40cc51be
Commit
40cc51be
authored
Mar 02, 2008
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] switch sr
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
0338e291
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
22 deletions
+18
-22
drivers/scsi/sr.c
drivers/scsi/sr.c
+18
-22
No files found.
drivers/scsi/sr.c
View file @
40cc51be
...
...
@@ -471,34 +471,31 @@ static int sr_prep_fn(struct request_queue *q, struct request *rq)
return
scsi_prep_return
(
q
,
rq
,
ret
);
}
static
int
sr_block_open
(
struct
inode
*
inode
,
struct
file
*
fil
e
)
static
int
sr_block_open
(
struct
block_device
*
bdev
,
fmode_t
mod
e
)
{
struct
gendisk
*
disk
=
inode
->
i_bdev
->
bd_disk
;
struct
scsi_cd
*
cd
;
int
ret
=
0
;
if
(
!
(
cd
=
scsi_cd_get
(
disk
)))
return
-
ENXIO
;
if
((
ret
=
cdrom_open
(
&
cd
->
cdi
,
inode
->
i_bdev
,
file
->
f_mode
))
!=
0
)
scsi_cd_put
(
cd
);
struct
scsi_cd
*
cd
=
scsi_cd_get
(
bdev
->
bd_disk
);
int
ret
=
-
ENXIO
;
if
(
cd
)
{
ret
=
cdrom_open
(
&
cd
->
cdi
,
bdev
,
mode
);
if
(
ret
)
scsi_cd_put
(
cd
);
}
return
ret
;
}
static
int
sr_block_release
(
struct
inode
*
inode
,
struct
file
*
fil
e
)
static
int
sr_block_release
(
struct
gendisk
*
disk
,
fmode_t
mod
e
)
{
struct
scsi_cd
*
cd
=
scsi_cd
(
inode
->
i_bdev
->
bd_
disk
);
cdrom_release
(
&
cd
->
cdi
,
file
?
file
->
f_mode
:
0
);
struct
scsi_cd
*
cd
=
scsi_cd
(
disk
);
cdrom_release
(
&
cd
->
cdi
,
mode
);
scsi_cd_put
(
cd
);
return
0
;
}
static
int
sr_block_ioctl
(
struct
inode
*
inode
,
struct
file
*
fil
e
,
unsigned
cmd
,
static
int
sr_block_ioctl
(
struct
block_device
*
bdev
,
fmode_t
mod
e
,
unsigned
cmd
,
unsigned
long
arg
)
{
struct
scsi_cd
*
cd
=
scsi_cd
(
inode
->
i_
bdev
->
bd_disk
);
struct
scsi_cd
*
cd
=
scsi_cd
(
bdev
->
bd_disk
);
struct
scsi_device
*
sdev
=
cd
->
device
;
void
__user
*
argp
=
(
void
__user
*
)
arg
;
int
ret
;
...
...
@@ -513,8 +510,7 @@ static int sr_block_ioctl(struct inode *inode, struct file *file, unsigned cmd,
return
scsi_ioctl
(
sdev
,
cmd
,
argp
);
}
ret
=
cdrom_ioctl
(
&
cd
->
cdi
,
inode
->
i_bdev
,
file
?
file
->
f_mode
:
0
,
cmd
,
arg
);
ret
=
cdrom_ioctl
(
&
cd
->
cdi
,
bdev
,
mode
,
cmd
,
arg
);
if
(
ret
!=
-
ENOSYS
)
return
ret
;
...
...
@@ -525,7 +521,7 @@ static int sr_block_ioctl(struct inode *inode, struct file *file, unsigned cmd,
* if it doesn't recognise the ioctl
*/
ret
=
scsi_nonblockable_ioctl
(
sdev
,
cmd
,
argp
,
file
?
file
->
f_flags
&
O_NDELAY
:
0
);
(
mode
&
FMODE_NDELAY_NOW
)
!=
0
);
if
(
ret
!=
-
ENODEV
)
return
ret
;
return
scsi_ioctl
(
sdev
,
cmd
,
argp
);
...
...
@@ -540,9 +536,9 @@ static int sr_block_media_changed(struct gendisk *disk)
static
struct
block_device_operations
sr_bdops
=
{
.
owner
=
THIS_MODULE
,
.
__
open
=
sr_block_open
,
.
__
release
=
sr_block_release
,
.
__ioctl
=
sr_block_ioctl
,
.
open
=
sr_block_open
,
.
release
=
sr_block_release
,
.
locked_ioctl
=
sr_block_ioctl
,
.
media_changed
=
sr_block_media_changed
,
/*
* No compat_ioctl for now because sr_block_ioctl never
...
...
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