Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
775802c0
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
775802c0
编写于
5月 08, 2020
作者:
C
Christoph Hellwig
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fs: remove __vfs_read
Fold it into the two callers. Signed-off-by:
N
Christoph Hellwig
<
hch@lst.de
>
上级
6209dd91
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
21 addition
and
23 deletion
+21
-23
fs/read_write.c
fs/read_write.c
+21
-22
include/linux/fs.h
include/linux/fs.h
+0
-1
未找到文件。
fs/read_write.c
浏览文件 @
775802c0
...
...
@@ -419,17 +419,6 @@ static ssize_t new_sync_read(struct file *filp, char __user *buf, size_t len, lo
return
ret
;
}
ssize_t
__vfs_read
(
struct
file
*
file
,
char
__user
*
buf
,
size_t
count
,
loff_t
*
pos
)
{
if
(
file
->
f_op
->
read
)
return
file
->
f_op
->
read
(
file
,
buf
,
count
,
pos
);
else
if
(
file
->
f_op
->
read_iter
)
return
new_sync_read
(
file
,
buf
,
count
,
pos
);
else
return
-
EINVAL
;
}
ssize_t
__kernel_read
(
struct
file
*
file
,
void
*
buf
,
size_t
count
,
loff_t
*
pos
)
{
mm_segment_t
old_fs
=
get_fs
();
...
...
@@ -443,7 +432,12 @@ ssize_t __kernel_read(struct file *file, void *buf, size_t count, loff_t *pos)
if
(
count
>
MAX_RW_COUNT
)
count
=
MAX_RW_COUNT
;
set_fs
(
KERNEL_DS
);
ret
=
__vfs_read
(
file
,
(
void
__user
*
)
buf
,
count
,
pos
);
if
(
file
->
f_op
->
read
)
ret
=
file
->
f_op
->
read
(
file
,
(
void
__user
*
)
buf
,
count
,
pos
);
else
if
(
file
->
f_op
->
read_iter
)
ret
=
new_sync_read
(
file
,
(
void
__user
*
)
buf
,
count
,
pos
);
else
ret
=
-
EINVAL
;
set_fs
(
old_fs
);
if
(
ret
>
0
)
{
fsnotify_access
(
file
);
...
...
@@ -476,17 +470,22 @@ ssize_t vfs_read(struct file *file, char __user *buf, size_t count, loff_t *pos)
return
-
EFAULT
;
ret
=
rw_verify_area
(
READ
,
file
,
pos
,
count
);
if
(
!
ret
)
{
if
(
count
>
MAX_RW_COUNT
)
count
=
MAX_RW_COUNT
;
ret
=
__vfs_read
(
file
,
buf
,
count
,
pos
);
if
(
ret
>
0
)
{
fsnotify_access
(
file
);
add_rchar
(
current
,
ret
);
}
inc_syscr
(
current
);
}
if
(
ret
)
return
ret
;
if
(
count
>
MAX_RW_COUNT
)
count
=
MAX_RW_COUNT
;
if
(
file
->
f_op
->
read
)
ret
=
file
->
f_op
->
read
(
file
,
buf
,
count
,
pos
);
else
if
(
file
->
f_op
->
read_iter
)
ret
=
new_sync_read
(
file
,
buf
,
count
,
pos
);
else
ret
=
-
EINVAL
;
if
(
ret
>
0
)
{
fsnotify_access
(
file
);
add_rchar
(
current
,
ret
);
}
inc_syscr
(
current
);
return
ret
;
}
...
...
include/linux/fs.h
浏览文件 @
775802c0
...
...
@@ -1917,7 +1917,6 @@ ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector,
struct
iovec
*
fast_pointer
,
struct
iovec
**
ret_pointer
);
extern
ssize_t
__vfs_read
(
struct
file
*
,
char
__user
*
,
size_t
,
loff_t
*
);
extern
ssize_t
vfs_read
(
struct
file
*
,
char
__user
*
,
size_t
,
loff_t
*
);
extern
ssize_t
vfs_write
(
struct
file
*
,
const
char
__user
*
,
size_t
,
loff_t
*
);
extern
ssize_t
vfs_readv
(
struct
file
*
,
const
struct
iovec
__user
*
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录