Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
e6a7bcb4
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看板
提交
e6a7bcb4
编写于
4月 02, 2014
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cifs: switch to ->read_iter()
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
37c20f16
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
22 addition
and
32 deletion
+22
-32
fs/cifs/cifsfs.c
fs/cifs/cifsfs.c
+8
-8
fs/cifs/cifsfs.h
fs/cifs/cifsfs.h
+2
-4
fs/cifs/file.c
fs/cifs/file.c
+12
-20
未找到文件。
fs/cifs/cifsfs.c
浏览文件 @
e6a7bcb4
...
...
@@ -907,9 +907,9 @@ const struct file_operations cifs_file_ops = {
};
const
struct
file_operations
cifs_file_strict_ops
=
{
.
read
=
do
_sync_read
,
.
read
=
new
_sync_read
,
.
write
=
do_sync_write
,
.
aio_read
=
cifs_strict_readv
,
.
read_iter
=
cifs_strict_readv
,
.
aio_write
=
cifs_strict_writev
,
.
open
=
cifs_open
,
.
release
=
cifs_close
,
...
...
@@ -927,9 +927,9 @@ const struct file_operations cifs_file_strict_ops = {
const
struct
file_operations
cifs_file_direct_ops
=
{
/* BB reevaluate whether they can be done with directio, no cache */
.
read
=
do
_sync_read
,
.
read
=
new
_sync_read
,
.
write
=
do_sync_write
,
.
aio_read
=
cifs_user_readv
,
.
read_iter
=
cifs_user_readv
,
.
aio_write
=
cifs_user_writev
,
.
open
=
cifs_open
,
.
release
=
cifs_close
,
...
...
@@ -964,9 +964,9 @@ const struct file_operations cifs_file_nobrl_ops = {
};
const
struct
file_operations
cifs_file_strict_nobrl_ops
=
{
.
read
=
do
_sync_read
,
.
read
=
new
_sync_read
,
.
write
=
do_sync_write
,
.
aio_read
=
cifs_strict_readv
,
.
read_iter
=
cifs_strict_readv
,
.
aio_write
=
cifs_strict_writev
,
.
open
=
cifs_open
,
.
release
=
cifs_close
,
...
...
@@ -983,9 +983,9 @@ const struct file_operations cifs_file_strict_nobrl_ops = {
const
struct
file_operations
cifs_file_direct_nobrl_ops
=
{
/* BB reevaluate whether they can be done with directio, no cache */
.
read
=
do
_sync_read
,
.
read
=
new
_sync_read
,
.
write
=
do_sync_write
,
.
aio_read
=
cifs_user_readv
,
.
read_iter
=
cifs_user_readv
,
.
aio_write
=
cifs_user_writev
,
.
open
=
cifs_open
,
.
release
=
cifs_close
,
...
...
fs/cifs/cifsfs.h
浏览文件 @
e6a7bcb4
...
...
@@ -85,10 +85,8 @@ extern const struct file_operations cifs_file_strict_nobrl_ops;
extern
int
cifs_open
(
struct
inode
*
inode
,
struct
file
*
file
);
extern
int
cifs_close
(
struct
inode
*
inode
,
struct
file
*
file
);
extern
int
cifs_closedir
(
struct
inode
*
inode
,
struct
file
*
file
);
extern
ssize_t
cifs_user_readv
(
struct
kiocb
*
iocb
,
const
struct
iovec
*
iov
,
unsigned
long
nr_segs
,
loff_t
pos
);
extern
ssize_t
cifs_strict_readv
(
struct
kiocb
*
iocb
,
const
struct
iovec
*
iov
,
unsigned
long
nr_segs
,
loff_t
pos
);
extern
ssize_t
cifs_user_readv
(
struct
kiocb
*
iocb
,
struct
iov_iter
*
to
);
extern
ssize_t
cifs_strict_readv
(
struct
kiocb
*
iocb
,
struct
iov_iter
*
to
);
extern
ssize_t
cifs_user_writev
(
struct
kiocb
*
iocb
,
const
struct
iovec
*
iov
,
unsigned
long
nr_segs
,
loff_t
pos
);
extern
ssize_t
cifs_strict_writev
(
struct
kiocb
*
iocb
,
const
struct
iovec
*
iov
,
...
...
fs/cifs/file.c
浏览文件 @
e6a7bcb4
...
...
@@ -2830,32 +2830,25 @@ cifs_uncached_read_into_pages(struct TCP_Server_Info *server,
return
total_read
>
0
?
total_read
:
result
;
}
ssize_t
cifs_user_readv
(
struct
kiocb
*
iocb
,
const
struct
iovec
*
iov
,
unsigned
long
nr_segs
,
loff_t
pos
)
ssize_t
cifs_user_readv
(
struct
kiocb
*
iocb
,
struct
iov_iter
*
to
)
{
struct
file
*
file
=
iocb
->
ki_filp
;
ssize_t
rc
;
size_t
len
,
cur_len
;
ssize_t
total_read
=
0
;
loff_t
offset
=
pos
;
loff_t
offset
=
iocb
->
ki_
pos
;
unsigned
int
npages
;
struct
cifs_sb_info
*
cifs_sb
;
struct
cifs_tcon
*
tcon
;
struct
cifsFileInfo
*
open_file
;
struct
cifs_readdata
*
rdata
,
*
tmp
;
struct
list_head
rdata_list
;
struct
iov_iter
to
;
pid_t
pid
;
if
(
!
nr_segs
)
return
0
;
len
=
iov_length
(
iov
,
nr_segs
);
len
=
iov_iter_count
(
to
);
if
(
!
len
)
return
0
;
iov_iter_init
(
&
to
,
READ
,
iov
,
nr_segs
,
len
);
INIT_LIST_HEAD
(
&
rdata_list
);
cifs_sb
=
CIFS_SB
(
file
->
f_path
.
dentry
->
d_sb
);
open_file
=
file
->
private_data
;
...
...
@@ -2913,7 +2906,7 @@ ssize_t cifs_user_readv(struct kiocb *iocb, const struct iovec *iov,
if
(
!
list_empty
(
&
rdata_list
))
rc
=
0
;
len
=
iov_iter_count
(
&
to
);
len
=
iov_iter_count
(
to
);
/* the loop below should proceed in the order of increasing offsets */
list_for_each_entry_safe
(
rdata
,
tmp
,
&
rdata_list
,
list
)
{
again:
...
...
@@ -2930,7 +2923,7 @@ ssize_t cifs_user_readv(struct kiocb *iocb, const struct iovec *iov,
goto
again
;
}
}
else
{
rc
=
cifs_readdata_to_iov
(
rdata
,
&
to
);
rc
=
cifs_readdata_to_iov
(
rdata
,
to
);
}
}
...
...
@@ -2938,7 +2931,7 @@ ssize_t cifs_user_readv(struct kiocb *iocb, const struct iovec *iov,
kref_put
(
&
rdata
->
refcount
,
cifs_uncached_readdata_release
);
}
total_read
=
len
-
iov_iter_count
(
&
to
);
total_read
=
len
-
iov_iter_count
(
to
);
cifs_stats_bytes_read
(
tcon
,
total_read
);
...
...
@@ -2947,15 +2940,14 @@ ssize_t cifs_user_readv(struct kiocb *iocb, const struct iovec *iov,
rc
=
0
;
if
(
total_read
)
{
iocb
->
ki_pos
=
pos
+
total_read
;
iocb
->
ki_pos
+=
total_read
;
return
total_read
;
}
return
rc
;
}
ssize_t
cifs_strict_readv
(
struct
kiocb
*
iocb
,
const
struct
iovec
*
iov
,
unsigned
long
nr_segs
,
loff_t
pos
)
cifs_strict_readv
(
struct
kiocb
*
iocb
,
struct
iov_iter
*
to
)
{
struct
inode
*
inode
=
file_inode
(
iocb
->
ki_filp
);
struct
cifsInodeInfo
*
cinode
=
CIFS_I
(
inode
);
...
...
@@ -2974,22 +2966,22 @@ cifs_strict_readv(struct kiocb *iocb, const struct iovec *iov,
* pos+len-1.
*/
if
(
!
CIFS_CACHE_READ
(
cinode
))
return
cifs_user_readv
(
iocb
,
iov
,
nr_segs
,
pos
);
return
cifs_user_readv
(
iocb
,
to
);
if
(
cap_unix
(
tcon
->
ses
)
&&
(
CIFS_UNIX_FCNTL_CAP
&
le64_to_cpu
(
tcon
->
fsUnixInfo
.
Capability
))
&&
((
cifs_sb
->
mnt_cifs_flags
&
CIFS_MOUNT_NOPOSIXBRL
)
==
0
))
return
generic_file_
aio_read
(
iocb
,
iov
,
nr_segs
,
pos
);
return
generic_file_
read_iter
(
iocb
,
to
);
/*
* We need to hold the sem to be sure nobody modifies lock list
* with a brlock that prevents reading.
*/
down_read
(
&
cinode
->
lock_sem
);
if
(
!
cifs_find_lock_conflict
(
cfile
,
pos
,
iov_length
(
iov
,
nr_segs
),
if
(
!
cifs_find_lock_conflict
(
cfile
,
iocb
->
ki_pos
,
iov_iter_count
(
to
),
tcon
->
ses
->
server
->
vals
->
shared_lock_type
,
NULL
,
CIFS_READ_OP
))
rc
=
generic_file_
aio_read
(
iocb
,
iov
,
nr_segs
,
pos
);
rc
=
generic_file_
read_iter
(
iocb
,
to
);
up_read
(
&
cinode
->
lock_sem
);
return
rc
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录