Lines Matching refs:vp
90 static int vnode_pager_addr(struct vnode *vp, vm_ooffset_t address,
148 vnode_create_vobject(struct vnode *vp, off_t isize, struct thread *td) in vnode_create_vobject() argument
155 if (!vn_isdisk(vp) && vn_canvmio(vp) == FALSE) in vnode_create_vobject()
158 object = vp->v_object; in vnode_create_vobject()
163 if (vn_isdisk(vp)) { in vnode_create_vobject()
166 if (VOP_GETATTR(vp, &va, td->td_ucred)) in vnode_create_vobject()
172 object = vnode_pager_alloc(vp, size, 0, 0, td->td_ucred); in vnode_create_vobject()
183 vrele(vp); in vnode_create_vobject()
185 KASSERT(vp->v_object != NULL, ("vnode_create_vobject: NULL object")); in vnode_create_vobject()
191 vnode_destroy_vobject(struct vnode *vp) in vnode_destroy_vobject() argument
195 obj = vp->v_object; in vnode_destroy_vobject()
196 if (obj == NULL || obj->handle != vp) in vnode_destroy_vobject()
198 ASSERT_VOP_ELOCKED(vp, "vnode_destroy_vobject"); in vnode_destroy_vobject()
213 vinvalbuf(vp, V_SAVE, 0, 0); in vnode_destroy_vobject()
215 BO_LOCK(&vp->v_bufobj); in vnode_destroy_vobject()
216 vp->v_bufobj.bo_flag |= BO_DEAD; in vnode_destroy_vobject()
217 BO_UNLOCK(&vp->v_bufobj); in vnode_destroy_vobject()
228 KASSERT(vp->v_object == NULL, ("vp %p obj %p", vp, vp->v_object)); in vnode_destroy_vobject()
240 struct vnode *vp; in vnode_pager_alloc() local
248 vp = (struct vnode *)handle; in vnode_pager_alloc()
249 ASSERT_VOP_LOCKED(vp, "vnode_pager_alloc"); in vnode_pager_alloc()
250 VNPASS(vp->v_usecount > 0, vp); in vnode_pager_alloc()
252 object = vp->v_object; in vnode_pager_alloc()
265 if ((vp->v_vflag & VV_VMSIZEVNLOCK) != 0) { in vnode_pager_alloc()
270 VI_LOCK(vp); in vnode_pager_alloc()
271 if (vp->v_object != NULL) { in vnode_pager_alloc()
275 VI_UNLOCK(vp); in vnode_pager_alloc()
285 vp->v_object = object; in vnode_pager_alloc()
286 VI_UNLOCK(vp); in vnode_pager_alloc()
287 vrefact(vp); in vnode_pager_alloc()
307 struct vnode *vp; in vnode_pager_dealloc() local
310 vp = object->handle; in vnode_pager_dealloc()
311 if (vp == NULL) in vnode_pager_dealloc()
320 ASSERT_VOP_ELOCKED(vp, "vnode_pager_dealloc"); in vnode_pager_dealloc()
323 VOP_ADD_WRITECOUNT_CHECKED(vp, -1); in vnode_pager_dealloc()
325 __func__, vp, vp->v_writecount); in vnode_pager_dealloc()
327 vp->v_object = NULL; in vnode_pager_dealloc()
328 VI_LOCK(vp); in vnode_pager_dealloc()
337 if (vp->v_writecount < 0) in vnode_pager_dealloc()
338 vp->v_writecount = 0; in vnode_pager_dealloc()
339 VI_UNLOCK(vp); in vnode_pager_dealloc()
342 vunref(vp); in vnode_pager_dealloc()
350 struct vnode *vp = object->handle; in vnode_pager_haspage() local
364 if (vp == NULL || VN_IS_DOOMED(vp)) in vnode_pager_haspage()
373 bsize = vp->v_mount->mnt_stat.f_iosize; in vnode_pager_haspage()
383 err = VOP_BMAP(vp, reqblock, NULL, &bn, after, before); in vnode_pager_haspage()
433 vnode_pager_setsize(struct vnode *vp, vm_ooffset_t nsize) in vnode_pager_setsize() argument
439 if ((object = vp->v_object) == NULL) in vnode_pager_setsize()
445 mp = vp->v_mount; in vnode_pager_setsize()
447 assert_vop_elocked(vp, in vnode_pager_setsize()
536 vnode_pager_addr(struct vnode *vp, vm_ooffset_t address, daddr_t *rtaddress, in vnode_pager_addr() argument
544 if (VN_IS_DOOMED(vp)) in vnode_pager_addr()
547 bsize = vp->v_mount->mnt_stat.f_iosize; in vnode_pager_addr()
551 err = VOP_BMAP(vp, vblock, NULL, rtaddress, run, NULL); in vnode_pager_addr()
571 struct vnode *vp; in vnode_pager_input_smlfs() local
581 vp = object->handle; in vnode_pager_input_smlfs()
582 if (VN_IS_DOOMED(vp)) in vnode_pager_input_smlfs()
585 bsize = vp->v_mount->mnt_stat.f_iosize; in vnode_pager_input_smlfs()
587 VOP_BMAP(vp, 0, &bo, 0, NULL, NULL); in vnode_pager_input_smlfs()
602 error = vnode_pager_addr(vp, address, &fileaddr, NULL); in vnode_pager_input_smlfs()
619 bp->b_vp = vp; in vnode_pager_input_smlfs()
669 struct vnode *vp; in vnode_pager_input_old() local
683 vp = object->handle; in vnode_pager_input_old()
702 error = VOP_READ(vp, &auio, 0, curthread->td_ucred); in vnode_pager_input_old()
738 struct vnode *vp; in vnode_pager_getpages() local
742 vp = object->handle; in vnode_pager_getpages()
743 rtval = VOP_GETPAGES(vp, m, count, rbehind, rahead); in vnode_pager_getpages()
753 struct vnode *vp; in vnode_pager_getpages_async() local
756 vp = object->handle; in vnode_pager_getpages_async()
757 rtval = VOP_GETPAGES_ASYNC(vp, m, count, rbehind, rahead, iodone, arg); in vnode_pager_getpages_async()
793 vnode_pager_generic_getpages(struct vnode *vp, vm_page_t *m, int count, in vnode_pager_generic_getpages() argument
807 KASSERT(vp->v_type != VCHR && vp->v_type != VBLK, in vnode_pager_generic_getpages()
810 if (VN_IS_DOOMED(vp)) in vnode_pager_generic_getpages()
813 object = vp->v_object; in vnode_pager_generic_getpages()
815 bsize = vp->v_mount->mnt_stat.f_iosize; in vnode_pager_generic_getpages()
819 ("%s: page %p offset beyond vp %p size", __func__, m[0], vp)); in vnode_pager_generic_getpages()
842 error = VOP_BMAP(vp, foff / bsize, &bo, &bp->b_blkno, &after, &before); in vnode_pager_generic_getpages()
883 count, vp)); in vnode_pager_generic_getpages()
1048 if ((vp->v_mount->mnt_kern_flag & MNTK_UNMAPPED_BUFS) != 0 && in vnode_pager_generic_getpages()
1064 bp->b_vp = vp; in vnode_pager_generic_getpages()
1214 struct vnode *vp; in vnode_pager_putpages() local
1235 vp = object->handle; in vnode_pager_putpages()
1237 rtval = VOP_PUTPAGES(vp, m, bytes, flags, rtvals); in vnode_pager_putpages()
1271 vnode_pager_generic_putpages(struct vnode *vp, vm_page_t *ma, int bytecount, in vnode_pager_generic_putpages() argument
1285 object = vp->v_object; in vnode_pager_generic_putpages()
1396 error = VOP_WRITE(vp, &auio, in vnode_pager_generic_putpages()
1402 vn_printf(vp, "vnode_pager_putpages: " in vnode_pager_generic_putpages()
1416 vn_printf(vp, "vnode_pager_putpages: I/O error %d\n", in vnode_pager_generic_putpages()
1420 vn_printf(vp, "vnode_pager_putpages: residual I/O %zd " in vnode_pager_generic_putpages()
1531 struct vnode *vp; in vnode_pager_update_writecount() local
1541 vp = object->handle; in vnode_pager_update_writecount()
1543 ASSERT_VOP_LOCKED(vp, "v_writecount inc"); in vnode_pager_update_writecount()
1544 VOP_ADD_WRITECOUNT_CHECKED(vp, 1); in vnode_pager_update_writecount()
1546 __func__, vp, vp->v_writecount); in vnode_pager_update_writecount()
1548 ASSERT_VOP_LOCKED(vp, "v_writecount dec"); in vnode_pager_update_writecount()
1549 VOP_ADD_WRITECOUNT_CHECKED(vp, -1); in vnode_pager_update_writecount()
1551 __func__, vp, vp->v_writecount); in vnode_pager_update_writecount()
1560 struct vnode *vp; in vnode_pager_release_writecount() local
1586 vp = object->handle; in vnode_pager_release_writecount()
1587 vhold(vp); in vnode_pager_release_writecount()
1590 vn_start_write(vp, &mp, V_WAIT); in vnode_pager_release_writecount()
1591 vn_lock(vp, LK_SHARED | LK_RETRY); in vnode_pager_release_writecount()
1600 VOP_UNLOCK(vp); in vnode_pager_release_writecount()
1601 vdrop(vp); in vnode_pager_release_writecount()