Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
42b1ab97
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看板
提交
42b1ab97
编写于
4月 01, 2015
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
9p: get rid of v9fs_direct_file_read()
do it in ->direct_IO()... Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
e1200fe6
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
12 addition
and
51 deletion
+12
-51
fs/9p/vfs_addr.c
fs/9p/vfs_addr.c
+10
-11
fs/9p/vfs_file.c
fs/9p/vfs_file.c
+2
-40
未找到文件。
fs/9p/vfs_addr.c
浏览文件 @
42b1ab97
...
...
@@ -251,21 +251,20 @@ static ssize_t
v9fs_direct_IO
(
int
rw
,
struct
kiocb
*
iocb
,
struct
iov_iter
*
iter
,
loff_t
pos
)
{
struct
file
*
file
=
iocb
->
ki_filp
;
if
(
rw
==
WRITE
)
{
ssize_t
written
;
int
err
=
0
;
written
=
p9_client_write
(
file
->
private_data
,
pos
,
iter
,
&
err
);
if
(
written
)
{
ssize_t
n
;
int
err
=
0
;
if
(
rw
&
WRITE
)
{
n
=
p9_client_write
(
file
->
private_data
,
pos
,
iter
,
&
err
);
if
(
n
)
{
struct
inode
*
inode
=
file_inode
(
file
);
loff_t
i_size
=
i_size_read
(
inode
);
if
(
pos
+
written
>
i_size
)
inode_add_bytes
(
inode
,
pos
+
written
-
i_size
);
return
written
;
if
(
pos
+
n
>
i_size
)
inode_add_bytes
(
inode
,
pos
+
n
-
i_size
);
}
return
err
;
}
else
{
n
=
p9_client_read
(
file
->
private_data
,
pos
,
iter
,
&
err
);
}
return
-
EINVAL
;
return
n
?
n
:
err
;
}
static
int
v9fs_write_begin
(
struct
file
*
filp
,
struct
address_space
*
mapping
,
...
...
fs/9p/vfs_file.c
浏览文件 @
42b1ab97
...
...
@@ -575,44 +575,6 @@ v9fs_vm_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
return
VM_FAULT_NOPAGE
;
}
static
ssize_t
v9fs_direct_read
(
struct
file
*
filp
,
char
__user
*
udata
,
size_t
count
,
loff_t
*
offsetp
)
{
loff_t
size
,
offset
;
struct
inode
*
inode
;
struct
address_space
*
mapping
;
offset
=
*
offsetp
;
mapping
=
filp
->
f_mapping
;
inode
=
mapping
->
host
;
if
(
!
count
)
return
0
;
size
=
i_size_read
(
inode
);
if
(
offset
<
size
)
filemap_write_and_wait_range
(
mapping
,
offset
,
offset
+
count
-
1
);
return
v9fs_file_read
(
filp
,
udata
,
count
,
offsetp
);
}
/**
* v9fs_cached_file_read - read from a file
* @filp: file pointer to read
* @data: user data buffer to read data into
* @count: size of buffer
* @offset: offset at which to read data
*
*/
static
ssize_t
v9fs_cached_file_read
(
struct
file
*
filp
,
char
__user
*
data
,
size_t
count
,
loff_t
*
offset
)
{
if
(
filp
->
f_flags
&
O_DIRECT
)
return
v9fs_direct_read
(
filp
,
data
,
count
,
offset
);
return
new_sync_read
(
filp
,
data
,
count
,
offset
);
}
/**
* v9fs_mmap_file_read - read from a file
* @filp: file pointer to read
...
...
@@ -690,7 +652,7 @@ static const struct vm_operations_struct v9fs_mmap_file_vm_ops = {
const
struct
file_operations
v9fs_cached_file_operations
=
{
.
llseek
=
generic_file_llseek
,
.
read
=
v9fs_cached_file
_read
,
.
read
=
new_sync
_read
,
.
write
=
new_sync_write
,
.
read_iter
=
generic_file_read_iter
,
.
write_iter
=
generic_file_write_iter
,
...
...
@@ -703,7 +665,7 @@ const struct file_operations v9fs_cached_file_operations = {
const
struct
file_operations
v9fs_cached_file_operations_dotl
=
{
.
llseek
=
generic_file_llseek
,
.
read
=
v9fs_cached_file
_read
,
.
read
=
new_sync
_read
,
.
write
=
new_sync_write
,
.
read_iter
=
generic_file_read_iter
,
.
write_iter
=
generic_file_write_iter
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录