Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
47225db5
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
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看板
提交
47225db5
编写于
3月 02, 2008
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[PATCH] switch amiflop
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
b564f027
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
26 addition
and
24 deletion
+26
-24
drivers/block/amiflop.c
drivers/block/amiflop.c
+26
-24
未找到文件。
drivers/block/amiflop.c
浏览文件 @
47225db5
...
...
@@ -1437,10 +1437,11 @@ static int fd_getgeo(struct block_device *bdev, struct hd_geometry *geo)
return
0
;
}
static
int
fd_ioctl
(
struct
inode
*
inode
,
struct
file
*
filp
,
static
int
fd_ioctl
(
struct
block_device
*
bdev
,
fmode_t
mode
,
unsigned
int
cmd
,
unsigned
long
param
)
{
int
drive
=
iminor
(
inode
)
&
3
;
struct
amiga_floppy_struct
*
p
=
bdev
->
bd_disk
->
private_data
;
int
drive
=
p
-
unit
;
static
struct
floppy_struct
getprm
;
void
__user
*
argp
=
(
void
__user
*
)
param
;
...
...
@@ -1451,7 +1452,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp,
rel_fdc
();
return
-
EBUSY
;
}
fsync_bdev
(
inode
->
i_
bdev
);
fsync_bdev
(
bdev
);
if
(
fd_motor_on
(
drive
)
==
0
)
{
rel_fdc
();
return
-
ENODEV
;
...
...
@@ -1464,12 +1465,12 @@ static int fd_ioctl(struct inode *inode, struct file *filp,
rel_fdc
();
break
;
case
FDFMTTRK
:
if
(
param
<
unit
[
drive
].
type
->
tracks
*
unit
[
drive
].
type
->
heads
)
if
(
param
<
p
->
type
->
tracks
*
p
->
type
->
heads
)
{
get_fdc
(
drive
);
if
(
fd_seek
(
drive
,
param
)
!=
0
){
memset
(
unit
[
drive
].
trackbuf
,
FD_FILL_BYTE
,
unit
[
drive
].
dtype
->
sects
*
unit
[
drive
].
type
->
sect_mult
*
512
);
memset
(
p
->
trackbuf
,
FD_FILL_BYTE
,
p
->
dtype
->
sects
*
p
->
type
->
sect_mult
*
512
);
non_int_flush_track
(
drive
);
}
floppy_off
(
drive
);
...
...
@@ -1480,14 +1481,14 @@ static int fd_ioctl(struct inode *inode, struct file *filp,
break
;
case
FDFMTEND
:
floppy_off
(
drive
);
invalidate_bdev
(
inode
->
i_
bdev
);
invalidate_bdev
(
bdev
);
break
;
case
FDGETPRM
:
memset
((
void
*
)
&
getprm
,
0
,
sizeof
(
getprm
));
getprm
.
track
=
unit
[
drive
].
type
->
tracks
;
getprm
.
head
=
unit
[
drive
].
type
->
heads
;
getprm
.
sect
=
unit
[
drive
].
dtype
->
sects
*
unit
[
drive
].
type
->
sect_mult
;
getprm
.
size
=
unit
[
drive
].
blocks
;
getprm
.
track
=
p
->
type
->
tracks
;
getprm
.
head
=
p
->
type
->
heads
;
getprm
.
sect
=
p
->
dtype
->
sects
*
p
->
type
->
sect_mult
;
getprm
.
size
=
p
->
blocks
;
if
(
copy_to_user
(
argp
,
&
getprm
,
sizeof
(
struct
floppy_struct
)))
return
-
EFAULT
;
break
;
...
...
@@ -1500,10 +1501,10 @@ static int fd_ioctl(struct inode *inode, struct file *filp,
break
;
#ifdef RAW_IOCTL
case
IOCTL_RAW_TRACK
:
if
(
copy_to_user
(
argp
,
raw_buf
,
unit
[
drive
].
type
->
read_size
))
if
(
copy_to_user
(
argp
,
raw_buf
,
p
->
type
->
read_size
))
return
-
EFAULT
;
else
return
unit
[
drive
].
type
->
read_size
;
return
p
->
type
->
read_size
;
#endif
default:
printk
(
KERN_DEBUG
"fd_ioctl: unknown cmd %d for drive %d."
,
...
...
@@ -1548,10 +1549,10 @@ static void fd_probe(int dev)
* /dev/PS0 etc), and disallows simultaneous access to the same
* drive with different device numbers.
*/
static
int
floppy_open
(
struct
inode
*
inode
,
struct
file
*
filp
)
static
int
floppy_open
(
struct
block_device
*
bdev
,
fmode_t
mode
)
{
int
drive
=
iminor
(
inode
)
&
3
;
int
system
=
(
iminor
(
inode
)
&
4
)
>>
2
;
int
drive
=
MINOR
(
bdev
->
bd_dev
)
&
3
;
int
system
=
(
MINOR
(
bdev
->
bd_dev
)
&
4
)
>>
2
;
int
old_dev
;
unsigned
long
flags
;
...
...
@@ -1560,9 +1561,9 @@ static int floppy_open(struct inode *inode, struct file *filp)
if
(
fd_ref
[
drive
]
&&
old_dev
!=
system
)
return
-
EBUSY
;
if
(
filp
&&
filp
->
f_
mode
&
(
FMODE_READ
|
FMODE_WRITE
))
{
check_disk_change
(
inode
->
i_
bdev
);
if
(
filp
->
f_mode
&
FMODE_WRITE
)
{
if
(
mode
&
(
FMODE_READ
|
FMODE_WRITE
))
{
check_disk_change
(
bdev
);
if
(
mode
&
FMODE_WRITE
)
{
int
wrprot
;
get_fdc
(
drive
);
...
...
@@ -1592,9 +1593,10 @@ 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
)
{
int
drive
=
iminor
(
inode
)
&
3
;
struct
amiga_floppy_struct
*
p
=
disk
->
private_data
;
int
drive
=
p
-
unit
;
if
(
unit
[
drive
].
dirty
==
1
)
{
del_timer
(
flush_track_timer
+
drive
);
...
...
@@ -1648,9 +1650,9 @@ static int amiga_floppy_change(struct gendisk *disk)
static
struct
block_device_operations
floppy_fops
=
{
.
owner
=
THIS_MODULE
,
.
__
open
=
floppy_open
,
.
__
release
=
floppy_release
,
.
__ioctl
=
fd_ioctl
,
.
open
=
floppy_open
,
.
release
=
floppy_release
,
.
locked_ioctl
=
fd_ioctl
,
.
getgeo
=
fd_getgeo
,
.
media_changed
=
amiga_floppy_change
,
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录