Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
764a4a8e
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看板
提交
764a4a8e
编写于
5月 15, 2008
作者:
J
Jonathan Corbet
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drivers/s390: cdev lock_kernel() pushdown
Signed-off-by:
N
Jonathan Corbet
<
corbet@lwn.net
>
上级
51a776fa
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
41 addition
and
14 deletion
+41
-14
drivers/s390/char/fs3270.c
drivers/s390/char/fs3270.c
+16
-7
drivers/s390/char/tape_char.c
drivers/s390/char/tape_char.c
+9
-3
drivers/s390/char/vmlogrdr.c
drivers/s390/char/vmlogrdr.c
+7
-1
drivers/s390/char/vmur.c
drivers/s390/char/vmur.c
+9
-3
未找到文件。
drivers/s390/char/fs3270.c
浏览文件 @
764a4a8e
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
#include <linux/interrupt.h>
#include <linux/interrupt.h>
#include <linux/list.h>
#include <linux/list.h>
#include <linux/types.h>
#include <linux/types.h>
#include <linux/smp_lock.h>
#include <asm/ccwdev.h>
#include <asm/ccwdev.h>
#include <asm/cio.h>
#include <asm/cio.h>
...
@@ -421,6 +422,7 @@ fs3270_open(struct inode *inode, struct file *filp)
...
@@ -421,6 +422,7 @@ fs3270_open(struct inode *inode, struct file *filp)
if
(
imajor
(
filp
->
f_path
.
dentry
->
d_inode
)
!=
IBM_FS3270_MAJOR
)
if
(
imajor
(
filp
->
f_path
.
dentry
->
d_inode
)
!=
IBM_FS3270_MAJOR
)
return
-
ENODEV
;
return
-
ENODEV
;
lock_kernel
();
minor
=
iminor
(
filp
->
f_path
.
dentry
->
d_inode
);
minor
=
iminor
(
filp
->
f_path
.
dentry
->
d_inode
);
/* Check for minor 0 multiplexer. */
/* Check for minor 0 multiplexer. */
if
(
minor
==
0
)
{
if
(
minor
==
0
)
{
...
@@ -429,7 +431,8 @@ fs3270_open(struct inode *inode, struct file *filp)
...
@@ -429,7 +431,8 @@ fs3270_open(struct inode *inode, struct file *filp)
tty
=
get_current_tty
();
tty
=
get_current_tty
();
if
(
!
tty
||
tty
->
driver
->
major
!=
IBM_TTY3270_MAJOR
)
{
if
(
!
tty
||
tty
->
driver
->
major
!=
IBM_TTY3270_MAJOR
)
{
mutex_unlock
(
&
tty_mutex
);
mutex_unlock
(
&
tty_mutex
);
return
-
ENODEV
;
rc
=
-
ENODEV
;
goto
out
;
}
}
minor
=
tty
->
index
+
RAW3270_FIRSTMINOR
;
minor
=
tty
->
index
+
RAW3270_FIRSTMINOR
;
mutex_unlock
(
&
tty_mutex
);
mutex_unlock
(
&
tty_mutex
);
...
@@ -438,19 +441,22 @@ fs3270_open(struct inode *inode, struct file *filp)
...
@@ -438,19 +441,22 @@ fs3270_open(struct inode *inode, struct file *filp)
fp
=
(
struct
fs3270
*
)
raw3270_find_view
(
&
fs3270_fn
,
minor
);
fp
=
(
struct
fs3270
*
)
raw3270_find_view
(
&
fs3270_fn
,
minor
);
if
(
!
IS_ERR
(
fp
))
{
if
(
!
IS_ERR
(
fp
))
{
raw3270_put_view
(
&
fp
->
view
);
raw3270_put_view
(
&
fp
->
view
);
return
-
EBUSY
;
rc
=
-
EBUSY
;
goto
out
;
}
}
/* Allocate fullscreen view structure. */
/* Allocate fullscreen view structure. */
fp
=
fs3270_alloc_view
();
fp
=
fs3270_alloc_view
();
if
(
IS_ERR
(
fp
))
if
(
IS_ERR
(
fp
))
{
return
PTR_ERR
(
fp
);
rc
=
PTR_ERR
(
fp
);
goto
out
;
}
init_waitqueue_head
(
&
fp
->
wait
);
init_waitqueue_head
(
&
fp
->
wait
);
fp
->
fs_pid
=
get_pid
(
task_pid
(
current
));
fp
->
fs_pid
=
get_pid
(
task_pid
(
current
));
rc
=
raw3270_add_view
(
&
fp
->
view
,
&
fs3270_fn
,
minor
);
rc
=
raw3270_add_view
(
&
fp
->
view
,
&
fs3270_fn
,
minor
);
if
(
rc
)
{
if
(
rc
)
{
fs3270_free_view
(
&
fp
->
view
);
fs3270_free_view
(
&
fp
->
view
);
return
rc
;
goto
out
;
}
}
/* Allocate idal-buffer. */
/* Allocate idal-buffer. */
...
@@ -458,7 +464,8 @@ fs3270_open(struct inode *inode, struct file *filp)
...
@@ -458,7 +464,8 @@ fs3270_open(struct inode *inode, struct file *filp)
if
(
IS_ERR
(
ib
))
{
if
(
IS_ERR
(
ib
))
{
raw3270_put_view
(
&
fp
->
view
);
raw3270_put_view
(
&
fp
->
view
);
raw3270_del_view
(
&
fp
->
view
);
raw3270_del_view
(
&
fp
->
view
);
return
PTR_ERR
(
fp
);
rc
=
PTR_ERR
(
fp
);
goto
out
;
}
}
fp
->
rdbuf
=
ib
;
fp
->
rdbuf
=
ib
;
...
@@ -466,9 +473,11 @@ fs3270_open(struct inode *inode, struct file *filp)
...
@@ -466,9 +473,11 @@ fs3270_open(struct inode *inode, struct file *filp)
if
(
rc
)
{
if
(
rc
)
{
raw3270_put_view
(
&
fp
->
view
);
raw3270_put_view
(
&
fp
->
view
);
raw3270_del_view
(
&
fp
->
view
);
raw3270_del_view
(
&
fp
->
view
);
return
rc
;
goto
out
;
}
}
filp
->
private_data
=
fp
;
filp
->
private_data
=
fp
;
out:
unlock_kernel
();
return
0
;
return
0
;
}
}
...
...
drivers/s390/char/tape_char.c
浏览文件 @
764a4a8e
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
#include <linux/types.h>
#include <linux/types.h>
#include <linux/proc_fs.h>
#include <linux/proc_fs.h>
#include <linux/mtio.h>
#include <linux/mtio.h>
#include <linux/smp_lock.h>
#include <asm/uaccess.h>
#include <asm/uaccess.h>
...
@@ -289,21 +290,26 @@ tapechar_open (struct inode *inode, struct file *filp)
...
@@ -289,21 +290,26 @@ tapechar_open (struct inode *inode, struct file *filp)
if
(
imajor
(
filp
->
f_path
.
dentry
->
d_inode
)
!=
tapechar_major
)
if
(
imajor
(
filp
->
f_path
.
dentry
->
d_inode
)
!=
tapechar_major
)
return
-
ENODEV
;
return
-
ENODEV
;
lock_kernel
();
minor
=
iminor
(
filp
->
f_path
.
dentry
->
d_inode
);
minor
=
iminor
(
filp
->
f_path
.
dentry
->
d_inode
);
device
=
tape_get_device
(
minor
/
TAPE_MINORS_PER_DEV
);
device
=
tape_get_device
(
minor
/
TAPE_MINORS_PER_DEV
);
if
(
IS_ERR
(
device
))
{
if
(
IS_ERR
(
device
))
{
DBF_EVENT
(
3
,
"TCHAR:open: tape_get_device() failed
\n
"
);
DBF_EVENT
(
3
,
"TCHAR:open: tape_get_device() failed
\n
"
);
return
PTR_ERR
(
device
);
rc
=
PTR_ERR
(
device
);
goto
out
;
}
}
rc
=
tape_open
(
device
);
rc
=
tape_open
(
device
);
if
(
rc
==
0
)
{
if
(
rc
==
0
)
{
filp
->
private_data
=
device
;
filp
->
private_data
=
device
;
r
eturn
nonseekable_open
(
inode
,
filp
);
r
c
=
nonseekable_open
(
inode
,
filp
);
}
}
tape_put_device
(
device
);
else
tape_put_device
(
device
);
out:
unlock_kernel
();
return
rc
;
return
rc
;
}
}
...
...
drivers/s390/char/vmlogrdr.c
浏览文件 @
764a4a8e
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
#include <linux/kmod.h>
#include <linux/kmod.h>
#include <linux/cdev.h>
#include <linux/cdev.h>
#include <linux/device.h>
#include <linux/device.h>
#include <linux/smp_lock.h>
#include <linux/string.h>
#include <linux/string.h>
...
@@ -319,9 +320,11 @@ static int vmlogrdr_open (struct inode *inode, struct file *filp)
...
@@ -319,9 +320,11 @@ static int vmlogrdr_open (struct inode *inode, struct file *filp)
return
-
ENOSYS
;
return
-
ENOSYS
;
/* Besure this device hasn't already been opened */
/* Besure this device hasn't already been opened */
lock_kernel
();
spin_lock_bh
(
&
logptr
->
priv_lock
);
spin_lock_bh
(
&
logptr
->
priv_lock
);
if
(
logptr
->
dev_in_use
)
{
if
(
logptr
->
dev_in_use
)
{
spin_unlock_bh
(
&
logptr
->
priv_lock
);
spin_unlock_bh
(
&
logptr
->
priv_lock
);
unlock_kernel
();
return
-
EBUSY
;
return
-
EBUSY
;
}
}
logptr
->
dev_in_use
=
1
;
logptr
->
dev_in_use
=
1
;
...
@@ -365,7 +368,9 @@ static int vmlogrdr_open (struct inode *inode, struct file *filp)
...
@@ -365,7 +368,9 @@ static int vmlogrdr_open (struct inode *inode, struct file *filp)
||
(
logptr
->
iucv_path_severed
));
||
(
logptr
->
iucv_path_severed
));
if
(
logptr
->
iucv_path_severed
)
if
(
logptr
->
iucv_path_severed
)
goto
out_record
;
goto
out_record
;
return
nonseekable_open
(
inode
,
filp
);
ret
=
nonseekable_open
(
inode
,
filp
);
unlock_kernel
();
return
ret
;
out_record:
out_record:
if
(
logptr
->
autorecording
)
if
(
logptr
->
autorecording
)
...
@@ -375,6 +380,7 @@ static int vmlogrdr_open (struct inode *inode, struct file *filp)
...
@@ -375,6 +380,7 @@ static int vmlogrdr_open (struct inode *inode, struct file *filp)
logptr
->
path
=
NULL
;
logptr
->
path
=
NULL
;
out_dev:
out_dev:
logptr
->
dev_in_use
=
0
;
logptr
->
dev_in_use
=
0
;
unlock_kernel
();
return
-
EIO
;
return
-
EIO
;
}
}
...
...
drivers/s390/char/vmur.c
浏览文件 @
764a4a8e
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
*/
*/
#include <linux/cdev.h>
#include <linux/cdev.h>
#include <linux/smp_lock.h>
#include <asm/uaccess.h>
#include <asm/uaccess.h>
#include <asm/cio.h>
#include <asm/cio.h>
...
@@ -668,7 +669,7 @@ static int ur_open(struct inode *inode, struct file *file)
...
@@ -668,7 +669,7 @@ static int ur_open(struct inode *inode, struct file *file)
if
(
accmode
==
O_RDWR
)
if
(
accmode
==
O_RDWR
)
return
-
EACCES
;
return
-
EACCES
;
lock_kernel
();
/*
/*
* We treat the minor number as the devno of the ur device
* We treat the minor number as the devno of the ur device
* to find in the driver tree.
* to find in the driver tree.
...
@@ -676,8 +677,10 @@ static int ur_open(struct inode *inode, struct file *file)
...
@@ -676,8 +677,10 @@ static int ur_open(struct inode *inode, struct file *file)
devno
=
MINOR
(
file
->
f_dentry
->
d_inode
->
i_rdev
);
devno
=
MINOR
(
file
->
f_dentry
->
d_inode
->
i_rdev
);
urd
=
urdev_get_from_devno
(
devno
);
urd
=
urdev_get_from_devno
(
devno
);
if
(
!
urd
)
if
(
!
urd
)
{
return
-
ENXIO
;
rc
=
-
ENXIO
;
goto
out
;
}
spin_lock
(
&
urd
->
open_lock
);
spin_lock
(
&
urd
->
open_lock
);
while
(
urd
->
open_flag
)
{
while
(
urd
->
open_flag
)
{
...
@@ -720,6 +723,7 @@ static int ur_open(struct inode *inode, struct file *file)
...
@@ -720,6 +723,7 @@ static int ur_open(struct inode *inode, struct file *file)
goto
fail_urfile_free
;
goto
fail_urfile_free
;
urf
->
file_reclen
=
rc
;
urf
->
file_reclen
=
rc
;
file
->
private_data
=
urf
;
file
->
private_data
=
urf
;
unlock_kernel
();
return
0
;
return
0
;
fail_urfile_free:
fail_urfile_free:
...
@@ -730,6 +734,8 @@ static int ur_open(struct inode *inode, struct file *file)
...
@@ -730,6 +734,8 @@ static int ur_open(struct inode *inode, struct file *file)
spin_unlock
(
&
urd
->
open_lock
);
spin_unlock
(
&
urd
->
open_lock
);
fail_put:
fail_put:
urdev_put
(
urd
);
urdev_put
(
urd
);
out:
unlock_kernel
();
return
rc
;
return
rc
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录