Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
b4d9a442
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
b4d9a442
编写于
3月 02, 2008
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[PATCH] switch swim3
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
5e5e007c
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
18 addition
and
18 deletion
+18
-18
drivers/block/swim3.c
drivers/block/swim3.c
+18
-18
未找到文件。
drivers/block/swim3.c
浏览文件 @
b4d9a442
...
...
@@ -244,10 +244,10 @@ static int grab_drive(struct floppy_state *fs, enum swim_state state,
int
interruptible
);
static
void
release_drive
(
struct
floppy_state
*
fs
);
static
int
fd_eject
(
struct
floppy_state
*
fs
);
static
int
floppy_ioctl
(
struct
inode
*
inode
,
struct
file
*
filp
,
static
int
floppy_ioctl
(
struct
block_device
*
bdev
,
fmode_t
mode
,
unsigned
int
cmd
,
unsigned
long
param
);
static
int
floppy_open
(
struct
inode
*
inode
,
struct
file
*
filp
);
static
int
floppy_release
(
struct
inode
*
inode
,
struct
file
*
filp
);
static
int
floppy_open
(
struct
block_device
*
bdev
,
fmode_t
mode
);
static
int
floppy_release
(
struct
gendisk
*
disk
,
fmode_t
mode
);
static
int
floppy_check_change
(
struct
gendisk
*
disk
);
static
int
floppy_revalidate
(
struct
gendisk
*
disk
);
...
...
@@ -839,10 +839,10 @@ static int fd_eject(struct floppy_state *fs)
static
struct
floppy_struct
floppy_type
=
{
2880
,
18
,
2
,
80
,
0
,
0x1B
,
0x00
,
0xCF
,
0x6C
,
NULL
};
/* 7 1.44MB 3.5" */
static
int
floppy_ioctl
(
struct
inode
*
inode
,
struct
file
*
filp
,
static
int
floppy_ioctl
(
struct
block_device
*
bdev
,
fmode_t
mode
,
unsigned
int
cmd
,
unsigned
long
param
)
{
struct
floppy_state
*
fs
=
inode
->
i_
bdev
->
bd_disk
->
private_data
;
struct
floppy_state
*
fs
=
bdev
->
bd_disk
->
private_data
;
int
err
;
if
((
cmd
&
0x80
)
&&
!
capable
(
CAP_SYS_ADMIN
))
...
...
@@ -868,9 +868,9 @@ static int floppy_ioctl(struct inode *inode, struct file *filp,
return
-
ENOTTY
;
}
static
int
floppy_open
(
struct
inode
*
inode
,
struct
file
*
filp
)
static
int
floppy_open
(
struct
block_device
*
bdev
,
fmode_t
mode
)
{
struct
floppy_state
*
fs
=
inode
->
i_
bdev
->
bd_disk
->
private_data
;
struct
floppy_state
*
fs
=
bdev
->
bd_disk
->
private_data
;
struct
swim3
__iomem
*
sw
=
fs
->
swim3
;
int
n
,
err
=
0
;
...
...
@@ -904,17 +904,17 @@ static int floppy_open(struct inode *inode, struct file *filp)
swim3_action
(
fs
,
SETMFM
);
swim3_select
(
fs
,
RELAX
);
}
else
if
(
fs
->
ref_count
==
-
1
||
filp
->
f_
mode
&
FMODE_EXCL
)
}
else
if
(
fs
->
ref_count
==
-
1
||
mode
&
FMODE_EXCL
)
return
-
EBUSY
;
if
(
err
==
0
&&
(
filp
->
f_
mode
&
FMODE_NDELAY
)
==
0
&&
(
filp
->
f_
mode
&
(
FMODE_READ
|
FMODE_WRITE
)))
{
check_disk_change
(
inode
->
i_
bdev
);
if
(
err
==
0
&&
(
mode
&
FMODE_NDELAY
)
==
0
&&
(
mode
&
(
FMODE_READ
|
FMODE_WRITE
)))
{
check_disk_change
(
bdev
);
if
(
fs
->
ejected
)
err
=
-
ENXIO
;
}
if
(
err
==
0
&&
(
filp
->
f_
mode
&
FMODE_WRITE
))
{
if
(
err
==
0
&&
(
mode
&
FMODE_WRITE
))
{
if
(
fs
->
write_prot
<
0
)
fs
->
write_prot
=
swim3_readbit
(
fs
,
WRITE_PROT
);
if
(
fs
->
write_prot
)
...
...
@@ -930,7 +930,7 @@ static int floppy_open(struct inode *inode, struct file *filp)
return
err
;
}
if
(
filp
->
f_
mode
&
FMODE_EXCL
)
if
(
mode
&
FMODE_EXCL
)
fs
->
ref_count
=
-
1
;
else
++
fs
->
ref_count
;
...
...
@@ -938,9 +938,9 @@ static int floppy_open(struct inode *inode, struct file *filp)
return
0
;
}
static
int
floppy_release
(
struct
inode
*
inode
,
struct
file
*
filp
)
static
int
floppy_release
(
struct
gendisk
*
disk
,
fmode_t
mode
)
{
struct
floppy_state
*
fs
=
inode
->
i_bdev
->
bd_
disk
->
private_data
;
struct
floppy_state
*
fs
=
disk
->
private_data
;
struct
swim3
__iomem
*
sw
=
fs
->
swim3
;
if
(
fs
->
ref_count
>
0
&&
--
fs
->
ref_count
==
0
)
{
swim3_action
(
fs
,
MOTOR_OFF
);
...
...
@@ -998,9 +998,9 @@ static int floppy_revalidate(struct gendisk *disk)
}
static
struct
block_device_operations
floppy_fops
=
{
.
__
open
=
floppy_open
,
.
__
release
=
floppy_release
,
.
__ioctl
=
floppy_ioctl
,
.
open
=
floppy_open
,
.
release
=
floppy_release
,
.
locked_ioctl
=
floppy_ioctl
,
.
media_changed
=
floppy_check_change
,
.
revalidate_disk
=
floppy_revalidate
,
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录