Author: kib Date: Sun Nov 22 09:48:03 2015 New Revision: 291157 URL: https://svnweb.freebsd.org/changeset/base/291157
Log: Noted by: glebius Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/vnode_pager.c Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Sun Nov 22 05:26:13 2015 (r291156) +++ head/sys/vm/vnode_pager.c Sun Nov 22 09:48:03 2015 (r291157) @@ -770,7 +770,7 @@ vnode_pager_generic_getpages(struct vnod struct bufobj *bo; struct buf *bp; daddr_t firstaddr, reqblock; - off_t foff; + off_t foff, pib; int pbefore, pafter, i, size, bsize, first, last, *freecnt; int count, error, before, after, secmask; @@ -864,8 +864,9 @@ vnode_pager_generic_getpages(struct vnod VM_OBJECT_WUNLOCK(object); } - pbefore = (daddr_t)before * bsize / PAGE_SIZE; - pafter = (daddr_t)after * bsize / PAGE_SIZE; + pib = IDX_TO_OFF(m[reqpage]->pindex) % bsize; + pbefore = ((daddr_t)before * bsize + pib) / PAGE_SIZE; + pafter = ((daddr_t)(after + 1) * bsize - pib) / PAGE_SIZE - 1; first = reqpage < pbefore ? 0 : reqpage - pbefore; last = reqpage + pafter >= count ? count - 1 : reqpage + pafter; if (first > 0 || last + 1 < count) { @@ -887,7 +888,7 @@ vnode_pager_generic_getpages(struct vnod * here on direct device I/O */ firstaddr = reqblock; - firstaddr += (IDX_TO_OFF(m[reqpage]->pindex) % bsize) / DEV_BSIZE; + firstaddr += pib / DEV_BSIZE; firstaddr -= IDX_TO_OFF(reqpage - first) / DEV_BSIZE; /* _______________________________________________ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"