Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
abbcf28f
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
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看板
提交
abbcf28f
编写于
1月 03, 2006
作者:
T
Trond Myklebust
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
SUNRPC: Yet more RPC cleanups
Signed-off-by:
N
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
上级
abd3e641
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
34 addition
and
40 deletion
+34
-40
include/linux/sunrpc/sched.h
include/linux/sunrpc/sched.h
+2
-1
net/sunrpc/clnt.c
net/sunrpc/clnt.c
+17
-15
net/sunrpc/pmap_clnt.c
net/sunrpc/pmap_clnt.c
+3
-5
net/sunrpc/sched.c
net/sunrpc/sched.c
+12
-19
未找到文件。
include/linux/sunrpc/sched.h
浏览文件 @
abbcf28f
...
...
@@ -233,6 +233,7 @@ struct rpc_task *rpc_new_child(struct rpc_clnt *, struct rpc_task *parent);
void
rpc_init_task
(
struct
rpc_task
*
,
struct
rpc_clnt
*
,
rpc_action
exitfunc
,
int
flags
);
void
rpc_release_task
(
struct
rpc_task
*
);
void
rpc_exit_task
(
struct
rpc_task
*
);
void
rpc_killall_tasks
(
struct
rpc_clnt
*
);
int
rpc_execute
(
struct
rpc_task
*
);
void
rpc_run_child
(
struct
rpc_task
*
parent
,
struct
rpc_task
*
child
,
...
...
@@ -259,7 +260,7 @@ void rpc_destroy_mempool(void);
static
inline
void
rpc_exit
(
struct
rpc_task
*
task
,
int
status
)
{
task
->
tk_status
=
status
;
task
->
tk_action
=
NULL
;
task
->
tk_action
=
rpc_exit_task
;
}
#ifdef RPC_DEBUG
...
...
net/sunrpc/clnt.c
浏览文件 @
abbcf28f
...
...
@@ -511,7 +511,7 @@ rpc_call_setup(struct rpc_task *task, struct rpc_message *msg, int flags)
if
(
task
->
tk_status
==
0
)
task
->
tk_action
=
call_start
;
else
task
->
tk_action
=
NULL
;
task
->
tk_action
=
rpc_exit_task
;
}
void
...
...
@@ -892,7 +892,7 @@ call_transmit(struct rpc_task *task)
if
(
task
->
tk_status
<
0
)
return
;
if
(
!
task
->
tk_msg
.
rpc_proc
->
p_decode
)
{
task
->
tk_action
=
NULL
;
task
->
tk_action
=
rpc_exit_task
;
rpc_wake_up_task
(
task
);
}
return
;
...
...
@@ -1039,13 +1039,14 @@ call_decode(struct rpc_task *task)
sizeof
(
req
->
rq_rcv_buf
))
!=
0
);
/* Verify the RPC header */
if
(
!
(
p
=
call_verify
(
task
)))
{
if
(
task
->
tk_action
==
NULL
)
return
;
p
=
call_verify
(
task
);
if
(
IS_ERR
(
p
))
{
if
(
p
==
ERR_PTR
(
-
EAGAIN
))
goto
out_retry
;
return
;
}
task
->
tk_action
=
NULL
;
task
->
tk_action
=
rpc_exit_task
;
if
(
decode
)
task
->
tk_status
=
rpcauth_unwrap_resp
(
task
,
decode
,
req
,
p
,
...
...
@@ -1138,7 +1139,7 @@ call_verify(struct rpc_task *task)
if
((
n
=
ntohl
(
*
p
++
))
!=
RPC_REPLY
)
{
printk
(
KERN_WARNING
"call_verify: not an RPC reply: %x
\n
"
,
n
);
goto
out_
retry
;
goto
out_
garbage
;
}
if
((
n
=
ntohl
(
*
p
++
))
!=
RPC_MSG_ACCEPTED
)
{
if
(
--
len
<
0
)
...
...
@@ -1168,7 +1169,7 @@ call_verify(struct rpc_task *task)
task
->
tk_pid
);
rpcauth_invalcred
(
task
);
task
->
tk_action
=
call_refresh
;
return
NULL
;
goto
out_retry
;
case
RPC_AUTH_BADCRED
:
case
RPC_AUTH_BADVERF
:
/* possibly garbled cred/verf? */
...
...
@@ -1178,7 +1179,7 @@ call_verify(struct rpc_task *task)
dprintk
(
"RPC: %4d call_verify: retry garbled creds
\n
"
,
task
->
tk_pid
);
task
->
tk_action
=
call_bind
;
return
NULL
;
goto
out_retry
;
case
RPC_AUTH_TOOWEAK
:
printk
(
KERN_NOTICE
"call_verify: server requires stronger "
"authentication.
\n
"
);
...
...
@@ -1193,7 +1194,7 @@ call_verify(struct rpc_task *task)
}
if
(
!
(
p
=
rpcauth_checkverf
(
task
,
p
)))
{
printk
(
KERN_WARNING
"call_verify: auth check failed
\n
"
);
goto
out_
retry
;
/* bad verifier, retry */
goto
out_
garbage
;
/* bad verifier, retry */
}
len
=
p
-
(
u32
*
)
iov
->
iov_base
-
1
;
if
(
len
<
0
)
...
...
@@ -1230,23 +1231,24 @@ call_verify(struct rpc_task *task)
/* Also retry */
}
out_
retry
:
out_
garbage
:
task
->
tk_client
->
cl_stats
->
rpcgarbage
++
;
if
(
task
->
tk_garb_retry
)
{
task
->
tk_garb_retry
--
;
dprintk
(
"RPC %s: retrying %4d
\n
"
,
__FUNCTION__
,
task
->
tk_pid
);
task
->
tk_action
=
call_bind
;
return
NULL
;
out_retry:
return
ERR_PTR
(
-
EAGAIN
);
}
printk
(
KERN_WARNING
"RPC %s: retry failed, exit EIO
\n
"
,
__FUNCTION__
);
out_eio:
error
=
-
EIO
;
out_err:
rpc_exit
(
task
,
error
);
return
NULL
;
return
ERR_PTR
(
error
)
;
out_overflow:
printk
(
KERN_WARNING
"RPC %s: server reply was truncated.
\n
"
,
__FUNCTION__
);
goto
out_
retry
;
goto
out_
garbage
;
}
static
int
rpcproc_encode_null
(
void
*
rqstp
,
u32
*
data
,
void
*
obj
)
...
...
net/sunrpc/pmap_clnt.c
浏览文件 @
abbcf28f
...
...
@@ -90,8 +90,7 @@ rpc_getport(struct rpc_task *task, struct rpc_clnt *clnt)
map
->
pm_binding
=
0
;
rpc_wake_up
(
&
map
->
pm_bindwait
);
spin_unlock
(
&
pmap_lock
);
task
->
tk_status
=
-
EIO
;
task
->
tk_action
=
NULL
;
rpc_exit
(
task
,
-
EIO
);
}
#ifdef CONFIG_ROOT_NFS
...
...
@@ -138,11 +137,10 @@ pmap_getport_done(struct rpc_task *task)
task
->
tk_pid
,
task
->
tk_status
,
clnt
->
cl_port
);
if
(
task
->
tk_status
<
0
)
{
/* Make the calling task exit with an error */
task
->
tk_action
=
NULL
;
task
->
tk_action
=
rpc_exit_task
;
}
else
if
(
clnt
->
cl_port
==
0
)
{
/* Program not registered */
task
->
tk_status
=
-
EACCES
;
task
->
tk_action
=
NULL
;
rpc_exit
(
task
,
-
EACCES
);
}
else
{
/* byte-swap port number first */
clnt
->
cl_port
=
htons
(
clnt
->
cl_port
);
...
...
net/sunrpc/sched.c
浏览文件 @
abbcf28f
...
...
@@ -555,28 +555,22 @@ __rpc_atrun(struct rpc_task *task)
}
/*
* Helper that calls task->tk_exit if it exists and then returns
* true if we should exit __rpc_execute.
* Helper that calls task->tk_exit if it exists
*/
static
inline
int
__rpc_do_exit
(
struct
rpc_task
*
task
)
void
rpc_exit_task
(
struct
rpc_task
*
task
)
{
task
->
tk_action
=
NULL
;
if
(
task
->
tk_exit
!=
NULL
)
{
lock_kernel
();
task
->
tk_exit
(
task
);
unlock_kernel
();
/* If tk_action is non-null, we should restart the call */
if
(
task
->
tk_action
!=
NULL
)
{
if
(
!
RPC_ASSASSINATED
(
task
))
{
/* Releas
e RPC slot and buffer memory */
WARN_ON
(
RPC_ASSASSINATED
(
task
));
/* Always release th
e RPC slot and buffer memory */
xprt_release
(
task
);
rpc_free
(
task
);
return
0
;
}
printk
(
KERN_ERR
"RPC: dead task tried to walk away.
\n
"
);
}
}
return
1
;
}
EXPORT_SYMBOL
(
rpc_exit_task
);
static
int
rpc_wait_bit_interruptible
(
void
*
word
)
{
...
...
@@ -631,12 +625,11 @@ static int __rpc_execute(struct rpc_task *task)
* by someone else.
*/
if
(
!
RPC_IS_QUEUED
(
task
))
{
if
(
task
->
tk_action
!=
NULL
)
{
if
(
task
->
tk_action
==
NULL
)
break
;
lock_kernel
();
task
->
tk_action
(
task
);
unlock_kernel
();
}
else
if
(
__rpc_do_exit
(
task
))
break
;
}
/*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录