X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=mm%2Ffilemap.c;h=c0018f2d50e04e2ea03045989b742254be0a8489;hb=4721d22160c2d37a2e8a0841578bbe8a937b7000;hp=7771871fa3535d4895ba0d5e92b6a84870980dfb;hpb=c125d5e846894043361c0c89c1140be8fd6600b7;p=karo-tx-linux.git diff --git a/mm/filemap.c b/mm/filemap.c index 7771871fa353..c0018f2d50e0 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -9,7 +9,7 @@ * most "normal" filesystems (but you don't /have/ to use this: * the NFS filesystem used to do this differently, for example) */ -#include +#include #include #include #include @@ -2115,6 +2115,7 @@ void iov_iter_advance(struct iov_iter *i, size_t bytes) } else { const struct iovec *iov = i->iov; size_t base = i->iov_offset; + unsigned long nr_segs = i->nr_segs; /* * The !iov->iov_len check ensures we skip over unlikely @@ -2130,11 +2131,13 @@ void iov_iter_advance(struct iov_iter *i, size_t bytes) base += copy; if (iov->iov_len == base) { iov++; + nr_segs--; base = 0; } } i->iov = iov; i->iov_offset = base; + i->nr_segs = nr_segs; } } EXPORT_SYMBOL(iov_iter_advance);