mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts were simply overlapping changes. In the net/ipv4/route.c case the code had simply moved around a little bit and the same fix was made in both 'net' and 'net-next'. In the net/sched/sch_generic.c case a fix in 'net' happened at the same time that a new argument was added to qdisc_hash_add(). Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
commit
6b6cbc1471
298 changed files with 3243 additions and 1816 deletions
|
|
@ -786,6 +786,68 @@ void iov_iter_advance(struct iov_iter *i, size_t size)
|
|||
}
|
||||
EXPORT_SYMBOL(iov_iter_advance);
|
||||
|
||||
void iov_iter_revert(struct iov_iter *i, size_t unroll)
|
||||
{
|
||||
if (!unroll)
|
||||
return;
|
||||
i->count += unroll;
|
||||
if (unlikely(i->type & ITER_PIPE)) {
|
||||
struct pipe_inode_info *pipe = i->pipe;
|
||||
int idx = i->idx;
|
||||
size_t off = i->iov_offset;
|
||||
while (1) {
|
||||
size_t n = off - pipe->bufs[idx].offset;
|
||||
if (unroll < n) {
|
||||
off -= (n - unroll);
|
||||
break;
|
||||
}
|
||||
unroll -= n;
|
||||
if (!unroll && idx == i->start_idx) {
|
||||
off = 0;
|
||||
break;
|
||||
}
|
||||
if (!idx--)
|
||||
idx = pipe->buffers - 1;
|
||||
off = pipe->bufs[idx].offset + pipe->bufs[idx].len;
|
||||
}
|
||||
i->iov_offset = off;
|
||||
i->idx = idx;
|
||||
pipe_truncate(i);
|
||||
return;
|
||||
}
|
||||
if (unroll <= i->iov_offset) {
|
||||
i->iov_offset -= unroll;
|
||||
return;
|
||||
}
|
||||
unroll -= i->iov_offset;
|
||||
if (i->type & ITER_BVEC) {
|
||||
const struct bio_vec *bvec = i->bvec;
|
||||
while (1) {
|
||||
size_t n = (--bvec)->bv_len;
|
||||
i->nr_segs++;
|
||||
if (unroll <= n) {
|
||||
i->bvec = bvec;
|
||||
i->iov_offset = n - unroll;
|
||||
return;
|
||||
}
|
||||
unroll -= n;
|
||||
}
|
||||
} else { /* same logics for iovec and kvec */
|
||||
const struct iovec *iov = i->iov;
|
||||
while (1) {
|
||||
size_t n = (--iov)->iov_len;
|
||||
i->nr_segs++;
|
||||
if (unroll <= n) {
|
||||
i->iov = iov;
|
||||
i->iov_offset = n - unroll;
|
||||
return;
|
||||
}
|
||||
unroll -= n;
|
||||
}
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL(iov_iter_revert);
|
||||
|
||||
/*
|
||||
* Return the count of just the current iov_iter segment.
|
||||
*/
|
||||
|
|
@ -839,6 +901,7 @@ void iov_iter_pipe(struct iov_iter *i, int direction,
|
|||
i->idx = (pipe->curbuf + pipe->nrbufs) & (pipe->buffers - 1);
|
||||
i->iov_offset = 0;
|
||||
i->count = count;
|
||||
i->start_idx = i->idx;
|
||||
}
|
||||
EXPORT_SYMBOL(iov_iter_pipe);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue