Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
05bb2e0b
Commit
05bb2e0b
authored
Mar 05, 2014
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ceph_aio_read(): keep iov_iter across retries
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
886a3911
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
fs/ceph/file.c
fs/ceph/file.c
+8
-6
No files found.
fs/ceph/file.c
View file @
05bb2e0b
...
@@ -806,6 +806,9 @@ static ssize_t ceph_aio_read(struct kiocb *iocb, const struct iovec *iov,
...
@@ -806,6 +806,9 @@ static ssize_t ceph_aio_read(struct kiocb *iocb, const struct iovec *iov,
ssize_t
ret
;
ssize_t
ret
;
int
want
,
got
=
0
;
int
want
,
got
=
0
;
int
checkeof
=
0
,
read
=
0
;
int
checkeof
=
0
,
read
=
0
;
struct
iov_iter
i
;
iov_iter_init
(
&
i
,
iov
,
nr_segs
,
len
,
0
);
again:
again:
dout
(
"aio_read %p %llx.%llx %llu~%u trying to get caps on %p
\n
"
,
dout
(
"aio_read %p %llx.%llx %llu~%u trying to get caps on %p
\n
"
,
...
@@ -822,28 +825,26 @@ static ssize_t ceph_aio_read(struct kiocb *iocb, const struct iovec *iov,
...
@@ -822,28 +825,26 @@ static ssize_t ceph_aio_read(struct kiocb *iocb, const struct iovec *iov,
if
((
got
&
(
CEPH_CAP_FILE_CACHE
|
CEPH_CAP_FILE_LAZYIO
))
==
0
||
if
((
got
&
(
CEPH_CAP_FILE_CACHE
|
CEPH_CAP_FILE_LAZYIO
))
==
0
||
(
iocb
->
ki_filp
->
f_flags
&
O_DIRECT
)
||
(
iocb
->
ki_filp
->
f_flags
&
O_DIRECT
)
||
(
fi
->
flags
&
CEPH_F_SYNC
))
{
(
fi
->
flags
&
CEPH_F_SYNC
))
{
struct
iov_iter
i
;
dout
(
"aio_sync_read %p %llx.%llx %llu~%u got cap refs on %s
\n
"
,
dout
(
"aio_sync_read %p %llx.%llx %llu~%u got cap refs on %s
\n
"
,
inode
,
ceph_vinop
(
inode
),
iocb
->
ki_pos
,
(
unsigned
)
len
,
inode
,
ceph_vinop
(
inode
),
iocb
->
ki_pos
,
(
unsigned
)
len
,
ceph_cap_string
(
got
));
ceph_cap_string
(
got
));
if
(
!
read
)
len
=
iov_length
(
iov
,
nr_segs
);
iov_iter_init
(
&
i
,
iov
,
nr_segs
,
len
,
read
);
/* hmm, this isn't really async... */
/* hmm, this isn't really async... */
ret
=
ceph_sync_read
(
iocb
,
&
i
,
&
checkeof
);
ret
=
ceph_sync_read
(
iocb
,
&
i
,
&
checkeof
);
}
else
{
}
else
{
/*
/*
* We can't modify the content of iov,
* We can't modify the content of iov,
* so we only read from beginning.
* so we only read from beginning.
*
* When we switch generic_file_aio_read() to iov_iter, the
* if () below will be removed -- AV
*/
*/
if
(
read
)
{
if
(
read
)
{
iocb
->
ki_pos
=
pos
;
iocb
->
ki_pos
=
pos
;
len
=
iocb
->
ki_nbytes
;
len
=
iocb
->
ki_nbytes
;
read
=
0
;
read
=
0
;
iov_iter_init
(
&
i
,
iov
,
nr_segs
,
len
,
0
);
}
}
dout
(
"aio_read %p %llx.%llx %llu~%u got cap refs on %s
\n
"
,
dout
(
"aio_read %p %llx.%llx %llu~%u got cap refs on %s
\n
"
,
inode
,
ceph_vinop
(
inode
),
pos
,
(
unsigned
)
len
,
inode
,
ceph_vinop
(
inode
),
pos
,
(
unsigned
)
len
,
...
@@ -866,6 +867,7 @@ static ssize_t ceph_aio_read(struct kiocb *iocb, const struct iovec *iov,
...
@@ -866,6 +867,7 @@ static ssize_t ceph_aio_read(struct kiocb *iocb, const struct iovec *iov,
", reading more
\n
"
,
iocb
->
ki_pos
,
", reading more
\n
"
,
iocb
->
ki_pos
,
inode
->
i_size
);
inode
->
i_size
);
iov_iter_advance
(
&
i
,
ret
);
read
+=
ret
;
read
+=
ret
;
len
-=
ret
;
len
-=
ret
;
checkeof
=
0
;
checkeof
=
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment