Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xiphi1978
linux
提交
44ba8406
L
linux
项目概览
xiphi1978
/
linux
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
44ba8406
编写于
3月 06, 2014
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ncpfs: switch to sockfd_lookup()/sockfd_put()
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
e2511578
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
12 addition
and
40 deletion
+12
-40
fs/ncpfs/inode.c
fs/ncpfs/inode.c
+12
-38
fs/ncpfs/ncp_fs_sb.h
fs/ncpfs/ncp_fs_sb.h
+0
-2
未找到文件。
fs/ncpfs/inode.c
浏览文件 @
44ba8406
...
...
@@ -468,9 +468,7 @@ static int ncp_fill_super(struct super_block *sb, void *raw_data, int silent)
{
struct
ncp_mount_data_kernel
data
;
struct
ncp_server
*
server
;
struct
file
*
ncp_filp
;
struct
inode
*
root_inode
;
struct
inode
*
sock_inode
;
struct
socket
*
sock
;
int
error
;
int
default_bufsize
;
...
...
@@ -539,18 +537,10 @@ static int ncp_fill_super(struct super_block *sb, void *raw_data, int silent)
if
(
!
uid_valid
(
data
.
mounted_uid
)
||
!
uid_valid
(
data
.
uid
)
||
!
gid_valid
(
data
.
gid
))
goto
out
;
error
=
-
EBADF
;
ncp_filp
=
fget
(
data
.
ncp_fd
);
if
(
!
ncp_filp
)
goto
out
;
error
=
-
ENOTSOCK
;
sock_inode
=
file_inode
(
ncp_filp
);
if
(
!
S_ISSOCK
(
sock_inode
->
i_mode
))
goto
out_fput
;
sock
=
SOCKET_I
(
sock_inode
);
sock
=
sockfd_lookup
(
data
.
ncp_fd
,
&
error
);
if
(
!
sock
)
goto
out
_fput
;
goto
out
;
if
(
sock
->
type
==
SOCK_STREAM
)
default_bufsize
=
0xF000
;
else
...
...
@@ -572,27 +562,16 @@ static int ncp_fill_super(struct super_block *sb, void *raw_data, int silent)
if
(
error
)
goto
out_fput
;
server
->
ncp_filp
=
ncp_filp
;
server
->
ncp_sock
=
sock
;
if
(
data
.
info_fd
!=
-
1
)
{
struct
socket
*
info_sock
;
error
=
-
EBADF
;
server
->
info_filp
=
fget
(
data
.
info_fd
);
if
(
!
server
->
info_filp
)
goto
out_bdi
;
error
=
-
ENOTSOCK
;
sock_inode
=
file_inode
(
server
->
info_filp
);
if
(
!
S_ISSOCK
(
sock_inode
->
i_mode
))
goto
out_fput2
;
info_sock
=
SOCKET_I
(
sock_inode
);
struct
socket
*
info_sock
=
sockfd_lookup
(
data
.
info_fd
,
&
error
);
if
(
!
info_sock
)
goto
out_fput2
;
goto
out_bdi
;
server
->
info_sock
=
info_sock
;
error
=
-
EBADFD
;
if
(
info_sock
->
type
!=
SOCK_STREAM
)
goto
out_fput2
;
server
->
info_sock
=
info_sock
;
}
/* server->lock = 0; */
...
...
@@ -764,17 +743,12 @@ static int ncp_fill_super(struct super_block *sb, void *raw_data, int silent)
mutex_destroy
(
&
server
->
root_setup_lock
);
mutex_destroy
(
&
server
->
mutex
);
out_fput2:
if
(
server
->
info_
filp
)
fput
(
server
->
info_filp
);
if
(
server
->
info_
sock
)
sockfd_put
(
server
->
info_sock
);
out_bdi:
bdi_destroy
(
&
server
->
bdi
);
out_fput:
/* 23/12/1998 Marcin Dalecki <dalecki@cs.net.pl>:
*
* The previously used put_filp(ncp_filp); was bogus, since
* it doesn't perform proper unlocking.
*/
fput
(
ncp_filp
);
sockfd_put
(
sock
);
out:
put_pid
(
data
.
wdog_pid
);
sb
->
s_fs_info
=
NULL
;
...
...
@@ -807,9 +781,9 @@ static void ncp_put_super(struct super_block *sb)
mutex_destroy
(
&
server
->
root_setup_lock
);
mutex_destroy
(
&
server
->
mutex
);
if
(
server
->
info_
filp
)
fput
(
server
->
info_filp
);
fput
(
server
->
ncp_filp
);
if
(
server
->
info_
sock
)
sockfd_put
(
server
->
info_sock
);
sockfd_put
(
server
->
ncp_sock
);
kill_pid
(
server
->
m
.
wdog_pid
,
SIGTERM
,
1
);
put_pid
(
server
->
m
.
wdog_pid
);
...
...
fs/ncpfs/ncp_fs_sb.h
浏览文件 @
44ba8406
...
...
@@ -45,9 +45,7 @@ struct ncp_server {
__u8
name_space
[
NCP_NUMBER_OF_VOLUMES
+
2
];
struct
file
*
ncp_filp
;
/* File pointer to ncp socket */
struct
socket
*
ncp_sock
;
/* ncp socket */
struct
file
*
info_filp
;
struct
socket
*
info_sock
;
u8
sequence
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录