Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
7d46a49f
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看板
提交
7d46a49f
编写于
3月 20, 2006
作者:
T
Trond Myklebust
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
NFS: Clean up nfs_flush_list()
Signed-off-by:
N
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
上级
deb7d638
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
29 addition
and
33 deletion
+29
-33
fs/nfs/write.c
fs/nfs/write.c
+29
-33
未找到文件。
fs/nfs/write.c
浏览文件 @
7d46a49f
...
...
@@ -963,7 +963,7 @@ static void nfs_execute_write(struct nfs_write_data *data)
* Generate multiple small requests to write out a single
* contiguous dirty area on one page.
*/
static
int
nfs_flush_multi
(
struct
list_head
*
head
,
struct
inode
*
inode
,
int
how
)
static
int
nfs_flush_multi
(
struct
inode
*
inode
,
struct
list_head
*
head
,
int
how
)
{
struct
nfs_page
*
req
=
nfs_list_entry
(
head
->
next
);
struct
page
*
page
=
req
->
wb_page
;
...
...
@@ -1032,16 +1032,13 @@ static int nfs_flush_multi(struct list_head *head, struct inode *inode, int how)
* This is the case if nfs_updatepage detects a conflicting request
* that has been written but not committed.
*/
static
int
nfs_flush_one
(
struct
list_head
*
head
,
struct
inode
*
inode
,
int
how
)
static
int
nfs_flush_one
(
struct
inode
*
inode
,
struct
list_head
*
head
,
int
how
)
{
struct
nfs_page
*
req
;
struct
page
**
pages
;
struct
nfs_write_data
*
data
;
unsigned
int
count
;
if
(
NFS_SERVER
(
inode
)
->
wsize
<
PAGE_CACHE_SIZE
)
return
nfs_flush_multi
(
head
,
inode
,
how
);
data
=
nfs_writedata_alloc
(
NFS_SERVER
(
inode
)
->
wpages
);
if
(
!
data
)
goto
out_bad
;
...
...
@@ -1074,24 +1071,32 @@ static int nfs_flush_one(struct list_head *head, struct inode *inode, int how)
return
-
ENOMEM
;
}
static
int
nfs_flush_list
(
struct
list_head
*
head
,
int
wpages
,
int
how
)
static
int
nfs_flush_list
(
struct
inode
*
inode
,
struct
list_head
*
head
,
int
npages
,
int
how
)
{
LIST_HEAD
(
one_request
);
struct
nfs_page
*
req
;
int
error
=
0
;
unsigned
int
pages
=
0
;
int
(
*
flush_one
)(
struct
inode
*
,
struct
list_head
*
,
int
);
struct
nfs_page
*
req
;
int
wpages
=
NFS_SERVER
(
inode
)
->
wpages
;
int
wsize
=
NFS_SERVER
(
inode
)
->
wsize
;
int
error
;
while
(
!
list_empty
(
head
))
{
pages
+=
nfs_coalesce_requests
(
head
,
&
one_request
,
wpages
);
flush_one
=
nfs_flush_one
;
if
(
wsize
<
PAGE_CACHE_SIZE
)
flush_one
=
nfs_flush_multi
;
/* For single writes, FLUSH_STABLE is more efficient */
if
(
npages
<=
wpages
&&
npages
==
NFS_I
(
inode
)
->
npages
&&
nfs_list_entry
(
head
->
next
)
->
wb_bytes
<=
wsize
)
how
|=
FLUSH_STABLE
;
do
{
nfs_coalesce_requests
(
head
,
&
one_request
,
wpages
);
req
=
nfs_list_entry
(
one_request
.
next
);
error
=
nfs_flush_one
(
&
one_request
,
req
->
wb_context
->
dentry
->
d_inode
,
how
);
error
=
flush_one
(
inode
,
&
one_request
,
how
);
if
(
error
<
0
)
break
;
}
if
(
error
>=
0
)
return
pages
;
goto
out_err
;
}
while
(
!
list_empty
(
head
));
return
0
;
out_err:
while
(
!
list_empty
(
head
))
{
req
=
nfs_list_entry
(
head
->
next
);
nfs_list_remove_request
(
req
);
...
...
@@ -1423,24 +1428,16 @@ static int nfs_flush_inode(struct inode *inode, unsigned long idx_start,
{
struct
nfs_inode
*
nfsi
=
NFS_I
(
inode
);
LIST_HEAD
(
head
);
int
res
,
error
=
0
;
int
res
;
spin_lock
(
&
nfsi
->
req_lock
);
res
=
nfs_scan_dirty
(
inode
,
&
head
,
idx_start
,
npages
);
spin_unlock
(
&
nfsi
->
req_lock
);
if
(
res
)
{
struct
nfs_server
*
server
=
NFS_SERVER
(
inode
);
/* For single writes, FLUSH_STABLE is more efficient */
if
(
res
==
nfsi
->
npages
&&
nfsi
->
npages
<=
server
->
wpages
)
{
if
(
res
>
1
||
nfs_list_entry
(
head
.
next
)
->
wb_bytes
<=
server
->
wsize
)
how
|=
FLUSH_STABLE
;
}
error
=
nfs_flush_list
(
&
head
,
server
->
wpages
,
how
);
int
error
=
nfs_flush_list
(
inode
,
&
head
,
res
,
how
);
if
(
error
<
0
)
return
error
;
}
if
(
error
<
0
)
return
error
;
return
res
;
}
...
...
@@ -1449,14 +1446,13 @@ int nfs_commit_inode(struct inode *inode, int how)
{
struct
nfs_inode
*
nfsi
=
NFS_I
(
inode
);
LIST_HEAD
(
head
);
int
res
,
error
=
0
;
int
res
;
spin_lock
(
&
nfsi
->
req_lock
);
res
=
nfs_scan_commit
(
inode
,
&
head
,
0
,
0
);
spin_unlock
(
&
nfsi
->
req_lock
);
if
(
res
)
{
error
=
nfs_commit_list
(
inode
,
&
head
,
how
);
int
error
=
nfs_commit_list
(
inode
,
&
head
,
how
);
if
(
error
<
0
)
return
error
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录