Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
e1fb4d05
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
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看板
提交
e1fb4d05
编写于
4月 16, 2010
作者:
T
Trond Myklebust
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
NFS: Reduce the stack footprint of nfs_lookup
Signed-off-by:
N
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
上级
364d015e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
41 addition
and
14 deletion
+41
-14
fs/nfs/dir.c
fs/nfs/dir.c
+35
-10
fs/nfs/nfs3proc.c
fs/nfs/nfs3proc.c
+6
-4
未找到文件。
fs/nfs/dir.c
浏览文件 @
e1fb4d05
...
...
@@ -776,9 +776,9 @@ static int nfs_lookup_revalidate(struct dentry * dentry, struct nameidata *nd)
struct
inode
*
dir
;
struct
inode
*
inode
;
struct
dentry
*
parent
;
struct
nfs_fh
*
fhandle
=
NULL
;
struct
nfs_fattr
*
fattr
=
NULL
;
int
error
;
struct
nfs_fh
fhandle
;
struct
nfs_fattr
fattr
;
parent
=
dget_parent
(
dentry
);
dir
=
parent
->
d_inode
;
...
...
@@ -811,14 +811,22 @@ static int nfs_lookup_revalidate(struct dentry * dentry, struct nameidata *nd)
if
(
NFS_STALE
(
inode
))
goto
out_bad
;
error
=
NFS_PROTO
(
dir
)
->
lookup
(
dir
,
&
dentry
->
d_name
,
&
fhandle
,
&
fattr
);
error
=
-
ENOMEM
;
fhandle
=
nfs_alloc_fhandle
();
fattr
=
nfs_alloc_fattr
();
if
(
fhandle
==
NULL
||
fattr
==
NULL
)
goto
out_error
;
error
=
NFS_PROTO
(
dir
)
->
lookup
(
dir
,
&
dentry
->
d_name
,
fhandle
,
fattr
);
if
(
error
)
goto
out_bad
;
if
(
nfs_compare_fh
(
NFS_FH
(
inode
),
&
fhandle
))
if
(
nfs_compare_fh
(
NFS_FH
(
inode
),
fhandle
))
goto
out_bad
;
if
((
error
=
nfs_refresh_inode
(
inode
,
&
fattr
))
!=
0
)
if
((
error
=
nfs_refresh_inode
(
inode
,
fattr
))
!=
0
)
goto
out_bad
;
nfs_free_fattr
(
fattr
);
nfs_free_fhandle
(
fhandle
);
out_set_verifier:
nfs_set_verifier
(
dentry
,
nfs_save_change_attribute
(
dir
));
out_valid:
...
...
@@ -842,11 +850,21 @@ static int nfs_lookup_revalidate(struct dentry * dentry, struct nameidata *nd)
shrink_dcache_parent
(
dentry
);
}
d_drop
(
dentry
);
nfs_free_fattr
(
fattr
);
nfs_free_fhandle
(
fhandle
);
dput
(
parent
);
dfprintk
(
LOOKUPCACHE
,
"NFS: %s(%s/%s) is invalid
\n
"
,
__func__
,
dentry
->
d_parent
->
d_name
.
name
,
dentry
->
d_name
.
name
);
return
0
;
out_error:
nfs_free_fattr
(
fattr
);
nfs_free_fhandle
(
fhandle
);
dput
(
parent
);
dfprintk
(
LOOKUPCACHE
,
"NFS: %s(%s/%s) lookup returned error %d
\n
"
,
__func__
,
dentry
->
d_parent
->
d_name
.
name
,
dentry
->
d_name
.
name
,
error
);
return
error
;
}
/*
...
...
@@ -911,9 +929,9 @@ static struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, stru
struct
dentry
*
res
;
struct
dentry
*
parent
;
struct
inode
*
inode
=
NULL
;
struct
nfs_fh
*
fhandle
=
NULL
;
struct
nfs_fattr
*
fattr
=
NULL
;
int
error
;
struct
nfs_fh
fhandle
;
struct
nfs_fattr
fattr
;
dfprintk
(
VFS
,
"NFS: lookup(%s/%s)
\n
"
,
dentry
->
d_parent
->
d_name
.
name
,
dentry
->
d_name
.
name
);
...
...
@@ -923,7 +941,6 @@ static struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, stru
if
(
dentry
->
d_name
.
len
>
NFS_SERVER
(
dir
)
->
namelen
)
goto
out
;
res
=
ERR_PTR
(
-
ENOMEM
);
dentry
->
d_op
=
NFS_PROTO
(
dir
)
->
dentry_ops
;
/*
...
...
@@ -936,17 +953,23 @@ static struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, stru
goto
out
;
}
res
=
ERR_PTR
(
-
ENOMEM
);
fhandle
=
nfs_alloc_fhandle
();
fattr
=
nfs_alloc_fattr
();
if
(
fhandle
==
NULL
||
fattr
==
NULL
)
goto
out
;
parent
=
dentry
->
d_parent
;
/* Protect against concurrent sillydeletes */
nfs_block_sillyrename
(
parent
);
error
=
NFS_PROTO
(
dir
)
->
lookup
(
dir
,
&
dentry
->
d_name
,
&
fhandle
,
&
fattr
);
error
=
NFS_PROTO
(
dir
)
->
lookup
(
dir
,
&
dentry
->
d_name
,
fhandle
,
fattr
);
if
(
error
==
-
ENOENT
)
goto
no_entry
;
if
(
error
<
0
)
{
res
=
ERR_PTR
(
error
);
goto
out_unblock_sillyrename
;
}
inode
=
nfs_fhget
(
dentry
->
d_sb
,
&
fhandle
,
&
fattr
);
inode
=
nfs_fhget
(
dentry
->
d_sb
,
fhandle
,
fattr
);
res
=
(
struct
dentry
*
)
inode
;
if
(
IS_ERR
(
res
))
goto
out_unblock_sillyrename
;
...
...
@@ -962,6 +985,8 @@ static struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, stru
out_unblock_sillyrename:
nfs_unblock_sillyrename
(
parent
);
out:
nfs_free_fattr
(
fattr
);
nfs_free_fhandle
(
fhandle
);
return
res
;
}
...
...
fs/nfs/nfs3proc.c
浏览文件 @
e1fb4d05
...
...
@@ -144,14 +144,12 @@ static int
nfs3_proc_lookup
(
struct
inode
*
dir
,
struct
qstr
*
name
,
struct
nfs_fh
*
fhandle
,
struct
nfs_fattr
*
fattr
)
{
struct
nfs_fattr
dir_attr
;
struct
nfs3_diropargs
arg
=
{
.
fh
=
NFS_FH
(
dir
),
.
name
=
name
->
name
,
.
len
=
name
->
len
};
struct
nfs3_diropres
res
=
{
.
dir_attr
=
&
dir_attr
,
.
fh
=
fhandle
,
.
fattr
=
fattr
};
...
...
@@ -163,16 +161,20 @@ nfs3_proc_lookup(struct inode *dir, struct qstr *name,
int
status
;
dprintk
(
"NFS call lookup %s
\n
"
,
name
->
name
);
nfs_fattr_init
(
&
dir_attr
);
res
.
dir_attr
=
nfs_alloc_fattr
();
if
(
res
.
dir_attr
==
NULL
)
return
-
ENOMEM
;
nfs_fattr_init
(
fattr
);
status
=
rpc_call_sync
(
NFS_CLIENT
(
dir
),
&
msg
,
0
);
nfs_refresh_inode
(
dir
,
&
dir_attr
);
nfs_refresh_inode
(
dir
,
res
.
dir_attr
);
if
(
status
>=
0
&&
!
(
fattr
->
valid
&
NFS_ATTR_FATTR
))
{
msg
.
rpc_proc
=
&
nfs3_procedures
[
NFS3PROC_GETATTR
];
msg
.
rpc_argp
=
fhandle
;
msg
.
rpc_resp
=
fattr
;
status
=
rpc_call_sync
(
NFS_CLIENT
(
dir
),
&
msg
,
0
);
}
nfs_free_fattr
(
res
.
dir_attr
);
dprintk
(
"NFS reply lookup: %d
\n
"
,
status
);
return
status
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录