提交 2ec3a12a 编写于 作者: A Al Viro

cachefiles_write_page(): switch to __kernel_write()

Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 59482291
......@@ -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,8 +913,6 @@ 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
......@@ -933,17 +930,10 @@ int cachefiles_write_page(struct fscache_storage *op, struct page *page)
}
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);
ret = __kernel_write(file, data, len, &pos);
kunmap(page);
file_end_write(file);
if (ret != len)
ret = -EIO;
}
fput(file);
}
......
......@@ -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.
先完成此消息的编辑!
想要评论请 注册