Changeset View
Changeset View
Standalone View
Standalone View
head/sys/fs/nfsclient/nfs_clbio.c
Show First 20 Lines • Show All 178 Lines • ▼ Show 20 Lines | ncl_getpages(struct vop_getpages_args *ap) | ||||
/* | /* | ||||
* We use only the kva address for the buffer, but this is extremely | * We use only the kva address for the buffer, but this is extremely | ||||
* convenient and fast. | * convenient and fast. | ||||
*/ | */ | ||||
bp = getpbuf(&ncl_pbuf_freecnt); | bp = getpbuf(&ncl_pbuf_freecnt); | ||||
kva = (vm_offset_t) bp->b_data; | kva = (vm_offset_t) bp->b_data; | ||||
pmap_qenter(kva, pages, npages); | pmap_qenter(kva, pages, npages); | ||||
PCPU_INC(cnt.v_vnodein); | VM_CNT_INC(v_vnodein); | ||||
PCPU_ADD(cnt.v_vnodepgsin, npages); | VM_CNT_ADD(v_vnodepgsin, npages); | ||||
count = npages << PAGE_SHIFT; | count = npages << PAGE_SHIFT; | ||||
iov.iov_base = (caddr_t) kva; | iov.iov_base = (caddr_t) kva; | ||||
iov.iov_len = count; | iov.iov_len = count; | ||||
uio.uio_iov = &iov; | uio.uio_iov = &iov; | ||||
uio.uio_iovcnt = 1; | uio.uio_iovcnt = 1; | ||||
uio.uio_offset = IDX_TO_OFF(pages[0]->pindex); | uio.uio_offset = IDX_TO_OFF(pages[0]->pindex); | ||||
uio.uio_resid = count; | uio.uio_resid = count; | ||||
▲ Show 20 Lines • Show All 118 Lines • ▼ Show 20 Lines | ncl_putpages(struct vop_putpages_args *ap) | ||||
*/ | */ | ||||
if (offset + count > np->n_size) { | if (offset + count > np->n_size) { | ||||
count = np->n_size - offset; | count = np->n_size - offset; | ||||
if (count < 0) | if (count < 0) | ||||
count = 0; | count = 0; | ||||
} | } | ||||
mtx_unlock(&np->n_mtx); | mtx_unlock(&np->n_mtx); | ||||
PCPU_INC(cnt.v_vnodeout); | VM_CNT_INC(v_vnodeout); | ||||
PCPU_ADD(cnt.v_vnodepgsout, count); | VM_CNT_ADD(v_vnodepgsout, count); | ||||
iov.iov_base = unmapped_buf; | iov.iov_base = unmapped_buf; | ||||
iov.iov_len = count; | iov.iov_len = count; | ||||
uio.uio_iov = &iov; | uio.uio_iov = &iov; | ||||
uio.uio_iovcnt = 1; | uio.uio_iovcnt = 1; | ||||
uio.uio_offset = offset; | uio.uio_offset = offset; | ||||
uio.uio_resid = count; | uio.uio_resid = count; | ||||
uio.uio_segflg = UIO_NOCOPY; | uio.uio_segflg = UIO_NOCOPY; | ||||
▲ Show 20 Lines • Show All 1,564 Lines • Show Last 20 Lines |