Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
539cd03a
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看板
提交
539cd03a
编写于
6月 05, 2007
作者:
T
Trond Myklebust
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
NFSv4: Cleanup: pass the nfs_open_context to open recovery code
Signed-off-by:
N
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
上级
88be9f99
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
21 addition
and
21 deletion
+21
-21
fs/nfs/delegation.c
fs/nfs/delegation.c
+1
-1
fs/nfs/delegation.h
fs/nfs/delegation.h
+1
-1
fs/nfs/nfs4proc.c
fs/nfs/nfs4proc.c
+19
-19
未找到文件。
fs/nfs/delegation.c
浏览文件 @
539cd03a
...
...
@@ -74,7 +74,7 @@ static void nfs_delegation_claim_opens(struct inode *inode)
continue
;
get_nfs_open_context
(
ctx
);
spin_unlock
(
&
inode
->
i_lock
);
err
=
nfs4_open_delegation_recall
(
ctx
->
path
.
dentry
,
state
);
err
=
nfs4_open_delegation_recall
(
ctx
,
state
);
if
(
err
>=
0
)
err
=
nfs_delegation_claim_locks
(
ctx
,
state
);
put_nfs_open_context
(
ctx
);
...
...
fs/nfs/delegation.h
浏览文件 @
539cd03a
...
...
@@ -39,7 +39,7 @@ void nfs_delegation_reap_unclaimed(struct nfs_client *clp);
/* NFSv4 delegation-related procedures */
int
nfs4_proc_delegreturn
(
struct
inode
*
inode
,
struct
rpc_cred
*
cred
,
const
nfs4_stateid
*
stateid
);
int
nfs4_open_delegation_recall
(
struct
dentry
*
dentry
,
struct
nfs4_state
*
state
);
int
nfs4_open_delegation_recall
(
struct
nfs_open_context
*
ctx
,
struct
nfs4_state
*
state
);
int
nfs4_lock_delegation_recall
(
struct
nfs4_state
*
state
,
struct
file_lock
*
fl
);
int
nfs4_copy_delegation_stateid
(
nfs4_stateid
*
dst
,
struct
inode
*
inode
);
...
...
fs/nfs/nfs4proc.c
浏览文件 @
539cd03a
...
...
@@ -462,7 +462,7 @@ static int nfs4_open_recover(struct nfs4_opendata *opendata, struct nfs4_state *
* OPEN_RECLAIM:
* reclaim state on the server after a reboot.
*/
static
int
_nfs4_do_open_reclaim
(
struct
nfs
4_state_owner
*
sp
,
struct
nfs4_state
*
state
,
struct
dentry
*
dentry
)
static
int
_nfs4_do_open_reclaim
(
struct
nfs
_open_context
*
ctx
,
struct
nfs4_state
*
state
)
{
struct
nfs_delegation
*
delegation
=
NFS_I
(
state
->
inode
)
->
delegation
;
struct
nfs4_opendata
*
opendata
;
...
...
@@ -478,7 +478,7 @@ static int _nfs4_do_open_reclaim(struct nfs4_state_owner *sp, struct nfs4_state
}
delegation_type
=
delegation
->
type
;
}
opendata
=
nfs4_opendata_alloc
(
dentry
,
sp
,
0
,
NULL
);
opendata
=
nfs4_opendata_alloc
(
ctx
->
path
.
dentry
,
state
->
owner
,
0
,
NULL
);
if
(
opendata
==
NULL
)
return
-
ENOMEM
;
opendata
->
o_arg
.
claim
=
NFS4_OPEN_CLAIM_PREVIOUS
;
...
...
@@ -490,13 +490,13 @@ static int _nfs4_do_open_reclaim(struct nfs4_state_owner *sp, struct nfs4_state
return
status
;
}
static
int
nfs4_do_open_reclaim
(
struct
nfs
4_state_owner
*
sp
,
struct
nfs4_state
*
state
,
struct
dentry
*
dentry
)
static
int
nfs4_do_open_reclaim
(
struct
nfs
_open_context
*
ctx
,
struct
nfs4_state
*
state
)
{
struct
nfs_server
*
server
=
NFS_SERVER
(
state
->
inode
);
struct
nfs4_exception
exception
=
{
};
int
err
;
do
{
err
=
_nfs4_do_open_reclaim
(
sp
,
state
,
dentry
);
err
=
_nfs4_do_open_reclaim
(
ctx
,
state
);
if
(
err
!=
-
NFS4ERR_DELAY
)
break
;
nfs4_handle_exception
(
server
,
err
,
&
exception
);
...
...
@@ -512,12 +512,12 @@ static int nfs4_open_reclaim(struct nfs4_state_owner *sp, struct nfs4_state *sta
ctx
=
nfs4_state_find_open_context
(
state
);
if
(
IS_ERR
(
ctx
))
return
PTR_ERR
(
ctx
);
ret
=
nfs4_do_open_reclaim
(
sp
,
state
,
ctx
->
path
.
dentry
);
ret
=
nfs4_do_open_reclaim
(
ctx
,
state
);
put_nfs_open_context
(
ctx
);
return
ret
;
}
static
int
_nfs4_open_delegation_recall
(
struct
dentry
*
dentry
,
struct
nfs4_state
*
state
)
static
int
_nfs4_open_delegation_recall
(
struct
nfs_open_context
*
ctx
,
struct
nfs4_state
*
state
)
{
struct
nfs4_state_owner
*
sp
=
state
->
owner
;
struct
nfs4_opendata
*
opendata
;
...
...
@@ -525,7 +525,7 @@ static int _nfs4_open_delegation_recall(struct dentry *dentry, struct nfs4_state
if
(
!
test_bit
(
NFS_DELEGATED_STATE
,
&
state
->
flags
))
return
0
;
opendata
=
nfs4_opendata_alloc
(
dentry
,
sp
,
0
,
NULL
);
opendata
=
nfs4_opendata_alloc
(
ctx
->
path
.
dentry
,
sp
,
0
,
NULL
);
if
(
opendata
==
NULL
)
return
-
ENOMEM
;
opendata
->
o_arg
.
claim
=
NFS4_OPEN_CLAIM_DELEGATE_CUR
;
...
...
@@ -536,13 +536,13 @@ static int _nfs4_open_delegation_recall(struct dentry *dentry, struct nfs4_state
return
ret
;
}
int
nfs4_open_delegation_recall
(
struct
dentry
*
dentry
,
struct
nfs4_state
*
state
)
int
nfs4_open_delegation_recall
(
struct
nfs_open_context
*
ctx
,
struct
nfs4_state
*
state
)
{
struct
nfs4_exception
exception
=
{
};
struct
nfs_server
*
server
=
NFS_SERVER
(
dentry
->
d_
inode
);
struct
nfs_server
*
server
=
NFS_SERVER
(
state
->
inode
);
int
err
;
do
{
err
=
_nfs4_open_delegation_recall
(
dentry
,
state
);
err
=
_nfs4_open_delegation_recall
(
ctx
,
state
);
switch
(
err
)
{
case
0
:
return
err
;
...
...
@@ -811,7 +811,7 @@ static int nfs4_recover_expired_lease(struct nfs_server *server)
* reclaim state on the server after a network partition.
* Assumes caller holds the appropriate lock
*/
static
int
_nfs4_open_expired
(
struct
nfs
4_state_owner
*
sp
,
struct
nfs4_state
*
state
,
struct
dentry
*
dentry
)
static
int
_nfs4_open_expired
(
struct
nfs
_open_context
*
ctx
,
struct
nfs4_state
*
state
)
{
struct
inode
*
inode
=
state
->
inode
;
struct
nfs_delegation
*
delegation
=
NFS_I
(
inode
)
->
delegation
;
...
...
@@ -820,34 +820,34 @@ static int _nfs4_open_expired(struct nfs4_state_owner *sp, struct nfs4_state *st
int
ret
;
if
(
delegation
!=
NULL
&&
!
(
delegation
->
flags
&
NFS_DELEGATION_NEED_RECLAIM
))
{
ret
=
_nfs4_do_access
(
inode
,
sp
->
so_
cred
,
openflags
);
ret
=
_nfs4_do_access
(
inode
,
ctx
->
cred
,
openflags
);
if
(
ret
<
0
)
return
ret
;
memcpy
(
&
state
->
stateid
,
&
delegation
->
stateid
,
sizeof
(
state
->
stateid
));
set_bit
(
NFS_DELEGATED_STATE
,
&
state
->
flags
);
return
0
;
}
opendata
=
nfs4_opendata_alloc
(
dentry
,
sp
,
openflags
,
NULL
);
opendata
=
nfs4_opendata_alloc
(
ctx
->
path
.
dentry
,
state
->
owner
,
openflags
,
NULL
);
if
(
opendata
==
NULL
)
return
-
ENOMEM
;
ret
=
nfs4_open_recover
(
opendata
,
state
);
if
(
ret
==
-
ESTALE
)
{
/* Invalidate the state owner so we don't ever use it again */
nfs4_drop_state_owner
(
s
p
);
d_drop
(
dentry
);
nfs4_drop_state_owner
(
s
tate
->
owner
);
d_drop
(
ctx
->
path
.
dentry
);
}
nfs4_opendata_free
(
opendata
);
return
ret
;
}
static
inline
int
nfs4_do_open_expired
(
struct
nfs
4_state_owner
*
sp
,
struct
nfs4_state
*
state
,
struct
dentry
*
dentry
)
static
inline
int
nfs4_do_open_expired
(
struct
nfs
_open_context
*
ctx
,
struct
nfs4_state
*
state
)
{
struct
nfs_server
*
server
=
NFS_SERVER
(
dentry
->
d_
inode
);
struct
nfs_server
*
server
=
NFS_SERVER
(
state
->
inode
);
struct
nfs4_exception
exception
=
{
};
int
err
;
do
{
err
=
_nfs4_open_expired
(
sp
,
state
,
dentry
);
err
=
_nfs4_open_expired
(
ctx
,
state
);
if
(
err
==
-
NFS4ERR_DELAY
)
nfs4_handle_exception
(
server
,
err
,
&
exception
);
}
while
(
exception
.
retry
);
...
...
@@ -862,7 +862,7 @@ static int nfs4_open_expired(struct nfs4_state_owner *sp, struct nfs4_state *sta
ctx
=
nfs4_state_find_open_context
(
state
);
if
(
IS_ERR
(
ctx
))
return
PTR_ERR
(
ctx
);
ret
=
nfs4_do_open_expired
(
sp
,
state
,
ctx
->
path
.
dentry
);
ret
=
nfs4_do_open_expired
(
ctx
,
state
);
put_nfs_open_context
(
ctx
);
return
ret
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录