Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
2ec3a12a
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
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看板
提交
2ec3a12a
编写于
8月 19, 2014
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cachefiles_write_page(): switch to __kernel_write()
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
59482291
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
21 addition
and
29 deletion
+21
-29
fs/cachefiles/rdwr.c
fs/cachefiles/rdwr.c
+19
-29
fs/read_write.c
fs/read_write.c
+2
-0
未找到文件。
fs/cachefiles/rdwr.c
浏览文件 @
2ec3a12a
...
...
@@ -880,7 +880,6 @@ int cachefiles_write_page(struct fscache_storage *op, struct page *page)
{
struct
cachefiles_object
*
object
;
struct
cachefiles_cache
*
cache
;
mm_segment_t
old_fs
;
struct
file
*
file
;
struct
path
path
;
loff_t
pos
,
eof
;
...
...
@@ -914,36 +913,27 @@ int cachefiles_write_page(struct fscache_storage *op, struct page *page)
if
(
IS_ERR
(
file
))
{
ret
=
PTR_ERR
(
file
);
}
else
{
ret
=
-
EIO
;
if
(
file
->
f_op
->
write
)
{
pos
=
(
loff_t
)
page
->
index
<<
PAGE_SHIFT
;
/* we mustn't write more data than we have, so we have
* to beware of a partial page at EOF */
eof
=
object
->
fscache
.
store_limit_l
;
len
=
PAGE_SIZE
;
if
(
eof
&
~
PAGE_MASK
)
{
ASSERTCMP
(
pos
,
<
,
eof
);
if
(
eof
-
pos
<
PAGE_SIZE
)
{
_debug
(
"cut short %llx to %llx"
,
pos
,
eof
);
len
=
eof
-
pos
;
ASSERTCMP
(
pos
+
len
,
==
,
eof
);
}
pos
=
(
loff_t
)
page
->
index
<<
PAGE_SHIFT
;
/* we mustn't write more data than we have, so we have
* to beware of a partial page at EOF */
eof
=
object
->
fscache
.
store_limit_l
;
len
=
PAGE_SIZE
;
if
(
eof
&
~
PAGE_MASK
)
{
ASSERTCMP
(
pos
,
<
,
eof
);
if
(
eof
-
pos
<
PAGE_SIZE
)
{
_debug
(
"cut short %llx to %llx"
,
pos
,
eof
);
len
=
eof
-
pos
;
ASSERTCMP
(
pos
+
len
,
==
,
eof
);
}
data
=
kmap
(
page
);
file_start_write
(
file
);
old_fs
=
get_fs
();
set_fs
(
KERNEL_DS
);
ret
=
file
->
f_op
->
write
(
file
,
(
const
void
__user
*
)
data
,
len
,
&
pos
);
set_fs
(
old_fs
);
kunmap
(
page
);
file_end_write
(
file
);
if
(
ret
!=
len
)
ret
=
-
EIO
;
}
data
=
kmap
(
page
);
ret
=
__kernel_write
(
file
,
data
,
len
,
&
pos
);
kunmap
(
page
);
if
(
ret
!=
len
)
ret
=
-
EIO
;
fput
(
file
);
}
...
...
fs/read_write.c
浏览文件 @
2ec3a12a
...
...
@@ -513,6 +513,8 @@ ssize_t __kernel_write(struct file *file, const char *buf, size_t count, loff_t
return
ret
;
}
EXPORT_SYMBOL
(
__kernel_write
);
ssize_t
vfs_write
(
struct
file
*
file
,
const
char
__user
*
buf
,
size_t
count
,
loff_t
*
pos
)
{
ssize_t
ret
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录