Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
4a1c0893
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看板
提交
4a1c0893
编写于
3月 15, 2013
作者:
T
Trond Myklebust
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
NFSv4: Clean up nfs4_opendata_alloc in preparation for NFSv4.1 open modes
Signed-off-by:
N
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
上级
3b66486c
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
27 addition
and
11 deletion
+27
-11
fs/nfs/nfs4proc.c
fs/nfs/nfs4proc.c
+27
-11
未找到文件。
fs/nfs/nfs4proc.c
浏览文件 @
4a1c0893
...
...
@@ -782,6 +782,7 @@ static void nfs4_init_opendata_res(struct nfs4_opendata *p)
static
struct
nfs4_opendata
*
nfs4_opendata_alloc
(
struct
dentry
*
dentry
,
struct
nfs4_state_owner
*
sp
,
fmode_t
fmode
,
int
flags
,
const
struct
iattr
*
attrs
,
enum
open_claim_type4
claim
,
gfp_t
gfp_mask
)
{
struct
dentry
*
parent
=
dget_parent
(
dentry
);
...
...
@@ -800,7 +801,6 @@ static struct nfs4_opendata *nfs4_opendata_alloc(struct dentry *dentry,
p
->
dir
=
parent
;
p
->
owner
=
sp
;
atomic_inc
(
&
sp
->
so_count
);
p
->
o_arg
.
fh
=
NFS_FH
(
dir
);
p
->
o_arg
.
open_flags
=
flags
;
p
->
o_arg
.
fmode
=
fmode
&
(
FMODE_READ
|
FMODE_WRITE
);
/* don't put an ACCESS op in OPEN compound if O_EXCL, because ACCESS
...
...
@@ -818,7 +818,19 @@ static struct nfs4_opendata *nfs4_opendata_alloc(struct dentry *dentry,
p
->
o_arg
.
server
=
server
;
p
->
o_arg
.
bitmask
=
server
->
attr_bitmask
;
p
->
o_arg
.
open_bitmap
=
&
nfs4_fattr_bitmap
[
0
];
p
->
o_arg
.
claim
=
NFS4_OPEN_CLAIM_NULL
;
p
->
o_arg
.
claim
=
claim
;
switch
(
claim
)
{
case
NFS4_OPEN_CLAIM_NULL
:
case
NFS4_OPEN_CLAIM_DELEGATE_CUR
:
case
NFS4_OPEN_CLAIM_DELEGATE_PREV
:
p
->
o_arg
.
fh
=
NFS_FH
(
dir
);
break
;
case
NFS4_OPEN_CLAIM_PREVIOUS
:
case
NFS4_OPEN_CLAIM_FH
:
case
NFS4_OPEN_CLAIM_DELEG_CUR_FH
:
case
NFS4_OPEN_CLAIM_DELEG_PREV_FH
:
p
->
o_arg
.
fh
=
NFS_FH
(
dentry
->
d_inode
);
}
if
(
attrs
!=
NULL
&&
attrs
->
ia_valid
!=
0
)
{
__be32
verf
[
2
];
...
...
@@ -1200,11 +1212,13 @@ static struct nfs_open_context *nfs4_state_find_open_context(struct nfs4_state *
return
ERR_PTR
(
-
ENOENT
);
}
static
struct
nfs4_opendata
*
nfs4_open_recoverdata_alloc
(
struct
nfs_open_context
*
ctx
,
struct
nfs4_state
*
state
)
static
struct
nfs4_opendata
*
nfs4_open_recoverdata_alloc
(
struct
nfs_open_context
*
ctx
,
struct
nfs4_state
*
state
,
enum
open_claim_type4
claim
)
{
struct
nfs4_opendata
*
opendata
;
opendata
=
nfs4_opendata_alloc
(
ctx
->
dentry
,
state
->
owner
,
0
,
0
,
NULL
,
GFP_NOFS
);
opendata
=
nfs4_opendata_alloc
(
ctx
->
dentry
,
state
->
owner
,
0
,
0
,
NULL
,
claim
,
GFP_NOFS
);
if
(
opendata
==
NULL
)
return
ERR_PTR
(
-
ENOMEM
);
opendata
->
state
=
state
;
...
...
@@ -1290,11 +1304,10 @@ static int _nfs4_do_open_reclaim(struct nfs_open_context *ctx, struct nfs4_state
fmode_t
delegation_type
=
0
;
int
status
;
opendata
=
nfs4_open_recoverdata_alloc
(
ctx
,
state
);
opendata
=
nfs4_open_recoverdata_alloc
(
ctx
,
state
,
NFS4_OPEN_CLAIM_PREVIOUS
);
if
(
IS_ERR
(
opendata
))
return
PTR_ERR
(
opendata
);
opendata
->
o_arg
.
claim
=
NFS4_OPEN_CLAIM_PREVIOUS
;
opendata
->
o_arg
.
fh
=
NFS_FH
(
state
->
inode
);
rcu_read_lock
();
delegation
=
rcu_dereference
(
NFS_I
(
state
->
inode
)
->
delegation
);
if
(
delegation
!=
NULL
&&
test_bit
(
NFS_DELEGATION_NEED_RECLAIM
,
&
delegation
->
flags
)
!=
0
)
...
...
@@ -1338,10 +1351,10 @@ static int _nfs4_open_delegation_recall(struct nfs_open_context *ctx, struct nfs
struct
nfs4_opendata
*
opendata
;
int
ret
;
opendata
=
nfs4_open_recoverdata_alloc
(
ctx
,
state
);
opendata
=
nfs4_open_recoverdata_alloc
(
ctx
,
state
,
NFS4_OPEN_CLAIM_DELEGATE_CUR
);
if
(
IS_ERR
(
opendata
))
return
PTR_ERR
(
opendata
);
opendata
->
o_arg
.
claim
=
NFS4_OPEN_CLAIM_DELEGATE_CUR
;
nfs4_stateid_copy
(
&
opendata
->
o_arg
.
u
.
delegation
,
stateid
);
ret
=
nfs4_open_recover
(
opendata
,
state
);
nfs4_opendata_put
(
opendata
);
...
...
@@ -1727,7 +1740,8 @@ static int _nfs4_open_expired(struct nfs_open_context *ctx, struct nfs4_state *s
struct
nfs4_opendata
*
opendata
;
int
ret
;
opendata
=
nfs4_open_recoverdata_alloc
(
ctx
,
state
);
opendata
=
nfs4_open_recoverdata_alloc
(
ctx
,
state
,
NFS4_OPEN_CLAIM_NULL
);
if
(
IS_ERR
(
opendata
))
return
PTR_ERR
(
opendata
);
ret
=
nfs4_open_recover
(
opendata
,
state
);
...
...
@@ -1927,7 +1941,9 @@ static int _nfs4_do_open(struct inode *dir,
if
(
dentry
->
d_inode
!=
NULL
)
nfs4_return_incompatible_delegation
(
dentry
->
d_inode
,
fmode
);
status
=
-
ENOMEM
;
opendata
=
nfs4_opendata_alloc
(
dentry
,
sp
,
fmode
,
flags
,
sattr
,
GFP_KERNEL
);
opendata
=
nfs4_opendata_alloc
(
dentry
,
sp
,
fmode
,
flags
,
sattr
,
NFS4_OPEN_CLAIM_NULL
,
GFP_KERNEL
);
if
(
opendata
==
NULL
)
goto
err_put_state_owner
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录