Lines Matching refs:vp

82 static int vnode_pager_addr(struct vnode *vp, vm_ooffset_t address,
111 vnode_create_vobject(struct vnode *vp, off_t isize, struct thread *td)
117 if (!vn_isdisk(vp, NULL) && vn_canvmio(vp) == FALSE)
120 while ((object = vp->v_object) != NULL) {
126 VOP_UNLOCK(vp, 0);
129 vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
133 if (vn_isdisk(vp, NULL)) {
136 if (VOP_GETATTR(vp, &va, td->td_ucred))
142 object = vnode_pager_alloc(vp, size, 0, 0, td->td_ucred);
145 * that the object is associated with the vp.
150 vrele(vp);
152 KASSERT(vp->v_object != NULL, ("vnode_create_vobject: NULL object"));
158 vnode_destroy_vobject(struct vnode *vp)
162 obj = vp->v_object;
165 ASSERT_VOP_ELOCKED(vp, "vnode_destroy_vobject");
184 vp->v_object = NULL;
194 KASSERT(vp->v_object == NULL, ("vp %p obj %p", vp, vp->v_object));
209 struct vnode *vp;
217 vp = (struct vnode *) handle;
224 while ((object = vp->v_object) != NULL) {
232 KASSERT(vp->v_usecount != 0, ("vnode_pager_alloc: no vnode reference"));
244 VI_LOCK(vp);
245 if (vp->v_object != NULL) {
249 VI_UNLOCK(vp);
259 vp->v_object = object;
260 VI_UNLOCK(vp);
268 vref(vp);
278 struct vnode *vp;
281 vp = object->handle;
282 if (vp == NULL)
295 ASSERT_VOP_ELOCKED(vp, "vnode_pager_dealloc");
298 VOP_ADD_WRITECOUNT(vp, -1);
299 CTR3(KTR_VFS, "%s: vp %p v_writecount decreased to %d",
300 __func__, vp, vp->v_writecount);
302 vp->v_object = NULL;
303 VOP_UNSET_TEXT(vp);
306 vunref(vp);
314 struct vnode *vp = object->handle;
324 * If no vp or vp is doomed or marked transparent to VM, we do not
327 if (vp == NULL || vp->v_iflag & VI_DOOMED)
336 bsize = vp->v_mount->mnt_stat.f_iosize;
346 err = VOP_BMAP(vp, reqblock, NULL, &bn, after, before);
396 vnode_pager_setsize(struct vnode *vp, vm_ooffset_t nsize)
402 if ((object = vp->v_object) == NULL)
404 /* ASSERT_VOP_ELOCKED(vp, "vnode_pager_setsize and not locked vnode"); */
485 vnode_pager_addr(struct vnode *vp, vm_ooffset_t address, daddr_t *rtaddress,
496 if (vp->v_iflag & VI_DOOMED)
499 bsize = vp->v_mount->mnt_stat.f_iosize;
503 err = VOP_BMAP(vp, vblock, NULL, rtaddress, run, NULL);
523 struct vnode *vp;
533 vp = object->handle;
534 if (vp->v_iflag & VI_DOOMED)
537 bsize = vp->v_mount->mnt_stat.f_iosize;
539 VOP_BMAP(vp, 0, &bo, 0, NULL, NULL);
554 error = vnode_pager_addr(vp, address, &fileaddr, NULL);
571 bp->b_vp = vp;
620 struct vnode *vp;
634 vp = object->handle;
653 error = VOP_READ(vp, &auio, 0, curthread->td_ucred);
683 * backing vp's VOP_GETPAGES.
689 struct vnode *vp;
692 vp = object->handle;
694 rtval = VOP_GETPAGES(vp, m, count, rbehind, rahead);
705 struct vnode *vp;
708 vp = object->handle;
710 rtval = VOP_GETPAGES_ASYNC(vp, m, count, rbehind, rahead, iodone, arg);
743 vnode_pager_generic_getpages(struct vnode *vp, vm_page_t *m, int count,
754 KASSERT(vp->v_type != VCHR && vp->v_type != VBLK,
757 if (vp->v_iflag & VI_DOOMED)
760 object = vp->v_object;
762 bsize = vp->v_mount->mnt_stat.f_iosize;
766 ("%s: page %p offset beyond vp %p size", __func__, m[0], vp));
798 error = VOP_BMAP(vp, foff / bsize, &bo, &bp->b_blkno, &after, &before);
839 count, vp));
977 if ((vp->v_mount->mnt_kern_flag & MNTK_UNMAPPED_BUFS) != 0 &&
993 bp->b_vp = vp;
1111 * backing vp's VOP_PUTPAGES.
1118 struct vnode *vp;
1140 vp = object->handle;
1142 rtval = VOP_PUTPAGES(vp, m, bytes, flags, rtvals);
1159 vnode_pager_generic_putpages(struct vnode *vp, vm_page_t *ma, int bytecount,
1177 object = vp->v_object;
1264 error = VOP_WRITE(vp, &auio, ioflags, curthread->td_ucred);
1310 struct vnode *vp;
1320 vp = object->handle;
1322 ASSERT_VOP_ELOCKED(vp, "v_writecount inc");
1323 VOP_ADD_WRITECOUNT(vp, 1);
1324 CTR3(KTR_VFS, "%s: vp %p v_writecount increased to %d",
1325 __func__, vp, vp->v_writecount);
1327 ASSERT_VOP_ELOCKED(vp, "v_writecount dec");
1328 VOP_ADD_WRITECOUNT(vp, -1);
1329 CTR3(KTR_VFS, "%s: vp %p v_writecount decreased to %d",
1330 __func__, vp, vp->v_writecount);
1339 struct vnode *vp;
1365 vp = object->handle;
1366 vhold(vp);
1369 vn_start_write(vp, &mp, V_WAIT);
1370 vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
1379 VOP_UNLOCK(vp, 0);
1380 vdrop(vp);