Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
4099a966
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
158
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4099a966
编写于
3月 02, 2008
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[PATCH] switch ub
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
b4d9a442
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
12 addition
and
14 deletion
+12
-14
drivers/block/ub.c
drivers/block/ub.c
+12
-14
未找到文件。
drivers/block/ub.c
浏览文件 @
4099a966
...
...
@@ -1667,10 +1667,9 @@ static void ub_revalidate(struct ub_dev *sc, struct ub_lun *lun)
* This is mostly needed to keep refcounting, but also to support
* media checks on removable media drives.
*/
static
int
ub_bd_open
(
struct
inode
*
inode
,
struct
file
*
filp
)
static
int
ub_bd_open
(
struct
block_device
*
bdev
,
fmode_t
mode
)
{
struct
gendisk
*
disk
=
inode
->
i_bdev
->
bd_disk
;
struct
ub_lun
*
lun
=
disk
->
private_data
;
struct
ub_lun
*
lun
=
bdev
->
bd_disk
->
private_data
;
struct
ub_dev
*
sc
=
lun
->
udev
;
unsigned
long
flags
;
int
rc
;
...
...
@@ -1684,19 +1683,19 @@ static int ub_bd_open(struct inode *inode, struct file *filp)
spin_unlock_irqrestore
(
&
ub_lock
,
flags
);
if
(
lun
->
removable
||
lun
->
readonly
)
check_disk_change
(
inode
->
i_
bdev
);
check_disk_change
(
bdev
);
/*
* The sd.c considers ->media_present and ->changed not equivalent,
* under some pretty murky conditions (a failure of READ CAPACITY).
* We may need it one day.
*/
if
(
lun
->
removable
&&
lun
->
changed
&&
!
(
filp
->
f_
mode
&
FMODE_NDELAY
))
{
if
(
lun
->
removable
&&
lun
->
changed
&&
!
(
mode
&
FMODE_NDELAY
))
{
rc
=
-
ENOMEDIUM
;
goto
err_open
;
}
if
(
lun
->
readonly
&&
(
filp
->
f_
mode
&
FMODE_WRITE
))
{
if
(
lun
->
readonly
&&
(
mode
&
FMODE_WRITE
))
{
rc
=
-
EROFS
;
goto
err_open
;
}
...
...
@@ -1710,9 +1709,8 @@ static int ub_bd_open(struct inode *inode, struct file *filp)
/*
*/
static
int
ub_bd_release
(
struct
inode
*
inode
,
struct
file
*
filp
)
static
int
ub_bd_release
(
struct
gendisk
*
disk
,
fmode_t
mode
)
{
struct
gendisk
*
disk
=
inode
->
i_bdev
->
bd_disk
;
struct
ub_lun
*
lun
=
disk
->
private_data
;
struct
ub_dev
*
sc
=
lun
->
udev
;
...
...
@@ -1723,13 +1721,13 @@ static int ub_bd_release(struct inode *inode, struct file *filp)
/*
* The ioctl interface.
*/
static
int
ub_bd_ioctl
(
struct
inode
*
inode
,
struct
file
*
filp
,
static
int
ub_bd_ioctl
(
struct
block_device
*
bdev
,
fmode_t
mode
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
struct
gendisk
*
disk
=
inode
->
i_
bdev
->
bd_disk
;
struct
gendisk
*
disk
=
bdev
->
bd_disk
;
void
__user
*
usermem
=
(
void
__user
*
)
arg
;
return
scsi_cmd_ioctl
(
disk
->
queue
,
disk
,
filp
?
filp
->
f_mode
:
0
,
cmd
,
usermem
);
return
scsi_cmd_ioctl
(
disk
->
queue
,
disk
,
mode
,
cmd
,
usermem
);
}
/*
...
...
@@ -1791,9 +1789,9 @@ static int ub_bd_media_changed(struct gendisk *disk)
static
struct
block_device_operations
ub_bd_fops
=
{
.
owner
=
THIS_MODULE
,
.
__
open
=
ub_bd_open
,
.
__
release
=
ub_bd_release
,
.
__ioctl
=
ub_bd_ioctl
,
.
open
=
ub_bd_open
,
.
release
=
ub_bd_release
,
.
locked_ioctl
=
ub_bd_ioctl
,
.
media_changed
=
ub_bd_media_changed
,
.
revalidate_disk
=
ub_bd_revalidate
,
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录