Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
4d770ccf
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看板
提交
4d770ccf
编写于
12月 05, 2006
作者:
T
Trond Myklebust
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
NFS: Ensure that nfs_wb_page() calls writepage when necessary.
Signed-off-by:
N
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
上级
1a54533e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
31 addition
and
4 deletion
+31
-4
fs/nfs/write.c
fs/nfs/write.c
+30
-4
include/linux/nfs_fs.h
include/linux/nfs_fs.h
+1
-0
未找到文件。
fs/nfs/write.c
浏览文件 @
4d770ccf
...
@@ -247,7 +247,7 @@ static int wb_priority(struct writeback_control *wbc)
...
@@ -247,7 +247,7 @@ static int wb_priority(struct writeback_control *wbc)
/*
/*
* Write an mmapped page to the server.
* Write an mmapped page to the server.
*/
*/
int
nfs_writepage
(
struct
page
*
page
,
struct
writeback_control
*
wbc
)
static
int
nfs_writepage_locked
(
struct
page
*
page
,
struct
writeback_control
*
wbc
)
{
{
struct
nfs_open_context
*
ctx
;
struct
nfs_open_context
*
ctx
;
struct
inode
*
inode
=
page
->
mapping
->
host
;
struct
inode
*
inode
=
page
->
mapping
->
host
;
...
@@ -265,7 +265,7 @@ int nfs_writepage(struct page *page, struct writeback_control *wbc)
...
@@ -265,7 +265,7 @@ int nfs_writepage(struct page *page, struct writeback_control *wbc)
if
(
!
flushme
)
if
(
!
flushme
)
goto
out
;
goto
out
;
/* Ensure we've flushed out the invalid write */
/* Ensure we've flushed out the invalid write */
nfs_wb_page_priority
(
inode
,
page
,
wb_priority
(
wbc
));
nfs_wb_page_priority
(
inode
,
page
,
wb_priority
(
wbc
)
|
FLUSH_STABLE
|
FLUSH_NOWRITEPAGE
);
}
}
offset
=
nfs_page_length
(
page
);
offset
=
nfs_page_length
(
page
);
...
@@ -283,6 +283,14 @@ int nfs_writepage(struct page *page, struct writeback_control *wbc)
...
@@ -283,6 +283,14 @@ int nfs_writepage(struct page *page, struct writeback_control *wbc)
out:
out:
if
(
!
wbc
->
for_writepages
)
if
(
!
wbc
->
for_writepages
)
nfs_flush_mapping
(
page
->
mapping
,
wbc
,
wb_priority
(
wbc
));
nfs_flush_mapping
(
page
->
mapping
,
wbc
,
wb_priority
(
wbc
));
return
err
;
}
int
nfs_writepage
(
struct
page
*
page
,
struct
writeback_control
*
wbc
)
{
int
err
;
err
=
nfs_writepage_locked
(
page
,
wbc
);
unlock_page
(
page
);
unlock_page
(
page
);
return
err
;
return
err
;
}
}
...
@@ -1435,8 +1443,26 @@ static int nfs_wb_page_priority(struct inode *inode, struct page *page, int how)
...
@@ -1435,8 +1443,26 @@ static int nfs_wb_page_priority(struct inode *inode, struct page *page, int how)
{
{
loff_t
range_start
=
page_offset
(
page
);
loff_t
range_start
=
page_offset
(
page
);
loff_t
range_end
=
range_start
+
(
loff_t
)(
PAGE_CACHE_SIZE
-
1
);
loff_t
range_end
=
range_start
+
(
loff_t
)(
PAGE_CACHE_SIZE
-
1
);
struct
writeback_control
wbc
=
{
.
bdi
=
page
->
mapping
->
backing_dev_info
,
.
sync_mode
=
WB_SYNC_ALL
,
.
nr_to_write
=
LONG_MAX
,
.
range_start
=
range_start
,
.
range_end
=
range_end
,
};
int
ret
;
return
nfs_sync_mapping_range
(
inode
->
i_mapping
,
range_start
,
range_end
,
how
|
FLUSH_STABLE
);
BUG_ON
(
!
PageLocked
(
page
));
if
(
!
(
how
&
FLUSH_NOWRITEPAGE
)
&&
clear_page_dirty_for_io
(
page
))
{
ret
=
nfs_writepage_locked
(
page
,
&
wbc
);
if
(
ret
<
0
)
goto
out
;
}
ret
=
nfs_sync_mapping_wait
(
page
->
mapping
,
&
wbc
,
how
);
if
(
ret
>=
0
)
return
0
;
out:
return
ret
;
}
}
/*
/*
...
@@ -1444,7 +1470,7 @@ static int nfs_wb_page_priority(struct inode *inode, struct page *page, int how)
...
@@ -1444,7 +1470,7 @@ static int nfs_wb_page_priority(struct inode *inode, struct page *page, int how)
*/
*/
int
nfs_wb_page
(
struct
inode
*
inode
,
struct
page
*
page
)
int
nfs_wb_page
(
struct
inode
*
inode
,
struct
page
*
page
)
{
{
return
nfs_wb_page_priority
(
inode
,
page
,
0
);
return
nfs_wb_page_priority
(
inode
,
page
,
FLUSH_STABLE
);
}
}
int
nfs_set_page_dirty
(
struct
page
*
page
)
int
nfs_set_page_dirty
(
struct
page
*
page
)
...
...
include/linux/nfs_fs.h
浏览文件 @
4d770ccf
...
@@ -33,6 +33,7 @@
...
@@ -33,6 +33,7 @@
#define FLUSH_HIGHPRI 16
/* high priority memory reclaim flush */
#define FLUSH_HIGHPRI 16
/* high priority memory reclaim flush */
#define FLUSH_NOCOMMIT 32
/* Don't send the NFSv3/v4 COMMIT */
#define FLUSH_NOCOMMIT 32
/* Don't send the NFSv3/v4 COMMIT */
#define FLUSH_INVALIDATE 64
/* Invalidate the page cache */
#define FLUSH_INVALIDATE 64
/* Invalidate the page cache */
#define FLUSH_NOWRITEPAGE 128
/* Don't call writepage() */
#ifdef __KERNEL__
#ifdef __KERNEL__
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录