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
39c6acea
Commit
39c6acea
authored
Jan 09, 2016
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
afs_send_pages(): use ITER_BVEC
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
be6e4d66
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
fs/afs/rxrpc.c
fs/afs/rxrpc.c
+7
-8
No files found.
fs/afs/rxrpc.c
View file @
39c6acea
...
...
@@ -249,8 +249,7 @@ void afs_flat_call_destructor(struct afs_call *call)
/*
* attach the data from a bunch of pages on an inode to a call
*/
static
int
afs_send_pages
(
struct
afs_call
*
call
,
struct
msghdr
*
msg
,
struct
kvec
*
iov
)
static
int
afs_send_pages
(
struct
afs_call
*
call
,
struct
msghdr
*
msg
)
{
struct
page
*
pages
[
8
];
unsigned
count
,
n
,
loop
,
offset
,
to
;
...
...
@@ -273,20 +272,21 @@ static int afs_send_pages(struct afs_call *call, struct msghdr *msg,
loop
=
0
;
do
{
struct
bio_vec
bvec
=
{.
bv_page
=
pages
[
loop
],
.
bv_offset
=
offset
};
msg
->
msg_flags
=
0
;
to
=
PAGE_SIZE
;
if
(
first
+
loop
>=
last
)
to
=
call
->
last_to
;
else
msg
->
msg_flags
=
MSG_MORE
;
iov
->
iov_base
=
kmap
(
pages
[
loop
])
+
offset
;
iov
->
iov_len
=
to
-
offset
;
bvec
.
bv_len
=
to
-
offset
;
offset
=
0
;
_debug
(
"- range %u-%u%s"
,
offset
,
to
,
msg
->
msg_flags
?
" [more]"
:
""
);
iov_iter_
kvec
(
&
msg
->
msg_iter
,
WRITE
|
ITER_K
VEC
,
iov
,
1
,
to
-
offset
);
iov_iter_
bvec
(
&
msg
->
msg_iter
,
WRITE
|
ITER_B
VEC
,
&
bvec
,
1
,
to
-
offset
);
/* have to change the state *before* sending the last
* packet as RxRPC might give us the reply before it
...
...
@@ -295,7 +295,6 @@ static int afs_send_pages(struct afs_call *call, struct msghdr *msg,
call
->
state
=
AFS_CALL_AWAIT_REPLY
;
ret
=
rxrpc_kernel_send_data
(
afs_socket
,
call
->
rxcall
,
msg
,
to
-
offset
);
kunmap
(
pages
[
loop
]);
if
(
ret
<
0
)
break
;
}
while
(
++
loop
<
count
);
...
...
@@ -379,7 +378,7 @@ int afs_make_call(struct in_addr *addr, struct afs_call *call, gfp_t gfp,
goto
error_do_abort
;
if
(
call
->
send_pages
)
{
ret
=
afs_send_pages
(
call
,
&
msg
,
iov
);
ret
=
afs_send_pages
(
call
,
&
msg
);
if
(
ret
<
0
)
goto
error_do_abort
;
}
...
...
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