Print this page
5382 pvn_getpages handles lengths <= PAGESIZE just fine

*** 18,27 **** --- 18,28 ---- * * CDDL HEADER END */ /* * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2015 Nexenta Systems, Inc. All rights reserved. */ #include <sys/types.h> #include <sys/param.h> #include <sys/systm.h>
*** 114,145 **** caddr_t addr, enum seg_rw rw, struct cred *cr, caller_context_t *ct) { - int err; - SWAPFS_PRINT(SWAP_VOPS, "swap_getpage: vp %p, off %llx, len %lx\n", (void *)vp, off, len, 0, 0); TRACE_3(TR_FAC_SWAPFS, TR_SWAPFS_GETPAGE, "swapfs getpage:vp %p off %llx len %ld", (void *)vp, off, len); ! if (len <= PAGESIZE) { ! err = swap_getapage(vp, (u_offset_t)off, len, protp, pl, plsz, ! seg, addr, rw, cr); ! } else { ! err = pvn_getpages(swap_getapage, vp, (u_offset_t)off, len, ! protp, pl, plsz, seg, addr, rw, cr); ! } ! ! return (err); } /* ! * Called from pvn_getpages or swap_getpage to get a particular page. */ /*ARGSUSED*/ static int swap_getapage( struct vnode *vp, --- 115,137 ---- caddr_t addr, enum seg_rw rw, struct cred *cr, caller_context_t *ct) { SWAPFS_PRINT(SWAP_VOPS, "swap_getpage: vp %p, off %llx, len %lx\n", (void *)vp, off, len, 0, 0); TRACE_3(TR_FAC_SWAPFS, TR_SWAPFS_GETPAGE, "swapfs getpage:vp %p off %llx len %ld", (void *)vp, off, len); ! return (pvn_getpages(swap_getapage, vp, (u_offset_t)off, len, protp, ! pl, plsz, seg, addr, rw, cr)); } /* ! * Called from pvn_getpages to get a particular page. */ /*ARGSUSED*/ static int swap_getapage( struct vnode *vp,