Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
ef7822c2
K
Kernel
项目概览
openeuler
/
Kernel
大约 1 年 前同步成功
通知
5
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ef7822c2
编写于
3月 02, 2008
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[PATCH] switch cciss
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
2b9ecd03
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
39 addition
and
39 deletion
+39
-39
drivers/block/cciss.c
drivers/block/cciss.c
+39
-39
未找到文件。
drivers/block/cciss.c
浏览文件 @
ef7822c2
...
...
@@ -152,9 +152,9 @@ static ctlr_info_t *hba[MAX_CTLR];
static
void
do_cciss_request
(
struct
request_queue
*
q
);
static
irqreturn_t
do_cciss_intr
(
int
irq
,
void
*
dev_id
);
static
int
cciss_open
(
struct
inode
*
inode
,
struct
file
*
filep
);
static
int
cciss_release
(
struct
inode
*
inode
,
struct
file
*
filep
);
static
int
cciss_ioctl
(
struct
inode
*
inode
,
struct
file
*
filep
,
static
int
cciss_open
(
struct
block_device
*
bdev
,
fmode_t
mode
);
static
int
cciss_release
(
struct
gendisk
*
disk
,
fmode_t
mode
);
static
int
cciss_ioctl
(
struct
block_device
*
bdev
,
fmode_t
mode
,
unsigned
int
cmd
,
unsigned
long
arg
);
static
int
cciss_getgeo
(
struct
block_device
*
bdev
,
struct
hd_geometry
*
geo
);
...
...
@@ -192,17 +192,18 @@ static void cciss_procinit(int i)
#endif
/* CONFIG_PROC_FS */
#ifdef CONFIG_COMPAT
static
long
cciss_compat_ioctl
(
struct
file
*
f
,
unsigned
cmd
,
unsigned
long
arg
);
static
int
cciss_compat_ioctl
(
struct
block_device
*
,
fmode_t
,
unsigned
,
unsigned
long
);
#endif
static
struct
block_device_operations
cciss_fops
=
{
.
owner
=
THIS_MODULE
,
.
__
open
=
cciss_open
,
.
__
release
=
cciss_release
,
.
_
_ioctl
=
cciss_ioctl
,
.
open
=
cciss_open
,
.
release
=
cciss_release
,
.
locked
_ioctl
=
cciss_ioctl
,
.
getgeo
=
cciss_getgeo
,
#ifdef CONFIG_COMPAT
.
__
compat_ioctl
=
cciss_compat_ioctl
,
.
compat_ioctl
=
cciss_compat_ioctl
,
#endif
.
revalidate_disk
=
cciss_revalidate
,
};
...
...
@@ -547,13 +548,13 @@ static inline drive_info_struct *get_drv(struct gendisk *disk)
/*
* Open. Make sure the device is really there.
*/
static
int
cciss_open
(
struct
inode
*
inode
,
struct
file
*
filep
)
static
int
cciss_open
(
struct
block_device
*
bdev
,
fmode_t
mode
)
{
ctlr_info_t
*
host
=
get_host
(
inode
->
i_
bdev
->
bd_disk
);
drive_info_struct
*
drv
=
get_drv
(
inode
->
i_
bdev
->
bd_disk
);
ctlr_info_t
*
host
=
get_host
(
bdev
->
bd_disk
);
drive_info_struct
*
drv
=
get_drv
(
bdev
->
bd_disk
);
#ifdef CCISS_DEBUG
printk
(
KERN_DEBUG
"cciss_open %s
\n
"
,
inode
->
i_
bdev
->
bd_disk
->
disk_name
);
printk
(
KERN_DEBUG
"cciss_open %s
\n
"
,
bdev
->
bd_disk
->
disk_name
);
#endif
/* CCISS_DEBUG */
if
(
host
->
busy_initializing
||
drv
->
busy_configuring
)
...
...
@@ -567,9 +568,9 @@ static int cciss_open(struct inode *inode, struct file *filep)
* for "raw controller".
*/
if
(
drv
->
heads
==
0
)
{
if
(
iminor
(
inode
)
!=
0
)
{
/* not node 0? */
if
(
MINOR
(
bdev
->
bd_dev
)
!=
0
)
{
/* not node 0? */
/* if not node 0 make sure it is a partition = 0 */
if
(
iminor
(
inode
)
&
0x0f
)
{
if
(
MINOR
(
bdev
->
bd_dev
)
&
0x0f
)
{
return
-
ENXIO
;
/* if it is, make sure we have a LUN ID */
}
else
if
(
drv
->
LunID
==
0
)
{
...
...
@@ -587,14 +588,13 @@ static int cciss_open(struct inode *inode, struct file *filep)
/*
* Close. Sync first.
*/
static
int
cciss_release
(
struct
inode
*
inode
,
struct
file
*
filep
)
static
int
cciss_release
(
struct
gendisk
*
disk
,
fmode_t
mode
)
{
ctlr_info_t
*
host
=
get_host
(
inode
->
i_bdev
->
bd_
disk
);
drive_info_struct
*
drv
=
get_drv
(
inode
->
i_bdev
->
bd_
disk
);
ctlr_info_t
*
host
=
get_host
(
disk
);
drive_info_struct
*
drv
=
get_drv
(
disk
);
#ifdef CCISS_DEBUG
printk
(
KERN_DEBUG
"cciss_release %s
\n
"
,
inode
->
i_bdev
->
bd_disk
->
disk_name
);
printk
(
KERN_DEBUG
"cciss_release %s
\n
"
,
disk
->
disk_name
);
#endif
/* CCISS_DEBUG */
drv
->
usage_count
--
;
...
...
@@ -604,21 +604,23 @@ static int cciss_release(struct inode *inode, struct file *filep)
#ifdef CONFIG_COMPAT
static
int
do_ioctl
(
struct
file
*
f
,
unsigned
cmd
,
unsigned
long
arg
)
static
int
do_ioctl
(
struct
block_device
*
bdev
,
fmode_t
mode
,
unsigned
cmd
,
unsigned
long
arg
)
{
int
ret
;
lock_kernel
();
ret
=
cciss_ioctl
(
f
->
f_path
.
dentry
->
d_inode
,
f
,
cmd
,
arg
);
ret
=
cciss_ioctl
(
bdev
,
mode
,
cmd
,
arg
);
unlock_kernel
();
return
ret
;
}
static
int
cciss_ioctl32_passthru
(
struct
file
*
f
,
unsigned
cmd
,
unsigned
long
arg
);
static
int
cciss_ioctl32_big_passthru
(
struct
file
*
f
,
unsigned
cmd
,
unsigned
long
arg
);
static
int
cciss_ioctl32_passthru
(
struct
block_device
*
bdev
,
fmode_t
mode
,
unsigned
cmd
,
unsigned
long
arg
);
static
int
cciss_ioctl32_big_passthru
(
struct
block_device
*
bdev
,
fmode_t
mode
,
unsigned
cmd
,
unsigned
long
arg
);
static
long
cciss_compat_ioctl
(
struct
file
*
f
,
unsigned
cmd
,
unsigned
long
arg
)
static
int
cciss_compat_ioctl
(
struct
block_device
*
bdev
,
fmode_t
mode
,
unsigned
cmd
,
unsigned
long
arg
)
{
switch
(
cmd
)
{
case
CCISS_GETPCIINFO
:
...
...
@@ -636,20 +638,20 @@ static long cciss_compat_ioctl(struct file *f, unsigned cmd, unsigned long arg)
case
CCISS_REGNEWD
:
case
CCISS_RESCANDISK
:
case
CCISS_GETLUNINFO
:
return
do_ioctl
(
f
,
cmd
,
arg
);
return
do_ioctl
(
bdev
,
mode
,
cmd
,
arg
);
case
CCISS_PASSTHRU32
:
return
cciss_ioctl32_passthru
(
f
,
cmd
,
arg
);
return
cciss_ioctl32_passthru
(
bdev
,
mode
,
cmd
,
arg
);
case
CCISS_BIG_PASSTHRU32
:
return
cciss_ioctl32_big_passthru
(
f
,
cmd
,
arg
);
return
cciss_ioctl32_big_passthru
(
bdev
,
mode
,
cmd
,
arg
);
default:
return
-
ENOIOCTLCMD
;
}
}
static
int
cciss_ioctl32_passthru
(
struct
file
*
f
,
unsigned
cmd
,
unsigned
long
arg
)
static
int
cciss_ioctl32_passthru
(
struct
block_device
*
bdev
,
fmode_t
mode
,
unsigned
cmd
,
unsigned
long
arg
)
{
IOCTL32_Command_struct
__user
*
arg32
=
(
IOCTL32_Command_struct
__user
*
)
arg
;
...
...
@@ -676,7 +678,7 @@ static int cciss_ioctl32_passthru(struct file *f, unsigned cmd,
if
(
err
)
return
-
EFAULT
;
err
=
do_ioctl
(
f
,
CCISS_PASSTHRU
,
(
unsigned
long
)
p
);
err
=
do_ioctl
(
bdev
,
mode
,
CCISS_PASSTHRU
,
(
unsigned
long
)
p
);
if
(
err
)
return
err
;
err
|=
...
...
@@ -687,8 +689,8 @@ static int cciss_ioctl32_passthru(struct file *f, unsigned cmd,
return
err
;
}
static
int
cciss_ioctl32_big_passthru
(
struct
file
*
file
,
unsigned
cmd
,
unsigned
long
arg
)
static
int
cciss_ioctl32_big_passthru
(
struct
block_device
*
bdev
,
fmode_t
mode
,
unsigned
cmd
,
unsigned
long
arg
)
{
BIG_IOCTL32_Command_struct
__user
*
arg32
=
(
BIG_IOCTL32_Command_struct
__user
*
)
arg
;
...
...
@@ -717,7 +719,7 @@ static int cciss_ioctl32_big_passthru(struct file *file, unsigned cmd,
if
(
err
)
return
-
EFAULT
;
err
=
do_ioctl
(
fil
e
,
CCISS_BIG_PASSTHRU
,
(
unsigned
long
)
p
);
err
=
do_ioctl
(
bdev
,
mod
e
,
CCISS_BIG_PASSTHRU
,
(
unsigned
long
)
p
);
if
(
err
)
return
err
;
err
|=
...
...
@@ -745,10 +747,9 @@ static int cciss_getgeo(struct block_device *bdev, struct hd_geometry *geo)
/*
* ioctl
*/
static
int
cciss_ioctl
(
struct
inode
*
inode
,
struct
file
*
filep
,
static
int
cciss_ioctl
(
struct
block_device
*
bdev
,
fmode_t
mode
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
struct
block_device
*
bdev
=
inode
->
i_bdev
;
struct
gendisk
*
disk
=
bdev
->
bd_disk
;
ctlr_info_t
*
host
=
get_host
(
disk
);
drive_info_struct
*
drv
=
get_drv
(
disk
);
...
...
@@ -1232,8 +1233,7 @@ static int cciss_ioctl(struct inode *inode, struct file *filep,
case
SG_EMULATED_HOST
:
case
SG_IO
:
case
SCSI_IOCTL_SEND_COMMAND
:
return
scsi_cmd_ioctl
(
disk
->
queue
,
disk
,
filep
?
filep
->
f_mode
:
0
,
cmd
,
argp
);
return
scsi_cmd_ioctl
(
disk
->
queue
,
disk
,
mode
,
cmd
,
argp
);
/* scsi_cmd_ioctl would normally handle these, below, but */
/* they aren't a good fit for cciss, as CD-ROMs are */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录