Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
ace9fad4
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看板
提交
ace9fad4
编写于
9月 02, 2018
作者:
T
Trond Myklebust
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
NFSv4: Convert struct nfs4_state to use refcount_t
Signed-off-by:
N
Trond Myklebust
<
trond.myklebust@hammerspace.com
>
上级
9ae075fd
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
9 addition
and
9 deletion
+9
-9
fs/nfs/nfs4_fs.h
fs/nfs/nfs4_fs.h
+1
-1
fs/nfs/nfs4proc.c
fs/nfs/nfs4proc.c
+4
-4
fs/nfs/nfs4state.c
fs/nfs/nfs4state.c
+4
-4
未找到文件。
fs/nfs/nfs4_fs.h
浏览文件 @
ace9fad4
...
@@ -188,7 +188,7 @@ struct nfs4_state {
...
@@ -188,7 +188,7 @@ struct nfs4_state {
unsigned
int
n_wronly
;
/* Number of write-only references */
unsigned
int
n_wronly
;
/* Number of write-only references */
unsigned
int
n_rdwr
;
/* Number of read/write references */
unsigned
int
n_rdwr
;
/* Number of read/write references */
fmode_t
state
;
/* State on the server (R,W, or RW) */
fmode_t
state
;
/* State on the server (R,W, or RW) */
atomic
_t
count
;
refcount
_t
count
;
wait_queue_head_t
waitq
;
wait_queue_head_t
waitq
;
struct
rcu_head
rcu_head
;
struct
rcu_head
rcu_head
;
...
...
fs/nfs/nfs4proc.c
浏览文件 @
ace9fad4
...
@@ -1777,7 +1777,7 @@ static struct nfs4_state *nfs4_try_open_cached(struct nfs4_opendata *opendata)
...
@@ -1777,7 +1777,7 @@ static struct nfs4_state *nfs4_try_open_cached(struct nfs4_opendata *opendata)
out:
out:
return
ERR_PTR
(
ret
);
return
ERR_PTR
(
ret
);
out_return_state:
out_return_state:
atomic
_inc
(
&
state
->
count
);
refcount
_inc
(
&
state
->
count
);
return
state
;
return
state
;
}
}
...
@@ -1849,7 +1849,7 @@ _nfs4_opendata_reclaim_to_nfs4_state(struct nfs4_opendata *data)
...
@@ -1849,7 +1849,7 @@ _nfs4_opendata_reclaim_to_nfs4_state(struct nfs4_opendata *data)
update:
update:
update_open_stateid
(
state
,
&
data
->
o_res
.
stateid
,
NULL
,
update_open_stateid
(
state
,
&
data
->
o_res
.
stateid
,
NULL
,
data
->
o_arg
.
fmode
);
data
->
o_arg
.
fmode
);
atomic
_inc
(
&
state
->
count
);
refcount
_inc
(
&
state
->
count
);
return
state
;
return
state
;
}
}
...
@@ -1887,7 +1887,7 @@ nfs4_opendata_find_nfs4_state(struct nfs4_opendata *data)
...
@@ -1887,7 +1887,7 @@ nfs4_opendata_find_nfs4_state(struct nfs4_opendata *data)
return
ERR_CAST
(
inode
);
return
ERR_CAST
(
inode
);
if
(
data
->
state
!=
NULL
&&
data
->
state
->
inode
==
inode
)
{
if
(
data
->
state
!=
NULL
&&
data
->
state
->
inode
==
inode
)
{
state
=
data
->
state
;
state
=
data
->
state
;
atomic
_inc
(
&
state
->
count
);
refcount
_inc
(
&
state
->
count
);
}
else
}
else
state
=
nfs4_get_open_state
(
inode
,
data
->
owner
);
state
=
nfs4_get_open_state
(
inode
,
data
->
owner
);
iput
(
inode
);
iput
(
inode
);
...
@@ -1978,7 +1978,7 @@ static struct nfs4_opendata *nfs4_open_recoverdata_alloc(struct nfs_open_context
...
@@ -1978,7 +1978,7 @@ static struct nfs4_opendata *nfs4_open_recoverdata_alloc(struct nfs_open_context
if
(
opendata
==
NULL
)
if
(
opendata
==
NULL
)
return
ERR_PTR
(
-
ENOMEM
);
return
ERR_PTR
(
-
ENOMEM
);
opendata
->
state
=
state
;
opendata
->
state
=
state
;
atomic
_inc
(
&
state
->
count
);
refcount
_inc
(
&
state
->
count
);
return
opendata
;
return
opendata
;
}
}
...
...
fs/nfs/nfs4state.c
浏览文件 @
ace9fad4
...
@@ -655,7 +655,7 @@ nfs4_alloc_open_state(void)
...
@@ -655,7 +655,7 @@ nfs4_alloc_open_state(void)
state
=
kzalloc
(
sizeof
(
*
state
),
GFP_NOFS
);
state
=
kzalloc
(
sizeof
(
*
state
),
GFP_NOFS
);
if
(
!
state
)
if
(
!
state
)
return
NULL
;
return
NULL
;
atomic
_set
(
&
state
->
count
,
1
);
refcount
_set
(
&
state
->
count
,
1
);
INIT_LIST_HEAD
(
&
state
->
lock_states
);
INIT_LIST_HEAD
(
&
state
->
lock_states
);
spin_lock_init
(
&
state
->
state_lock
);
spin_lock_init
(
&
state
->
state_lock
);
seqlock_init
(
&
state
->
seqlock
);
seqlock_init
(
&
state
->
seqlock
);
...
@@ -689,7 +689,7 @@ __nfs4_find_state_byowner(struct inode *inode, struct nfs4_state_owner *owner)
...
@@ -689,7 +689,7 @@ __nfs4_find_state_byowner(struct inode *inode, struct nfs4_state_owner *owner)
continue
;
continue
;
if
(
!
nfs4_valid_open_stateid
(
state
))
if
(
!
nfs4_valid_open_stateid
(
state
))
continue
;
continue
;
if
(
atomic
_inc_not_zero
(
&
state
->
count
))
if
(
refcount
_inc_not_zero
(
&
state
->
count
))
return
state
;
return
state
;
}
}
return
NULL
;
return
NULL
;
...
@@ -743,7 +743,7 @@ void nfs4_put_open_state(struct nfs4_state *state)
...
@@ -743,7 +743,7 @@ void nfs4_put_open_state(struct nfs4_state *state)
struct
inode
*
inode
=
state
->
inode
;
struct
inode
*
inode
=
state
->
inode
;
struct
nfs4_state_owner
*
owner
=
state
->
owner
;
struct
nfs4_state_owner
*
owner
=
state
->
owner
;
if
(
!
atomic
_dec_and_lock
(
&
state
->
count
,
&
owner
->
so_lock
))
if
(
!
refcount
_dec_and_lock
(
&
state
->
count
,
&
owner
->
so_lock
))
return
;
return
;
spin_lock
(
&
inode
->
i_lock
);
spin_lock
(
&
inode
->
i_lock
);
list_del_rcu
(
&
state
->
inode_states
);
list_del_rcu
(
&
state
->
inode_states
);
...
@@ -1573,7 +1573,7 @@ static int nfs4_reclaim_open_state(struct nfs4_state_owner *sp, const struct nfs
...
@@ -1573,7 +1573,7 @@ static int nfs4_reclaim_open_state(struct nfs4_state_owner *sp, const struct nfs
continue
;
continue
;
if
(
state
->
state
==
0
)
if
(
state
->
state
==
0
)
continue
;
continue
;
atomic
_inc
(
&
state
->
count
);
refcount
_inc
(
&
state
->
count
);
spin_unlock
(
&
sp
->
so_lock
);
spin_unlock
(
&
sp
->
so_lock
);
status
=
ops
->
recover_open
(
sp
,
state
);
status
=
ops
->
recover_open
(
sp
,
state
);
if
(
status
>=
0
)
{
if
(
status
>=
0
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录