Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
88b428d6
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,发现更多精彩内容 >>
提交
88b428d6
编写于
8月 27, 2012
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
switch infinibarf users of fget() to fget_light()
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
1d3653a7
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
10 addition
and
14 deletion
+10
-14
drivers/infiniband/core/ucma.c
drivers/infiniband/core/ucma.c
+3
-3
drivers/infiniband/core/uverbs_cmd.c
drivers/infiniband/core/uverbs_cmd.c
+4
-9
drivers/infiniband/core/uverbs_main.c
drivers/infiniband/core/uverbs_main.c
+3
-2
未找到文件。
drivers/infiniband/core/ucma.c
浏览文件 @
88b428d6
...
@@ -1186,13 +1186,13 @@ static ssize_t ucma_migrate_id(struct ucma_file *new_file,
...
@@ -1186,13 +1186,13 @@ static ssize_t ucma_migrate_id(struct ucma_file *new_file,
struct
ucma_context
*
ctx
;
struct
ucma_context
*
ctx
;
struct
file
*
filp
;
struct
file
*
filp
;
struct
ucma_file
*
cur_file
;
struct
ucma_file
*
cur_file
;
int
ret
=
0
;
int
ret
=
0
,
fput_needed
;
if
(
copy_from_user
(
&
cmd
,
inbuf
,
sizeof
(
cmd
)))
if
(
copy_from_user
(
&
cmd
,
inbuf
,
sizeof
(
cmd
)))
return
-
EFAULT
;
return
-
EFAULT
;
/* Get current fd to protect against it being closed */
/* Get current fd to protect against it being closed */
filp
=
fget
(
cmd
.
f
d
);
filp
=
fget
_light
(
cmd
.
fd
,
&
fput_neede
d
);
if
(
!
filp
)
if
(
!
filp
)
return
-
ENOENT
;
return
-
ENOENT
;
...
@@ -1231,7 +1231,7 @@ static ssize_t ucma_migrate_id(struct ucma_file *new_file,
...
@@ -1231,7 +1231,7 @@ static ssize_t ucma_migrate_id(struct ucma_file *new_file,
ucma_put_ctx
(
ctx
);
ucma_put_ctx
(
ctx
);
file_put:
file_put:
fput
(
filp
);
fput
_light
(
filp
,
fput_needed
);
return
ret
;
return
ret
;
}
}
...
...
drivers/infiniband/core/uverbs_cmd.c
浏览文件 @
88b428d6
...
@@ -707,7 +707,7 @@ ssize_t ib_uverbs_open_xrcd(struct ib_uverbs_file *file,
...
@@ -707,7 +707,7 @@ ssize_t ib_uverbs_open_xrcd(struct ib_uverbs_file *file,
struct
ib_xrcd
*
xrcd
=
NULL
;
struct
ib_xrcd
*
xrcd
=
NULL
;
struct
file
*
f
=
NULL
;
struct
file
*
f
=
NULL
;
struct
inode
*
inode
=
NULL
;
struct
inode
*
inode
=
NULL
;
int
ret
=
0
;
int
ret
=
0
,
fput_needed
;
int
new_xrcd
=
0
;
int
new_xrcd
=
0
;
if
(
out_len
<
sizeof
resp
)
if
(
out_len
<
sizeof
resp
)
...
@@ -724,18 +724,13 @@ ssize_t ib_uverbs_open_xrcd(struct ib_uverbs_file *file,
...
@@ -724,18 +724,13 @@ ssize_t ib_uverbs_open_xrcd(struct ib_uverbs_file *file,
if
(
cmd
.
fd
!=
-
1
)
{
if
(
cmd
.
fd
!=
-
1
)
{
/* search for file descriptor */
/* search for file descriptor */
f
=
fget
(
cmd
.
f
d
);
f
=
fget
_light
(
cmd
.
fd
,
&
fput_neede
d
);
if
(
!
f
)
{
if
(
!
f
)
{
ret
=
-
EBADF
;
ret
=
-
EBADF
;
goto
err_tree_mutex_unlock
;
goto
err_tree_mutex_unlock
;
}
}
inode
=
f
->
f_dentry
->
d_inode
;
inode
=
f
->
f_dentry
->
d_inode
;
if
(
!
inode
)
{
ret
=
-
EBADF
;
goto
err_tree_mutex_unlock
;
}
xrcd
=
find_xrcd
(
file
->
device
,
inode
);
xrcd
=
find_xrcd
(
file
->
device
,
inode
);
if
(
!
xrcd
&&
!
(
cmd
.
oflags
&
O_CREAT
))
{
if
(
!
xrcd
&&
!
(
cmd
.
oflags
&
O_CREAT
))
{
/* no file descriptor. Need CREATE flag */
/* no file descriptor. Need CREATE flag */
...
@@ -801,7 +796,7 @@ ssize_t ib_uverbs_open_xrcd(struct ib_uverbs_file *file,
...
@@ -801,7 +796,7 @@ ssize_t ib_uverbs_open_xrcd(struct ib_uverbs_file *file,
}
}
if
(
f
)
if
(
f
)
fput
(
f
);
fput
_light
(
f
,
fput_needed
);
mutex_lock
(
&
file
->
mutex
);
mutex_lock
(
&
file
->
mutex
);
list_add_tail
(
&
obj
->
uobject
.
list
,
&
file
->
ucontext
->
xrcd_list
);
list_add_tail
(
&
obj
->
uobject
.
list
,
&
file
->
ucontext
->
xrcd_list
);
...
@@ -831,7 +826,7 @@ ssize_t ib_uverbs_open_xrcd(struct ib_uverbs_file *file,
...
@@ -831,7 +826,7 @@ ssize_t ib_uverbs_open_xrcd(struct ib_uverbs_file *file,
err_tree_mutex_unlock:
err_tree_mutex_unlock:
if
(
f
)
if
(
f
)
fput
(
f
);
fput
_light
(
f
,
fput_needed
);
mutex_unlock
(
&
file
->
device
->
xrcd_tree_mutex
);
mutex_unlock
(
&
file
->
device
->
xrcd_tree_mutex
);
...
...
drivers/infiniband/core/uverbs_main.c
浏览文件 @
88b428d6
...
@@ -542,8 +542,9 @@ struct ib_uverbs_event_file *ib_uverbs_lookup_comp_file(int fd)
...
@@ -542,8 +542,9 @@ struct ib_uverbs_event_file *ib_uverbs_lookup_comp_file(int fd)
{
{
struct
ib_uverbs_event_file
*
ev_file
=
NULL
;
struct
ib_uverbs_event_file
*
ev_file
=
NULL
;
struct
file
*
filp
;
struct
file
*
filp
;
int
fput_needed
;
filp
=
fget
(
f
d
);
filp
=
fget
_light
(
fd
,
&
fput_neede
d
);
if
(
!
filp
)
if
(
!
filp
)
return
NULL
;
return
NULL
;
...
@@ -559,7 +560,7 @@ struct ib_uverbs_event_file *ib_uverbs_lookup_comp_file(int fd)
...
@@ -559,7 +560,7 @@ struct ib_uverbs_event_file *ib_uverbs_lookup_comp_file(int fd)
kref_get
(
&
ev_file
->
ref
);
kref_get
(
&
ev_file
->
ref
);
out:
out:
fput
(
filp
);
fput
_light
(
filp
,
fput_needed
);
return
ev_file
;
return
ev_file
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录