Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xiphi1978
linux
提交
15c831bf
L
linux
项目概览
xiphi1978
/
linux
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
15c831bf
编写于
12月 23, 2008
作者:
T
Trond Myklebust
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
NFS: Use atomic bitops when changing struct nfs_delegation->flags
Signed-off-by:
N
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
上级
86e89489
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
9 addition
and
9 deletion
+9
-9
fs/nfs/delegation.c
fs/nfs/delegation.c
+3
-3
fs/nfs/delegation.h
fs/nfs/delegation.h
+2
-2
fs/nfs/nfs4proc.c
fs/nfs/nfs4proc.c
+4
-4
未找到文件。
fs/nfs/delegation.c
浏览文件 @
15c831bf
...
...
@@ -119,7 +119,7 @@ void nfs_inode_reclaim_delegation(struct inode *inode, struct rpc_cred *cred, st
delegation
->
maxsize
=
res
->
maxsize
;
oldcred
=
delegation
->
cred
;
delegation
->
cred
=
get_rpccred
(
cred
);
delegation
->
flags
&=
~
NFS_DELEGATION_NEED_RECLAIM
;
clear_bit
(
NFS_DELEGATION_NEED_RECLAIM
,
&
delegation
->
flags
)
;
NFS_I
(
inode
)
->
delegation_state
=
delegation
->
type
;
smp_wmb
();
put_rpccred
(
oldcred
);
...
...
@@ -499,7 +499,7 @@ void nfs_delegation_mark_reclaim(struct nfs_client *clp)
struct
nfs_delegation
*
delegation
;
rcu_read_lock
();
list_for_each_entry_rcu
(
delegation
,
&
clp
->
cl_delegations
,
super_list
)
delegation
->
flags
|=
NFS_DELEGATION_NEED_RECLAIM
;
set_bit
(
NFS_DELEGATION_NEED_RECLAIM
,
&
delegation
->
flags
)
;
rcu_read_unlock
();
}
...
...
@@ -513,7 +513,7 @@ void nfs_delegation_reap_unclaimed(struct nfs_client *clp)
restart:
rcu_read_lock
();
list_for_each_entry_rcu
(
delegation
,
&
clp
->
cl_delegations
,
super_list
)
{
if
(
(
delegation
->
flags
&
NFS_DELEGATION_NEED_RECLAIM
)
==
0
)
if
(
test_bit
(
NFS_DELEGATION_NEED_RECLAIM
,
&
delegation
->
flags
)
==
0
)
continue
;
inode
=
nfs_delegation_grab_inode
(
delegation
);
if
(
inode
==
NULL
)
...
...
fs/nfs/delegation.h
浏览文件 @
15c831bf
...
...
@@ -18,10 +18,10 @@ struct nfs_delegation {
struct
inode
*
inode
;
nfs4_stateid
stateid
;
int
type
;
#define NFS_DELEGATION_NEED_RECLAIM 1
long
flags
;
loff_t
maxsize
;
__u64
change_attr
;
#define NFS_DELEGATION_NEED_RECLAIM 0
unsigned
long
flags
;
spinlock_t
lock
;
struct
rcu_head
rcu
;
};
...
...
fs/nfs/nfs4proc.c
浏览文件 @
15c831bf
...
...
@@ -344,7 +344,7 @@ static int can_open_delegated(struct nfs_delegation *delegation, mode_t open_fla
{
if
((
delegation
->
type
&
open_flags
)
!=
open_flags
)
return
0
;
if
(
delegation
->
flags
&
NFS_DELEGATION_NEED_RECLAIM
)
if
(
test_bit
(
NFS_DELEGATION_NEED_RECLAIM
,
&
delegation
->
flags
)
)
return
0
;
return
1
;
}
...
...
@@ -536,7 +536,7 @@ static struct nfs4_state *nfs4_opendata_to_nfs4_state(struct nfs4_opendata *data
if
(
delegation
)
delegation_flags
=
delegation
->
flags
;
rcu_read_unlock
();
if
(
!
(
delegation_flags
&
NFS_DELEGATION_NEED_RECLAIM
)
)
if
(
(
delegation_flags
&
1UL
<<
NFS_DELEGATION_NEED_RECLAIM
)
==
0
)
nfs_inode_set_delegation
(
state
->
inode
,
data
->
owner
->
so_cred
,
&
data
->
o_res
);
...
...
@@ -667,7 +667,7 @@ static int _nfs4_do_open_reclaim(struct nfs_open_context *ctx, struct nfs4_state
opendata
->
o_arg
.
fh
=
NFS_FH
(
state
->
inode
);
rcu_read_lock
();
delegation
=
rcu_dereference
(
NFS_I
(
state
->
inode
)
->
delegation
);
if
(
delegation
!=
NULL
&&
(
delegation
->
flags
&
NFS_DELEGATION_NEED_RECLAIM
)
!=
0
)
if
(
delegation
!=
NULL
&&
test_bit
(
NFS_DELEGATION_NEED_RECLAIM
,
&
delegation
->
flags
)
!=
0
)
delegation_type
=
delegation
->
type
;
rcu_read_unlock
();
opendata
->
o_arg
.
u
.
delegation_type
=
delegation_type
;
...
...
@@ -839,7 +839,7 @@ static void nfs4_open_prepare(struct rpc_task *task, void *calldata)
rcu_read_lock
();
delegation
=
rcu_dereference
(
NFS_I
(
data
->
state
->
inode
)
->
delegation
);
if
(
delegation
!=
NULL
&&
(
delegation
->
flags
&
NFS_DELEGATION_NEED_RECLAIM
)
==
0
)
{
test_bit
(
NFS_DELEGATION_NEED_RECLAIM
,
&
delegation
->
flags
)
==
0
)
{
rcu_read_unlock
();
goto
out_no_action
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录