Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
07737691
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看板
提交
07737691
编写于
10月 25, 2007
作者:
T
Trond Myklebust
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
NFS/SUNRPC: Convert users of rpc_init_task+rpc_execute to rpc_run_task()
Signed-off-by:
N
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
上级
e8f5d77c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
35 addition
and
34 deletion
+35
-34
fs/nfs/direct.c
fs/nfs/direct.c
+20
-8
fs/nfs/read.c
fs/nfs/read.c
+5
-12
fs/nfs/write.c
fs/nfs/write.c
+10
-14
未找到文件。
fs/nfs/direct.c
浏览文件 @
07737691
...
...
@@ -272,6 +272,7 @@ static ssize_t nfs_direct_read_schedule_segment(struct nfs_direct_req *dreq,
unsigned
long
user_addr
=
(
unsigned
long
)
iov
->
iov_base
;
size_t
count
=
iov
->
iov_len
;
size_t
rsize
=
NFS_SERVER
(
inode
)
->
rsize
;
struct
rpc_task
*
task
;
struct
rpc_message
msg
=
{
.
rpc_cred
=
ctx
->
cred
,
};
...
...
@@ -333,11 +334,13 @@ static ssize_t nfs_direct_read_schedule_segment(struct nfs_direct_req *dreq,
msg
.
rpc_argp
=
&
data
->
args
;
msg
.
rpc_resp
=
&
data
->
res
;
task_setup_data
.
task
=
&
data
->
task
;
task_setup_data
.
callback_data
=
data
;
NFS_PROTO
(
inode
)
->
read_setup
(
data
,
&
msg
);
rpc_init_task
(
&
data
->
task
,
&
task_setup_data
);
rpc_execute
(
&
data
->
task
);
task
=
rpc_run_task
(
&
task_setup_data
);
if
(
!
IS_ERR
(
task
))
rpc_put_task
(
task
);
dprintk
(
"NFS: %5u initiated direct read call "
"(req %s/%Ld, %zu bytes @ offset %Lu)
\n
"
,
...
...
@@ -440,6 +443,7 @@ static void nfs_direct_write_reschedule(struct nfs_direct_req *dreq)
struct
inode
*
inode
=
dreq
->
inode
;
struct
list_head
*
p
;
struct
nfs_write_data
*
data
;
struct
rpc_task
*
task
;
struct
rpc_message
msg
=
{
.
rpc_cred
=
dreq
->
ctx
->
cred
,
};
...
...
@@ -471,16 +475,18 @@ static void nfs_direct_write_reschedule(struct nfs_direct_req *dreq)
* Reuse data->task; data->args should not have changed
* since the original request was sent.
*/
task_setup_data
.
task
=
&
data
->
task
;
task_setup_data
.
callback_data
=
data
;
msg
.
rpc_argp
=
&
data
->
args
;
msg
.
rpc_resp
=
&
data
->
res
;
NFS_PROTO
(
inode
)
->
write_setup
(
data
,
&
msg
);
rpc_init_task
(
&
data
->
task
,
&
task_setup_data
);
/*
* We're called via an RPC callback, so BKL is already held.
*/
rpc_execute
(
&
data
->
task
);
task
=
rpc_run_task
(
&
task_setup_data
);
if
(
!
IS_ERR
(
task
))
rpc_put_task
(
task
);
dprintk
(
"NFS: %5u rescheduled direct write call (req %s/%Ld, %u bytes @ offset %Lu)
\n
"
,
data
->
task
.
tk_pid
,
...
...
@@ -523,12 +529,14 @@ static const struct rpc_call_ops nfs_commit_direct_ops = {
static
void
nfs_direct_commit_schedule
(
struct
nfs_direct_req
*
dreq
)
{
struct
nfs_write_data
*
data
=
dreq
->
commit_data
;
struct
rpc_task
*
task
;
struct
rpc_message
msg
=
{
.
rpc_argp
=
&
data
->
args
,
.
rpc_resp
=
&
data
->
res
,
.
rpc_cred
=
dreq
->
ctx
->
cred
,
};
struct
rpc_task_setup
task_setup_data
=
{
.
task
=
&
data
->
task
,
.
rpc_client
=
NFS_CLIENT
(
dreq
->
inode
),
.
rpc_message
=
&
msg
,
.
callback_ops
=
&
nfs_commit_direct_ops
,
...
...
@@ -547,14 +555,15 @@ static void nfs_direct_commit_schedule(struct nfs_direct_req *dreq)
data
->
res
.
verf
=
&
data
->
verf
;
NFS_PROTO
(
data
->
inode
)
->
commit_setup
(
data
,
&
msg
);
rpc_init_task
(
&
data
->
task
,
&
task_setup_data
);
/* Note: task.tk_ops->rpc_release will free dreq->commit_data */
dreq
->
commit_data
=
NULL
;
dprintk
(
"NFS: %5u initiated commit call
\n
"
,
data
->
task
.
tk_pid
);
rpc_execute
(
&
data
->
task
);
task
=
rpc_run_task
(
&
task_setup_data
);
if
(
!
IS_ERR
(
task
))
rpc_put_task
(
task
);
}
static
void
nfs_direct_write_complete
(
struct
nfs_direct_req
*
dreq
,
struct
inode
*
inode
)
...
...
@@ -669,6 +678,7 @@ static ssize_t nfs_direct_write_schedule_segment(struct nfs_direct_req *dreq,
struct
inode
*
inode
=
ctx
->
path
.
dentry
->
d_inode
;
unsigned
long
user_addr
=
(
unsigned
long
)
iov
->
iov_base
;
size_t
count
=
iov
->
iov_len
;
struct
rpc_task
*
task
;
struct
rpc_message
msg
=
{
.
rpc_cred
=
ctx
->
cred
,
};
...
...
@@ -732,13 +742,15 @@ static ssize_t nfs_direct_write_schedule_segment(struct nfs_direct_req *dreq,
data
->
res
.
count
=
bytes
;
data
->
res
.
verf
=
&
data
->
verf
;
task_setup_data
.
task
=
&
data
->
task
;
task_setup_data
.
callback_data
=
data
;
msg
.
rpc_argp
=
&
data
->
args
;
msg
.
rpc_resp
=
&
data
->
res
;
NFS_PROTO
(
inode
)
->
write_setup
(
data
,
&
msg
);
rpc_init_task
(
&
data
->
task
,
&
task_setup_data
);
rpc_execute
(
&
data
->
task
);
task
=
rpc_run_task
(
&
task_setup_data
);
if
(
!
IS_ERR
(
task
))
rpc_put_task
(
task
);
dprintk
(
"NFS: %5u initiated direct write call "
"(req %s/%Ld, %zu bytes @ offset %Lu)
\n
"
,
...
...
fs/nfs/read.c
浏览文件 @
07737691
...
...
@@ -153,16 +153,6 @@ static void nfs_readpage_release(struct nfs_page *req)
nfs_release_request
(
req
);
}
static
void
nfs_execute_read
(
struct
nfs_read_data
*
data
)
{
struct
rpc_clnt
*
clnt
=
NFS_CLIENT
(
data
->
inode
);
sigset_t
oldset
;
rpc_clnt_sigmask
(
clnt
,
&
oldset
);
rpc_execute
(
&
data
->
task
);
rpc_clnt_sigunmask
(
clnt
,
&
oldset
);
}
/*
* Set up the NFS read request struct
*/
...
...
@@ -172,12 +162,14 @@ static void nfs_read_rpcsetup(struct nfs_page *req, struct nfs_read_data *data,
{
struct
inode
*
inode
=
req
->
wb_context
->
path
.
dentry
->
d_inode
;
int
swap_flags
=
IS_SWAPFILE
(
inode
)
?
NFS_RPC_SWAPFLAGS
:
0
;
struct
rpc_task
*
task
;
struct
rpc_message
msg
=
{
.
rpc_argp
=
&
data
->
args
,
.
rpc_resp
=
&
data
->
res
,
.
rpc_cred
=
req
->
wb_context
->
cred
,
};
struct
rpc_task_setup
task_setup_data
=
{
.
task
=
&
data
->
task
,
.
rpc_client
=
NFS_CLIENT
(
inode
),
.
rpc_message
=
&
msg
,
.
callback_ops
=
call_ops
,
...
...
@@ -203,7 +195,6 @@ static void nfs_read_rpcsetup(struct nfs_page *req, struct nfs_read_data *data,
/* Set up the initial task struct. */
NFS_PROTO
(
inode
)
->
read_setup
(
data
,
&
msg
);
rpc_init_task
(
&
data
->
task
,
&
task_setup_data
);
dprintk
(
"NFS: %5u initiated read call (req %s/%Ld, %u bytes @ offset %Lu)
\n
"
,
data
->
task
.
tk_pid
,
...
...
@@ -212,7 +203,9 @@ static void nfs_read_rpcsetup(struct nfs_page *req, struct nfs_read_data *data,
count
,
(
unsigned
long
long
)
data
->
args
.
offset
);
nfs_execute_read
(
data
);
task
=
rpc_run_task
(
&
task_setup_data
);
if
(
!
IS_ERR
(
task
))
rpc_put_task
(
task
);
}
static
void
...
...
fs/nfs/write.c
浏览文件 @
07737691
...
...
@@ -764,16 +764,6 @@ static int flush_task_priority(int how)
return
RPC_PRIORITY_NORMAL
;
}
static
void
nfs_execute_write
(
struct
nfs_write_data
*
data
)
{
struct
rpc_clnt
*
clnt
=
NFS_CLIENT
(
data
->
inode
);
sigset_t
oldset
;
rpc_clnt_sigmask
(
clnt
,
&
oldset
);
rpc_execute
(
&
data
->
task
);
rpc_clnt_sigunmask
(
clnt
,
&
oldset
);
}
/*
* Set up the argument/result storage required for the RPC call.
*/
...
...
@@ -786,6 +776,7 @@ static void nfs_write_rpcsetup(struct nfs_page *req,
struct
inode
*
inode
=
req
->
wb_context
->
path
.
dentry
->
d_inode
;
int
flags
=
(
how
&
FLUSH_SYNC
)
?
0
:
RPC_TASK_ASYNC
;
int
priority
=
flush_task_priority
(
how
);
struct
rpc_task
*
task
;
struct
rpc_message
msg
=
{
.
rpc_argp
=
&
data
->
args
,
.
rpc_resp
=
&
data
->
res
,
...
...
@@ -793,6 +784,7 @@ static void nfs_write_rpcsetup(struct nfs_page *req,
};
struct
rpc_task_setup
task_setup_data
=
{
.
rpc_client
=
NFS_CLIENT
(
inode
),
.
task
=
&
data
->
task
,
.
rpc_message
=
&
msg
,
.
callback_ops
=
call_ops
,
.
callback_data
=
data
,
...
...
@@ -827,7 +819,6 @@ static void nfs_write_rpcsetup(struct nfs_page *req,
/* Set up the initial task struct. */
NFS_PROTO
(
inode
)
->
write_setup
(
data
,
&
msg
);
rpc_init_task
(
&
data
->
task
,
&
task_setup_data
);
dprintk
(
"NFS: %5u initiated write call "
"(req %s/%Ld, %u bytes @ offset %Lu)
\n
"
,
...
...
@@ -837,7 +828,9 @@ static void nfs_write_rpcsetup(struct nfs_page *req,
count
,
(
unsigned
long
long
)
data
->
args
.
offset
);
nfs_execute_write
(
data
);
task
=
rpc_run_task
(
&
task_setup_data
);
if
(
!
IS_ERR
(
task
))
rpc_put_task
(
task
);
}
/*
...
...
@@ -1164,12 +1157,14 @@ static void nfs_commit_rpcsetup(struct list_head *head,
struct
inode
*
inode
=
first
->
wb_context
->
path
.
dentry
->
d_inode
;
int
flags
=
(
how
&
FLUSH_SYNC
)
?
0
:
RPC_TASK_ASYNC
;
int
priority
=
flush_task_priority
(
how
);
struct
rpc_task
*
task
;
struct
rpc_message
msg
=
{
.
rpc_argp
=
&
data
->
args
,
.
rpc_resp
=
&
data
->
res
,
.
rpc_cred
=
first
->
wb_context
->
cred
,
};
struct
rpc_task_setup
task_setup_data
=
{
.
task
=
&
data
->
task
,
.
rpc_client
=
NFS_CLIENT
(
inode
),
.
rpc_message
=
&
msg
,
.
callback_ops
=
&
nfs_commit_ops
,
...
...
@@ -1197,11 +1192,12 @@ static void nfs_commit_rpcsetup(struct list_head *head,
/* Set up the initial task struct. */
NFS_PROTO
(
inode
)
->
commit_setup
(
data
,
&
msg
);
rpc_init_task
(
&
data
->
task
,
&
task_setup_data
);
dprintk
(
"NFS: %5u initiated commit call
\n
"
,
data
->
task
.
tk_pid
);
nfs_execute_write
(
data
);
task
=
rpc_run_task
(
&
task_setup_data
);
if
(
!
IS_ERR
(
task
))
rpc_put_task
(
task
);
}
/*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录