Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
c84bea59
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看板
提交
c84bea59
编写于
3月 22, 2020
作者:
T
Trond Myklebust
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
NFS/pNFS: Simplify bucket layout segment reference counting
Signed-off-by:
N
Trond Myklebust
<
trond.myklebust@hammerspace.com
>
上级
9c455a8c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
21 addition
and
21 deletion
+21
-21
fs/nfs/pnfs_nfs.c
fs/nfs/pnfs_nfs.c
+20
-19
include/linux/nfs_xdr.h
include/linux/nfs_xdr.h
+1
-2
未找到文件。
fs/nfs/pnfs_nfs.c
浏览文件 @
c84bea59
...
...
@@ -59,6 +59,17 @@ void pnfs_generic_commit_release(void *calldata)
}
EXPORT_SYMBOL_GPL
(
pnfs_generic_commit_release
);
static
struct
pnfs_layout_segment
*
pnfs_free_bucket_lseg
(
struct
pnfs_commit_bucket
*
bucket
)
{
if
(
list_empty
(
&
bucket
->
committing
)
&&
list_empty
(
&
bucket
->
written
))
{
struct
pnfs_layout_segment
*
freeme
=
bucket
->
lseg
;
bucket
->
lseg
=
NULL
;
return
freeme
;
}
return
NULL
;
}
/* The generic layer is about to remove the req from the commit list.
* If this will make the bucket empty, it will need to put the lseg reference.
* Note this must be called holding nfsi->commit_mutex
...
...
@@ -78,8 +89,7 @@ pnfs_generic_clear_request_commit(struct nfs_page *req,
bucket
=
list_first_entry
(
&
req
->
wb_list
,
struct
pnfs_commit_bucket
,
written
);
freeme
=
bucket
->
wlseg
;
bucket
->
wlseg
=
NULL
;
freeme
=
pnfs_free_bucket_lseg
(
bucket
);
}
out:
nfs_request_remove_commit_list
(
req
,
cinfo
);
...
...
@@ -103,8 +113,7 @@ pnfs_alloc_commit_array(size_t n, gfp_t gfp_flags)
for
(
b
=
&
p
->
buckets
[
0
];
n
!=
0
;
b
++
,
n
--
)
{
INIT_LIST_HEAD
(
&
b
->
written
);
INIT_LIST_HEAD
(
&
b
->
committing
);
b
->
wlseg
=
NULL
;
b
->
clseg
=
NULL
;
b
->
lseg
=
NULL
;
b
->
direct_verf
.
committed
=
NFS_INVALID_STABLE_HOW
;
}
return
p
;
...
...
@@ -246,12 +255,6 @@ pnfs_bucket_scan_ds_commit_list(struct pnfs_commit_bucket *bucket,
if
(
ret
)
{
cinfo
->
ds
->
nwritten
-=
ret
;
cinfo
->
ds
->
ncommitting
+=
ret
;
if
(
bucket
->
clseg
==
NULL
)
bucket
->
clseg
=
pnfs_get_lseg
(
bucket
->
wlseg
);
if
(
list_empty
(
src
))
{
pnfs_put_lseg
(
bucket
->
wlseg
);
bucket
->
wlseg
=
NULL
;
}
}
return
ret
;
}
...
...
@@ -317,9 +320,8 @@ pnfs_bucket_recover_commit_reqs(struct list_head *dst,
if
(
!
nwritten
)
continue
;
ret
+=
nwritten
;
if
(
list_empty
(
&
b
->
written
))
{
freeme
=
b
->
wlseg
;
b
->
wlseg
=
NULL
;
freeme
=
pnfs_free_bucket_lseg
(
b
);
if
(
freeme
)
{
pnfs_put_lseg
(
freeme
);
goto
restart
;
}
...
...
@@ -405,15 +407,12 @@ pnfs_bucket_get_committing(struct list_head *head,
struct
pnfs_commit_bucket
*
bucket
,
struct
nfs_commit_info
*
cinfo
)
{
struct
pnfs_layout_segment
*
freeme
;
struct
list_head
*
pos
;
list_for_each
(
pos
,
&
bucket
->
committing
)
cinfo
->
ds
->
ncommitting
--
;
list_splice_init
(
&
bucket
->
committing
,
head
);
freeme
=
bucket
->
clseg
;
bucket
->
clseg
=
NULL
;
return
freeme
;
return
pnfs_free_bucket_lseg
(
bucket
);
}
static
struct
nfs_commit_data
*
...
...
@@ -425,6 +424,8 @@ pnfs_bucket_fetch_commitdata(struct pnfs_commit_bucket *bucket,
if
(
!
data
)
return
NULL
;
data
->
lseg
=
pnfs_bucket_get_committing
(
&
data
->
pages
,
bucket
,
cinfo
);
if
(
!
data
->
lseg
)
data
->
lseg
=
pnfs_get_lseg
(
bucket
->
lseg
);
return
data
;
}
...
...
@@ -1182,8 +1183,8 @@ pnfs_layout_mark_request_commit(struct nfs_page *req,
* off due to a rewrite, in which case it will be done in
* pnfs_common_clear_request_commit
*/
WARN_ON_ONCE
(
buckets
[
ds_commit_idx
].
wlseg
!=
NULL
);
buckets
[
ds_commit_idx
].
w
lseg
=
pnfs_get_lseg
(
lseg
);
if
(
!
buckets
[
ds_commit_idx
].
lseg
)
buckets
[
ds_commit_idx
].
lseg
=
pnfs_get_lseg
(
lseg
);
}
set_bit
(
PG_COMMIT_TO_DS
,
&
req
->
wb_flags
);
cinfo
->
ds
->
nwritten
++
;
...
...
include/linux/nfs_xdr.h
浏览文件 @
c84bea59
...
...
@@ -1265,8 +1265,7 @@ struct nfstime4 {
struct
pnfs_commit_bucket
{
struct
list_head
written
;
struct
list_head
committing
;
struct
pnfs_layout_segment
*
wlseg
;
struct
pnfs_layout_segment
*
clseg
;
struct
pnfs_layout_segment
*
lseg
;
struct
nfs_writeverf
direct_verf
;
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录