Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
7eff03ae
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看板
提交
7eff03ae
编写于
12月 23, 2008
作者:
T
Trond Myklebust
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
NFSv4: Add a recovery marking scheme for state owners
Signed-off-by:
N
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
上级
0f605b56
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
26 addition
and
4 deletion
+26
-4
fs/nfs/nfs4_fs.h
fs/nfs/nfs4_fs.h
+7
-0
fs/nfs/nfs4proc.c
fs/nfs/nfs4proc.c
+2
-0
fs/nfs/nfs4state.c
fs/nfs/nfs4state.c
+17
-4
未找到文件。
fs/nfs/nfs4_fs.h
浏览文件 @
7eff03ae
...
...
@@ -94,12 +94,18 @@ struct nfs4_state_owner {
spinlock_t
so_lock
;
atomic_t
so_count
;
unsigned
long
so_flags
;
struct
list_head
so_states
;
struct
list_head
so_delegations
;
struct
nfs_seqid_counter
so_seqid
;
struct
rpc_sequence
so_sequence
;
};
enum
{
NFS_OWNER_RECLAIM_REBOOT
,
NFS_OWNER_RECLAIM_NOGRACE
};
/*
* struct nfs4_state maintains the client-side state for a given
* (state_owner,inode) tuple (OPEN) or state_owner (LOCK).
...
...
@@ -166,6 +172,7 @@ struct nfs4_exception {
};
struct
nfs4_state_recovery_ops
{
int
owner_flag_bit
;
int
state_flag_bit
;
int
(
*
recover_open
)(
struct
nfs4_state_owner
*
,
struct
nfs4_state
*
);
int
(
*
recover_lock
)(
struct
nfs4_state
*
,
struct
file_lock
*
);
...
...
fs/nfs/nfs4proc.c
浏览文件 @
7eff03ae
...
...
@@ -3690,12 +3690,14 @@ int nfs4_proc_fs_locations(struct inode *dir, const struct qstr *name,
}
struct
nfs4_state_recovery_ops
nfs4_reboot_recovery_ops
=
{
.
owner_flag_bit
=
NFS_OWNER_RECLAIM_REBOOT
,
.
state_flag_bit
=
NFS_STATE_RECLAIM_REBOOT
,
.
recover_open
=
nfs4_open_reclaim
,
.
recover_lock
=
nfs4_lock_reclaim
,
};
struct
nfs4_state_recovery_ops
nfs4_nograce_recovery_ops
=
{
.
owner_flag_bit
=
NFS_OWNER_RECLAIM_NOGRACE
,
.
state_flag_bit
=
NFS_STATE_RECLAIM_NOGRACE
,
.
recover_open
=
nfs4_open_expired
,
.
recover_lock
=
nfs4_lock_expired
,
...
...
fs/nfs/nfs4state.c
浏览文件 @
7eff03ae
...
...
@@ -832,6 +832,7 @@ static int nfs4_state_mark_reclaim_reboot(struct nfs_client *clp, struct nfs4_st
clear_bit
(
NFS_STATE_RECLAIM_REBOOT
,
&
state
->
flags
);
return
0
;
}
set_bit
(
NFS_OWNER_RECLAIM_REBOOT
,
&
state
->
owner
->
so_flags
);
set_bit
(
NFS4CLNT_RECLAIM_REBOOT
,
&
clp
->
cl_state
);
return
1
;
}
...
...
@@ -840,6 +841,7 @@ static int nfs4_state_mark_reclaim_nograce(struct nfs_client *clp, struct nfs4_s
{
set_bit
(
NFS_STATE_RECLAIM_NOGRACE
,
&
state
->
flags
);
clear_bit
(
NFS_STATE_RECLAIM_REBOOT
,
&
state
->
flags
);
set_bit
(
NFS_OWNER_RECLAIM_NOGRACE
,
&
state
->
owner
->
so_flags
);
set_bit
(
NFS4CLNT_RECLAIM_NOGRACE
,
&
clp
->
cl_state
);
return
1
;
}
...
...
@@ -1043,14 +1045,25 @@ static int nfs4_do_reclaim(struct nfs_client *clp, const struct nfs4_state_recov
struct
rb_node
*
pos
;
int
status
=
0
;
/* Note: list is protected by exclusive lock on cl->cl_sem */
restart:
spin_lock
(
&
clp
->
cl_lock
);
for
(
pos
=
rb_first
(
&
clp
->
cl_state_owners
);
pos
!=
NULL
;
pos
=
rb_next
(
pos
))
{
struct
nfs4_state_owner
*
sp
=
rb_entry
(
pos
,
struct
nfs4_state_owner
,
so_client_node
);
if
(
!
test_and_clear_bit
(
ops
->
owner_flag_bit
,
&
sp
->
so_flags
))
continue
;
atomic_inc
(
&
sp
->
so_count
);
spin_unlock
(
&
clp
->
cl_lock
);
status
=
nfs4_reclaim_open_state
(
sp
,
ops
);
if
(
status
<
0
)
break
;
if
(
status
<
0
)
{
set_bit
(
ops
->
owner_flag_bit
,
&
sp
->
so_flags
);
nfs4_put_state_owner
(
sp
);
nfs4_recovery_handle_error
(
clp
,
status
);
return
status
;
}
nfs4_put_state_owner
(
sp
);
goto
restart
;
}
nfs4_recovery_handle_error
(
clp
,
status
);
spin_unlock
(
&
clp
->
cl_lock
);
return
status
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录