Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
cfb506e1
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
158
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cfb506e1
编写于
7月 30, 2010
作者:
T
Trond Myklebust
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
NFS: Ensure that writepage respects the nonblock flag
Signed-off-by:
N
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
上级
b608b283
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
17 addition
and
6 deletion
+17
-6
fs/nfs/write.c
fs/nfs/write.c
+17
-6
未找到文件。
fs/nfs/write.c
浏览文件 @
cfb506e1
...
...
@@ -222,7 +222,7 @@ static void nfs_end_page_writeback(struct page *page)
clear_bdi_congested
(
&
nfss
->
backing_dev_info
,
BLK_RW_ASYNC
);
}
static
struct
nfs_page
*
nfs_find_and_lock_request
(
struct
page
*
page
)
static
struct
nfs_page
*
nfs_find_and_lock_request
(
struct
page
*
page
,
bool
nonblock
)
{
struct
inode
*
inode
=
page
->
mapping
->
host
;
struct
nfs_page
*
req
;
...
...
@@ -241,7 +241,10 @@ static struct nfs_page *nfs_find_and_lock_request(struct page *page)
* request as dirty (in which case we don't care).
*/
spin_unlock
(
&
inode
->
i_lock
);
ret
=
nfs_wait_on_request
(
req
);
if
(
!
nonblock
)
ret
=
nfs_wait_on_request
(
req
);
else
ret
=
-
EAGAIN
;
nfs_release_request
(
req
);
if
(
ret
!=
0
)
return
ERR_PTR
(
ret
);
...
...
@@ -256,12 +259,12 @@ static struct nfs_page *nfs_find_and_lock_request(struct page *page)
* May return an error if the user signalled nfs_wait_on_request().
*/
static
int
nfs_page_async_flush
(
struct
nfs_pageio_descriptor
*
pgio
,
struct
page
*
page
)
struct
page
*
page
,
bool
nonblock
)
{
struct
nfs_page
*
req
;
int
ret
=
0
;
req
=
nfs_find_and_lock_request
(
page
);
req
=
nfs_find_and_lock_request
(
page
,
nonblock
);
if
(
!
req
)
goto
out
;
ret
=
PTR_ERR
(
req
);
...
...
@@ -283,12 +286,20 @@ static int nfs_page_async_flush(struct nfs_pageio_descriptor *pgio,
static
int
nfs_do_writepage
(
struct
page
*
page
,
struct
writeback_control
*
wbc
,
struct
nfs_pageio_descriptor
*
pgio
)
{
struct
inode
*
inode
=
page
->
mapping
->
host
;
int
ret
;
nfs_inc_stats
(
inode
,
NFSIOS_VFSWRITEPAGE
);
nfs_add_stats
(
inode
,
NFSIOS_WRITEPAGES
,
1
);
nfs_pageio_cond_complete
(
pgio
,
page
->
index
);
return
nfs_page_async_flush
(
pgio
,
page
);
ret
=
nfs_page_async_flush
(
pgio
,
page
,
wbc
->
sync_mode
==
WB_SYNC_NONE
||
wbc
->
nonblocking
!=
0
);
if
(
ret
==
-
EAGAIN
)
{
redirty_page_for_writepage
(
wbc
,
page
);
ret
=
0
;
}
return
ret
;
}
/*
...
...
@@ -1546,7 +1557,7 @@ int nfs_migrate_page(struct address_space *mapping, struct page *newpage,
nfs_fscache_release_page
(
page
,
GFP_KERNEL
);
req
=
nfs_find_and_lock_request
(
page
);
req
=
nfs_find_and_lock_request
(
page
,
false
);
ret
=
PTR_ERR
(
req
);
if
(
IS_ERR
(
req
))
goto
out
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录