Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
91c9fa8f
K
Kernel
项目概览
openeuler
/
Kernel
大约 1 年 前同步成功
通知
5
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
91c9fa8f
编写于
4月 18, 2009
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
switch rqst_exp_get_by_name()
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
5bf3bd2b
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
23 addition
and
27 deletion
+23
-27
fs/nfsd/export.c
fs/nfsd/export.c
+6
-9
fs/nfsd/vfs.c
fs/nfsd/vfs.c
+16
-16
include/linux/nfsd/export.h
include/linux/nfsd/export.h
+1
-2
未找到文件。
fs/nfsd/export.c
浏览文件 @
91c9fa8f
...
...
@@ -1240,18 +1240,15 @@ __be32 check_nfsd_access(struct svc_export *exp, struct svc_rqst *rqstp)
* use exp_get_by_name() or exp_find().
*/
struct
svc_export
*
rqst_exp_get_by_name
(
struct
svc_rqst
*
rqstp
,
struct
vfsmount
*
mnt
,
struct
dentry
*
dentry
)
rqst_exp_get_by_name
(
struct
svc_rqst
*
rqstp
,
struct
path
*
path
)
{
struct
svc_export
*
gssexp
,
*
exp
=
ERR_PTR
(
-
ENOENT
);
struct
path
path
=
{.
mnt
=
mnt
,
.
dentry
=
dentry
};
if
(
rqstp
->
rq_client
==
NULL
)
goto
gss
;
/* First try the auth_unix client: */
exp
=
exp_get_by_name
(
rqstp
->
rq_client
,
&
path
,
&
rqstp
->
rq_chandle
);
exp
=
exp_get_by_name
(
rqstp
->
rq_client
,
path
,
&
rqstp
->
rq_chandle
);
if
(
PTR_ERR
(
exp
)
==
-
ENOENT
)
goto
gss
;
if
(
IS_ERR
(
exp
))
...
...
@@ -1263,8 +1260,7 @@ rqst_exp_get_by_name(struct svc_rqst *rqstp, struct vfsmount *mnt,
/* Otherwise, try falling back on gss client */
if
(
rqstp
->
rq_gssclient
==
NULL
)
return
exp
;
gssexp
=
exp_get_by_name
(
rqstp
->
rq_gssclient
,
&
path
,
&
rqstp
->
rq_chandle
);
gssexp
=
exp_get_by_name
(
rqstp
->
rq_gssclient
,
path
,
&
rqstp
->
rq_chandle
);
if
(
PTR_ERR
(
gssexp
)
==
-
ENOENT
)
return
exp
;
if
(
!
IS_ERR
(
exp
))
...
...
@@ -1307,9 +1303,10 @@ rqst_exp_parent(struct svc_rqst *rqstp, struct vfsmount *mnt,
struct
dentry
*
dentry
)
{
struct
svc_export
*
exp
;
struct
path
path
=
{.
mnt
=
mnt
,
.
dentry
=
dentry
};
dget
(
dentry
);
exp
=
rqst_exp_get_by_name
(
rqstp
,
mnt
,
dentry
);
exp
=
rqst_exp_get_by_name
(
rqstp
,
&
path
);
while
(
PTR_ERR
(
exp
)
==
-
ENOENT
&&
!
IS_ROOT
(
dentry
))
{
struct
dentry
*
parent
;
...
...
@@ -1317,7 +1314,7 @@ rqst_exp_parent(struct svc_rqst *rqstp, struct vfsmount *mnt,
parent
=
dget_parent
(
dentry
);
dput
(
dentry
);
dentry
=
parent
;
exp
=
rqst_exp_get_by_name
(
rqstp
,
mnt
,
dentry
);
exp
=
rqst_exp_get_by_name
(
rqstp
,
&
path
);
}
dput
(
dentry
);
return
exp
;
...
...
fs/nfsd/vfs.c
浏览文件 @
91c9fa8f
...
...
@@ -101,36 +101,36 @@ nfsd_cross_mnt(struct svc_rqst *rqstp, struct dentry **dpp,
{
struct
svc_export
*
exp
=
*
expp
,
*
exp2
=
NULL
;
struct
dentry
*
dentry
=
*
dpp
;
struct
vfsmount
*
mnt
=
mntget
(
exp
->
ex_path
.
mnt
);
struct
dentry
*
mounts
=
dget
(
dentry
)
;
struct
path
path
=
{.
mnt
=
mntget
(
exp
->
ex_path
.
mnt
),
.
dentry
=
dget
(
dentry
)}
;
int
err
=
0
;
while
(
follow_down
(
&
mnt
,
&
mounts
)
&&
d_mountpoint
(
mounts
));
while
(
follow_down
(
&
path
.
mnt
,
&
path
.
dentry
)
&&
d_mountpoint
(
path
.
dentry
))
;
exp2
=
rqst_exp_get_by_name
(
rqstp
,
mnt
,
mounts
);
exp2
=
rqst_exp_get_by_name
(
rqstp
,
&
path
);
if
(
IS_ERR
(
exp2
))
{
if
(
PTR_ERR
(
exp2
)
!=
-
ENOENT
)
err
=
PTR_ERR
(
exp2
);
dput
(
mounts
);
mntput
(
mnt
);
path_put
(
&
path
);
goto
out
;
}
if
((
exp
->
ex_flags
&
NFSEXP_CROSSMOUNT
)
||
EX_NOHIDE
(
exp2
))
{
/* successfully crossed mount point */
/*
* This is subtle: dentry is *not* under mnt at this point.
* The only reason we are safe is that original mnt is pinned
* down by exp, so we should dput before putting exp.
* This is subtle: path.dentry is *not* on path.mnt
* at this point. The only reason we are safe is that
* original mnt is pinned down by exp, so we should
* put path *before* putting exp
*/
dput
(
dentry
);
*
dpp
=
mounts
;
exp_put
(
exp
);
*
dpp
=
path
.
dentry
;
path
.
dentry
=
dentry
;
*
expp
=
exp2
;
}
else
{
exp_put
(
exp2
);
dput
(
mounts
);
exp2
=
exp
;
}
mntput
(
mnt
);
path_put
(
&
path
);
exp_put
(
exp2
);
out:
return
err
;
}
...
...
include/linux/nfsd/export.h
浏览文件 @
91c9fa8f
...
...
@@ -125,8 +125,7 @@ void nfsd_export_flush(void);
void
exp_readlock
(
void
);
void
exp_readunlock
(
void
);
struct
svc_export
*
rqst_exp_get_by_name
(
struct
svc_rqst
*
,
struct
vfsmount
*
,
struct
dentry
*
);
struct
path
*
);
struct
svc_export
*
rqst_exp_parent
(
struct
svc_rqst
*
,
struct
vfsmount
*
mnt
,
struct
dentry
*
dentry
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录