Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
bc6c53d5
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
bc6c53d5
编写于
9月 02, 2009
作者:
J
J. Bruce Fields
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
nfsd: move fsid_type choice out of fh_compose
More trivial cleanup. Signed-off-by:
N
J. Bruce Fields
<
bfields@citi.umich.edu
>
上级
8e498751
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
41 addition
and
36 deletion
+41
-36
fs/nfsd/nfsfh.c
fs/nfsd/nfsfh.c
+41
-36
未找到文件。
fs/nfsd/nfsfh.c
浏览文件 @
bc6c53d5
...
...
@@ -431,43 +431,17 @@ static bool fsid_type_ok_for_exp(u8 fsid_type, struct svc_export *exp)
return
1
;
}
__be32
fh_compose
(
struct
svc_fh
*
fhp
,
struct
svc_export
*
exp
,
struct
dentry
*
dentry
,
struct
svc_fh
*
ref_fh
)
{
/* ref_fh is a reference file handle.
* if it is non-null and for the same filesystem, then we should compose
* a filehandle which is of the same version, where possible.
* Currently, that means that if ref_fh->fh_handle.fh_version == 0xca
* Then create a 32byte filehandle using nfs_fhbase_old
*
*/
static
void
set_version_and_fsid_type
(
struct
svc_fh
*
fhp
,
struct
svc_export
*
exp
,
struct
svc_fh
*
ref_fh
)
{
u8
version
;
u8
fsid_type
=
0
;
struct
inode
*
inode
=
dentry
->
d_inode
;
struct
dentry
*
parent
=
dentry
->
d_parent
;
__u32
*
datap
;
dev_t
ex_dev
=
exp_sb
(
exp
)
->
s_dev
;
dprintk
(
"nfsd: fh_compose(exp %02x:%02x/%ld %s/%s, ino=%ld)
\n
"
,
MAJOR
(
ex_dev
),
MINOR
(
ex_dev
),
(
long
)
exp
->
ex_path
.
dentry
->
d_inode
->
i_ino
,
parent
->
d_name
.
name
,
dentry
->
d_name
.
name
,
(
inode
?
inode
->
i_ino
:
0
));
/* Choose filehandle version and fsid type based on
* the reference filehandle (if it is in the same export)
* or the export options.
*/
retry:
u8
fsid_type
;
retry:
version
=
1
;
if
(
ref_fh
&&
ref_fh
->
fh_export
==
exp
)
{
version
=
ref_fh
->
fh_handle
.
fh_version
;
fsid_type
=
ref_fh
->
fh_handle
.
fh_fsid_type
;
if
(
ref_fh
==
fhp
)
fh_put
(
ref_fh
);
ref_fh
=
NULL
;
switch
(
version
)
{
...
...
@@ -502,11 +476,44 @@ fh_compose(struct svc_fh *fhp, struct svc_export *exp, struct dentry *dentry,
else
fsid_type
=
FSID_UUID4_INUM
;
}
}
else
if
(
!
old_valid_dev
(
ex_dev
))
}
else
if
(
!
old_valid_dev
(
ex
p_sb
(
exp
)
->
s
_dev
))
/* for newer device numbers, we must use a newer fsid format */
fsid_type
=
FSID_ENCODE_DEV
;
else
fsid_type
=
FSID_DEV
;
fhp
->
fh_handle
.
fh_version
=
version
;
if
(
version
)
fhp
->
fh_handle
.
fh_fsid_type
=
fsid_type
;
}
__be32
fh_compose
(
struct
svc_fh
*
fhp
,
struct
svc_export
*
exp
,
struct
dentry
*
dentry
,
struct
svc_fh
*
ref_fh
)
{
/* ref_fh is a reference file handle.
* if it is non-null and for the same filesystem, then we should compose
* a filehandle which is of the same version, where possible.
* Currently, that means that if ref_fh->fh_handle.fh_version == 0xca
* Then create a 32byte filehandle using nfs_fhbase_old
*
*/
struct
inode
*
inode
=
dentry
->
d_inode
;
struct
dentry
*
parent
=
dentry
->
d_parent
;
__u32
*
datap
;
dev_t
ex_dev
=
exp_sb
(
exp
)
->
s_dev
;
dprintk
(
"nfsd: fh_compose(exp %02x:%02x/%ld %s/%s, ino=%ld)
\n
"
,
MAJOR
(
ex_dev
),
MINOR
(
ex_dev
),
(
long
)
exp
->
ex_path
.
dentry
->
d_inode
->
i_ino
,
parent
->
d_name
.
name
,
dentry
->
d_name
.
name
,
(
inode
?
inode
->
i_ino
:
0
));
/* Choose filehandle version and fsid type based on
* the reference filehandle (if it is in the same export)
* or the export options.
*/
set_version_and_fsid_type
(
fhp
,
exp
,
ref_fh
);
if
(
ref_fh
==
fhp
)
fh_put
(
ref_fh
);
...
...
@@ -524,7 +531,7 @@ fh_compose(struct svc_fh *fhp, struct svc_export *exp, struct dentry *dentry,
fhp
->
fh_export
=
exp
;
cache_get
(
&
exp
->
h
);
if
(
version
==
0xca
)
{
if
(
fhp
->
fh_handle
.
fh_
version
==
0xca
)
{
/* old style filehandle please */
memset
(
&
fhp
->
fh_handle
.
fh_base
,
0
,
NFS_FHSIZE
);
fhp
->
fh_handle
.
fh_size
=
NFS_FHSIZE
;
...
...
@@ -538,15 +545,13 @@ fh_compose(struct svc_fh *fhp, struct svc_export *exp, struct dentry *dentry,
_fh_update_old
(
dentry
,
exp
,
&
fhp
->
fh_handle
);
}
else
{
int
len
;
fhp
->
fh_handle
.
fh_version
=
1
;
fhp
->
fh_handle
.
fh_auth_type
=
0
;
datap
=
fhp
->
fh_handle
.
fh_auth
+
0
;
fhp
->
fh_handle
.
fh_fsid_type
=
fsid_type
;
mk_fsid
(
fsid_type
,
datap
,
ex_dev
,
mk_fsid
(
fhp
->
fh_handle
.
fh_fsid_type
,
datap
,
ex_dev
,
exp
->
ex_path
.
dentry
->
d_inode
->
i_ino
,
exp
->
ex_fsid
,
exp
->
ex_uuid
);
len
=
key_len
(
fsid_type
);
len
=
key_len
(
f
hp
->
fh_handle
.
fh_f
sid_type
);
datap
+=
len
/
4
;
fhp
->
fh_handle
.
fh_size
=
4
+
len
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录