mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
[iov_iter] new primitives - copy_from_iter_full() and friends
copy_from_iter_full(), copy_from_iter_full_nocache() and csum_and_copy_from_iter_full() - counterparts of copy_from_iter() et.al., advancing iterator only in case of successful full copy and returning whether it had been successful or not. Convert some obvious users. *NOTE* - do not blindly assume that something is a good candidate for those unless you are sure that not advancing iov_iter in failure case is the right thing in this case. Anything that does short read/short write kind of stuff (or is in a loop, etc.) is unlikely to be a good one. Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
parent
e5517c2a5a
commit
cbbd26b8b1
17 changed files with 121 additions and 39 deletions
|
|
@ -203,7 +203,7 @@ ncp_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
|
|||
bufsize - (pos % bufsize),
|
||||
iov_iter_count(from));
|
||||
|
||||
if (copy_from_iter(bouncebuffer, to_write, from) != to_write) {
|
||||
if (!copy_from_iter_full(bouncebuffer, to_write, from)) {
|
||||
errno = -EFAULT;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue