Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
5cb953d4
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看板
提交
5cb953d4
编写于
8月 01, 2017
作者:
T
Trond Myklebust
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
NFS: Use an atomic_long_t to count the number of commits
Signed-off-by:
N
Trond Myklebust
<
trond.myklebust@primarydata.com
>
上级
a6b6d5b8
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
9 addition
and
7 deletion
+9
-7
fs/nfs/inode.c
fs/nfs/inode.c
+1
-1
fs/nfs/write.c
fs/nfs/write.c
+7
-5
include/linux/nfs_xdr.h
include/linux/nfs_xdr.h
+1
-1
未找到文件。
fs/nfs/inode.c
浏览文件 @
5cb953d4
...
...
@@ -2012,7 +2012,7 @@ static void init_once(void *foo)
INIT_LIST_HEAD
(
&
nfsi
->
access_cache_inode_lru
);
INIT_LIST_HEAD
(
&
nfsi
->
commit_info
.
list
);
atomic_long_set
(
&
nfsi
->
nrequests
,
0
);
nfsi
->
commit_info
.
ncommit
=
0
;
atomic_long_set
(
&
nfsi
->
commit_info
.
ncommit
,
0
)
;
atomic_set
(
&
nfsi
->
commit_info
.
rpcs_out
,
0
);
init_rwsem
(
&
nfsi
->
rmdir_sem
);
mutex_init
(
&
nfsi
->
commit_mutex
);
...
...
fs/nfs/write.c
浏览文件 @
5cb953d4
...
...
@@ -857,7 +857,7 @@ nfs_request_add_commit_list_locked(struct nfs_page *req, struct list_head *dst,
{
set_bit
(
PG_CLEAN
,
&
req
->
wb_flags
);
nfs_list_add_request
(
req
,
dst
);
cinfo
->
mds
->
ncommit
++
;
atomic_long_inc
(
&
cinfo
->
mds
->
ncommit
)
;
}
EXPORT_SYMBOL_GPL
(
nfs_request_add_commit_list_locked
);
...
...
@@ -903,7 +903,7 @@ nfs_request_remove_commit_list(struct nfs_page *req,
if
(
!
test_and_clear_bit
(
PG_CLEAN
,
&
(
req
)
->
wb_flags
))
return
;
nfs_list_remove_request
(
req
);
cinfo
->
mds
->
ncommit
--
;
atomic_long_dec
(
&
cinfo
->
mds
->
ncommit
)
;
}
EXPORT_SYMBOL_GPL
(
nfs_request_remove_commit_list
);
...
...
@@ -1017,7 +1017,7 @@ static void nfs_write_completion(struct nfs_pgio_header *hdr)
unsigned
long
nfs_reqs_to_commit
(
struct
nfs_commit_info
*
cinfo
)
{
return
cinfo
->
mds
->
ncommit
;
return
atomic_long_read
(
&
cinfo
->
mds
->
ncommit
)
;
}
/* NFS_I(cinfo->inode)->commit_mutex held by caller */
...
...
@@ -1057,8 +1057,10 @@ nfs_scan_commit(struct inode *inode, struct list_head *dst,
{
int
ret
=
0
;
if
(
!
atomic_long_read
(
&
cinfo
->
mds
->
ncommit
))
return
0
;
mutex_lock
(
&
NFS_I
(
cinfo
->
inode
)
->
commit_mutex
);
if
(
cinfo
->
mds
->
ncommit
>
0
)
{
if
(
atomic_long_read
(
&
cinfo
->
mds
->
ncommit
)
>
0
)
{
const
int
max
=
INT_MAX
;
ret
=
nfs_scan_commit_list
(
&
cinfo
->
mds
->
list
,
dst
,
...
...
@@ -1890,7 +1892,7 @@ int nfs_write_inode(struct inode *inode, struct writeback_control *wbc)
int
ret
=
0
;
/* no commits means nothing needs to be done */
if
(
!
nfsi
->
commit_info
.
ncommit
)
if
(
!
atomic_long_read
(
&
nfsi
->
commit_info
.
ncommit
)
)
return
ret
;
if
(
wbc
->
sync_mode
==
WB_SYNC_NONE
)
{
...
...
include/linux/nfs_xdr.h
浏览文件 @
5cb953d4
...
...
@@ -1476,7 +1476,7 @@ struct nfs_pgio_header {
struct
nfs_mds_commit_info
{
atomic_t
rpcs_out
;
unsigned
long
ncommit
;
atomic_long_t
ncommit
;
struct
list_head
list
;
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录