From: Linus Torvalds Date: Wed, 18 May 2016 17:17:56 +0000 (-0700) Subject: Merge branch 'sendmsg.cifs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs X-Git-Tag: v4.7-rc1~145 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=442c9ac989d71599ebc39f4ea4d5b0e64996904b;p=linux-2.6-block.git Merge branch 'sendmsg.cifs' of git://git./linux/kernel/git/viro/vfs Pull cifs iovec cleanups from Al Viro. * 'sendmsg.cifs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: cifs: don't bother with kmap on read_pages side cifs_readv_receive: use cifs_read_from_socket() cifs: no need to wank with copying and advancing iovec on recvmsg side either cifs: quit playing games with draining iovecs cifs: merge the hash calculation helpers --- 442c9ac989d71599ebc39f4ea4d5b0e64996904b diff --cc fs/cifs/file.c index f3a90298dfe2,0f718679186e..9793ae0bcaa2 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@@ -3308,26 -3302,17 +3299,17 @@@ cifs_readpages_read_into_pages(struct T cifs_dbg(FYI, "eof=%llu eof_index=%lu\n", eof, eof_index); rdata->got_bytes = 0; - rdata->tailsz = PAGE_CACHE_SIZE; + rdata->tailsz = PAGE_SIZE; for (i = 0; i < nr_pages; i++) { struct page *page = rdata->pages[i]; - size_t n = PAGE_CACHE_SIZE; ++ size_t n = PAGE_SIZE; - if (len >= PAGE_CACHE_SIZE) { - len -= PAGE_CACHE_SIZE; + if (len >= PAGE_SIZE) { - /* enough data to fill the page */ - iov.iov_base = kmap(page); - iov.iov_len = PAGE_SIZE; - cifs_dbg(FYI, "%u: idx=%lu iov_base=%p iov_len=%zu\n", - i, page->index, iov.iov_base, iov.iov_len); + len -= PAGE_SIZE; } else if (len > 0) { /* enough for partial page, fill and zero the rest */ - iov.iov_base = kmap(page); - iov.iov_len = len; - cifs_dbg(FYI, "%u: idx=%lu iov_base=%p iov_len=%zu\n", - i, page->index, iov.iov_base, iov.iov_len); - memset(iov.iov_base + len, - '\0', PAGE_SIZE - len); - rdata->tailsz = len; - zero_user(page, len, PAGE_CACHE_SIZE - len); ++ zero_user(page, len, PAGE_SIZE - len); + n = rdata->tailsz = len; len = 0; } else if (page->index > eof_index) { /*