Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
40cc51be
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
40cc51be
编写于
3月 02, 2008
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[PATCH] switch sr
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
0338e291
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
18 addition
and
22 deletion
+18
-22
drivers/scsi/sr.c
drivers/scsi/sr.c
+18
-22
未找到文件。
drivers/scsi/sr.c
浏览文件 @
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
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录