Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
aa49b4cf
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 3 年多
通知
13
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
aa49b4cf
编写于
4月 16, 2010
作者:
T
Trond Myklebust
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
NFS: Reduce stack footprint of nfs_readdir()
Signed-off-by:
N
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
上级
011fff72
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
18 addition
and
12 deletion
+18
-12
fs/nfs/dir.c
fs/nfs/dir.c
+10
-7
fs/nfs/nfs3proc.c
fs/nfs/nfs3proc.c
+8
-5
未找到文件。
fs/nfs/dir.c
浏览文件 @
aa49b4cf
...
@@ -530,9 +530,7 @@ static int nfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
...
@@ -530,9 +530,7 @@ static int nfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
nfs_readdir_descriptor_t
my_desc
,
nfs_readdir_descriptor_t
my_desc
,
*
desc
=
&
my_desc
;
*
desc
=
&
my_desc
;
struct
nfs_entry
my_entry
;
struct
nfs_entry
my_entry
;
struct
nfs_fh
fh
;
int
res
=
-
ENOMEM
;
struct
nfs_fattr
fattr
;
long
res
;
dfprintk
(
FILE
,
"NFS: readdir(%s/%s) starting at cookie %llu
\n
"
,
dfprintk
(
FILE
,
"NFS: readdir(%s/%s) starting at cookie %llu
\n
"
,
dentry
->
d_parent
->
d_name
.
name
,
dentry
->
d_name
.
name
,
dentry
->
d_parent
->
d_name
.
name
,
dentry
->
d_name
.
name
,
...
@@ -554,9 +552,11 @@ static int nfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
...
@@ -554,9 +552,11 @@ static int nfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
my_entry
.
cookie
=
my_entry
.
prev_cookie
=
0
;
my_entry
.
cookie
=
my_entry
.
prev_cookie
=
0
;
my_entry
.
eof
=
0
;
my_entry
.
eof
=
0
;
my_entry
.
fh
=
&
fh
;
my_entry
.
fh
=
nfs_alloc_fhandle
();
my_entry
.
fattr
=
&
fattr
;
my_entry
.
fattr
=
nfs_alloc_fattr
();
nfs_fattr_init
(
&
fattr
);
if
(
my_entry
.
fh
==
NULL
||
my_entry
.
fattr
==
NULL
)
goto
out_alloc_failed
;
desc
->
entry
=
&
my_entry
;
desc
->
entry
=
&
my_entry
;
nfs_block_sillyrename
(
dentry
);
nfs_block_sillyrename
(
dentry
);
...
@@ -598,7 +598,10 @@ static int nfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
...
@@ -598,7 +598,10 @@ static int nfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
nfs_unblock_sillyrename
(
dentry
);
nfs_unblock_sillyrename
(
dentry
);
if
(
res
>
0
)
if
(
res
>
0
)
res
=
0
;
res
=
0
;
dfprintk
(
FILE
,
"NFS: readdir(%s/%s) returns %ld
\n
"
,
out_alloc_failed:
nfs_free_fattr
(
my_entry
.
fattr
);
nfs_free_fhandle
(
my_entry
.
fh
);
dfprintk
(
FILE
,
"NFS: readdir(%s/%s) returns %d
\n
"
,
dentry
->
d_parent
->
d_name
.
name
,
dentry
->
d_name
.
name
,
dentry
->
d_parent
->
d_name
.
name
,
dentry
->
d_name
.
name
,
res
);
res
);
return
res
;
return
res
;
...
...
fs/nfs/nfs3proc.c
浏览文件 @
aa49b4cf
...
@@ -597,7 +597,6 @@ nfs3_proc_readdir(struct dentry *dentry, struct rpc_cred *cred,
...
@@ -597,7 +597,6 @@ nfs3_proc_readdir(struct dentry *dentry, struct rpc_cred *cred,
u64
cookie
,
struct
page
*
page
,
unsigned
int
count
,
int
plus
)
u64
cookie
,
struct
page
*
page
,
unsigned
int
count
,
int
plus
)
{
{
struct
inode
*
dir
=
dentry
->
d_inode
;
struct
inode
*
dir
=
dentry
->
d_inode
;
struct
nfs_fattr
dir_attr
;
__be32
*
verf
=
NFS_COOKIEVERF
(
dir
);
__be32
*
verf
=
NFS_COOKIEVERF
(
dir
);
struct
nfs3_readdirargs
arg
=
{
struct
nfs3_readdirargs
arg
=
{
.
fh
=
NFS_FH
(
dir
),
.
fh
=
NFS_FH
(
dir
),
...
@@ -608,7 +607,6 @@ nfs3_proc_readdir(struct dentry *dentry, struct rpc_cred *cred,
...
@@ -608,7 +607,6 @@ nfs3_proc_readdir(struct dentry *dentry, struct rpc_cred *cred,
.
pages
=
&
page
.
pages
=
&
page
};
};
struct
nfs3_readdirres
res
=
{
struct
nfs3_readdirres
res
=
{
.
dir_attr
=
&
dir_attr
,
.
verf
=
verf
,
.
verf
=
verf
,
.
plus
=
plus
.
plus
=
plus
};
};
...
@@ -618,7 +616,7 @@ nfs3_proc_readdir(struct dentry *dentry, struct rpc_cred *cred,
...
@@ -618,7 +616,7 @@ nfs3_proc_readdir(struct dentry *dentry, struct rpc_cred *cred,
.
rpc_resp
=
&
res
,
.
rpc_resp
=
&
res
,
.
rpc_cred
=
cred
.
rpc_cred
=
cred
};
};
int
status
;
int
status
=
-
ENOMEM
;
if
(
plus
)
if
(
plus
)
msg
.
rpc_proc
=
&
nfs3_procedures
[
NFS3PROC_READDIRPLUS
];
msg
.
rpc_proc
=
&
nfs3_procedures
[
NFS3PROC_READDIRPLUS
];
...
@@ -626,12 +624,17 @@ nfs3_proc_readdir(struct dentry *dentry, struct rpc_cred *cred,
...
@@ -626,12 +624,17 @@ nfs3_proc_readdir(struct dentry *dentry, struct rpc_cred *cred,
dprintk
(
"NFS call readdir%s %d
\n
"
,
dprintk
(
"NFS call readdir%s %d
\n
"
,
plus
?
"plus"
:
""
,
(
unsigned
int
)
cookie
);
plus
?
"plus"
:
""
,
(
unsigned
int
)
cookie
);
nfs_fattr_init
(
&
dir_attr
);
res
.
dir_attr
=
nfs_alloc_fattr
();
if
(
res
.
dir_attr
==
NULL
)
goto
out
;
status
=
rpc_call_sync
(
NFS_CLIENT
(
dir
),
&
msg
,
0
);
status
=
rpc_call_sync
(
NFS_CLIENT
(
dir
),
&
msg
,
0
);
nfs_invalidate_atime
(
dir
);
nfs_invalidate_atime
(
dir
);
nfs_refresh_inode
(
dir
,
res
.
dir_attr
);
nfs_refresh_inode
(
dir
,
&
dir_attr
);
nfs_free_fattr
(
res
.
dir_attr
);
out:
dprintk
(
"NFS reply readdir: %d
\n
"
,
status
);
dprintk
(
"NFS reply readdir: %d
\n
"
,
status
);
return
status
;
return
status
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录