2 * Copyright (c) 1990 University of Utah.
3 * Copyright (c) 1991 The Regents of the University of California.
5 * Copyright (c) 1993, 1994 John S. Dyson
6 * Copyright (c) 1995, David Greenman
8 * This code is derived from software contributed to Berkeley by
9 * the Systems Programming Group of the University of Utah Computer
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
15 * 1. Redistributions of source code must retain the above copyright
16 * notice, this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above copyright
18 * notice, this list of conditions and the following disclaimer in the
19 * documentation and/or other materials provided with the distribution.
20 * 3. All advertising materials mentioning features or use of this software
21 * must display the following acknowledgement:
22 * This product includes software developed by the University of
23 * California, Berkeley and its contributors.
24 * 4. Neither the name of the University nor the names of its contributors
25 * may be used to endorse or promote products derived from this software
26 * without specific prior written permission.
28 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
29 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
30 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
31 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
32 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
37 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
40 * from: @(#)vnode_pager.c 7.5 (Berkeley) 4/20/91
45 * Page to/from files (vnodes).
50 * Implement VOP_GETPAGES/PUTPAGES interface for filesystems. Will
51 * greatly re-simplify the vnode_pager.
54 #include <sys/param.h>
55 #include <sys/systm.h>
57 #include <sys/vnode.h>
58 #include <sys/mount.h>
61 #include <sys/vmmeter.h>
65 #include <vm/vm_object.h>
66 #include <vm/vm_page.h>
67 #include <vm/vm_pager.h>
68 #include <vm/vm_map.h>
69 #include <vm/vnode_pager.h>
70 #include <vm/vm_extern.h>
72 static void vnode_pager_init __P((void));
73 static vm_offset_t vnode_pager_addr __P((struct vnode *vp, vm_ooffset_t address,
75 static void vnode_pager_iodone __P((struct buf *bp));
76 static int vnode_pager_input_smlfs __P((vm_object_t object, vm_page_t m));
77 static int vnode_pager_input_old __P((vm_object_t object, vm_page_t m));
78 static void vnode_pager_dealloc __P((vm_object_t));
79 static int vnode_pager_getpages __P((vm_object_t, vm_page_t *, int, int));
80 static void vnode_pager_putpages __P((vm_object_t, vm_page_t *, int, boolean_t, int *));
81 static boolean_t vnode_pager_haspage __P((vm_object_t, vm_pindex_t, int *, int *));
83 struct pagerops vnodepagerops = {
93 int vnode_pbuf_freecnt;
96 vnode_pager_init(void)
99 vnode_pbuf_freecnt = nswbuf / 2 + 1;
103 * Allocate (or lookup) pager for a vnode.
104 * Handle is a vnode pointer.
107 vnode_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot,
116 * Pageout to vnode, no can do yet.
121 vp = (struct vnode *) handle;
124 * Prevent race condition when allocating the object. This
125 * can happen with NFS vnodes since the nfsnode isn't locked.
127 while (vp->v_flag & VOLOCK) {
128 vp->v_flag |= VOWANT;
129 tsleep(vp, PVM, "vnpobj", 0);
131 vp->v_flag |= VOLOCK;
134 * If the object is being terminated, wait for it to
137 while (((object = vp->v_object) != NULL) &&
138 (object->flags & OBJ_DEAD)) {
139 tsleep(object, PVM, "vadead", 0);
142 if (vp->v_usecount == 0)
143 panic("vnode_pager_alloc: no vnode reference");
145 if (object == NULL) {
147 * And an object of the appropriate size
149 object = vm_object_allocate(OBJT_VNODE, OFF_TO_IDX(round_page(size)));
152 object->un_pager.vnp.vnp_size = size;
154 object->handle = handle;
155 vp->v_object = object;
162 vp->v_flag &= ~VOLOCK;
163 if (vp->v_flag & VOWANT) {
164 vp->v_flag &= ~VOWANT;
171 vnode_pager_dealloc(object)
174 struct vnode *vp = object->handle;
178 panic("vnode_pager_dealloc: pager already dealloced");
180 vm_object_pip_wait(object, "vnpdea");
182 object->handle = NULL;
183 object->type = OBJT_DEAD;
185 vp->v_flag &= ~(VTEXT | VOBJBUF);
189 vnode_pager_haspage(object, pindex, before, after)
195 struct vnode *vp = object->handle;
201 int pagesperblock, blocksperpage;
205 * If no vp or vp is doomed or marked transparent to VM, we do not
208 if ((vp == NULL) || (vp->v_flag & VDOOMED))
212 * If filesystem no longer mounted or offset beyond end of file we do
215 if ((vp->v_mount == NULL) ||
216 (IDX_TO_OFF(pindex) >= object->un_pager.vnp.vnp_size))
219 bsize = vp->v_mount->mnt_stat.f_iosize;
220 pagesperblock = bsize / PAGE_SIZE;
222 if (pagesperblock > 0) {
223 reqblock = pindex / pagesperblock;
225 blocksperpage = (PAGE_SIZE / bsize);
226 reqblock = pindex * blocksperpage;
228 err = VOP_BMAP(vp, reqblock, (struct vnode **) 0, &bn,
234 if (pagesperblock > 0) {
235 poff = pindex - (reqblock * pagesperblock);
237 *before *= pagesperblock;
242 *after *= pagesperblock;
243 numafter = pagesperblock - (poff + 1);
244 if (IDX_TO_OFF(pindex + numafter) > object->un_pager.vnp.vnp_size) {
245 numafter = OFF_TO_IDX((object->un_pager.vnp.vnp_size - IDX_TO_OFF(pindex)));
251 *before /= blocksperpage;
255 *after /= blocksperpage;
262 * Lets the VM system know about a change in size for a file.
263 * We adjust our own internal size and flush any cached pages in
264 * the associated object that are affected by the size change.
266 * Note: this routine may be invoked as a result of a pager put
267 * operation (possibly at object termination time), so we must be careful.
270 vnode_pager_setsize(vp, nsize)
274 vm_pindex_t nobjsize;
275 vm_object_t object = vp->v_object;
283 * Hasn't changed size
285 if (nsize == object->un_pager.vnp.vnp_size)
288 nobjsize = OFF_TO_IDX(nsize + PAGE_MASK);
291 * File has shrunk. Toss any cached pages beyond the new EOF.
293 if (nsize < object->un_pager.vnp.vnp_size) {
294 vm_freeze_copyopts(object, OFF_TO_IDX(nsize), object->size);
295 if (nobjsize < object->size) {
296 vm_object_page_remove(object, nobjsize, object->size,
300 * this gets rid of garbage at the end of a page that is now
301 * only partially backed by the vnode...
303 if (nsize & PAGE_MASK) {
307 m = vm_page_lookup(object, OFF_TO_IDX(nsize));
309 int base = (int)nsize & PAGE_MASK;
310 int size = PAGE_SIZE - base;
313 * Clear out partial-page garbage in case
314 * the page has been mapped.
316 kva = vm_pager_map_page(m);
317 bzero((caddr_t)kva + base, size);
318 vm_pager_unmap_page(kva);
321 * Clear out partial-page dirty bits. This
322 * has the side effect of setting the valid
323 * bits, but that is ok. There are a bunch
324 * of places in the VM system where we expected
325 * m->dirty == VM_PAGE_BITS_ALL. The file EOF
326 * case is one of them. If the page is still
327 * partially dirty, make it fully dirty.
329 vm_page_set_validclean(m, base, size);
331 m->dirty = VM_PAGE_BITS_ALL;
335 object->un_pager.vnp.vnp_size = nsize;
336 object->size = nobjsize;
340 * calculate the linear (byte) disk address of specified virtual
344 vnode_pager_addr(vp, address, run)
346 vm_ooffset_t address;
358 if ((int) address < 0)
361 if (vp->v_mount == NULL)
364 bsize = vp->v_mount->mnt_stat.f_iosize;
365 vblock = address / bsize;
366 voffset = address % bsize;
368 err = VOP_BMAP(vp, vblock, &rtvp, &block, run, NULL);
370 if (err || (block == -1))
373 rtaddress = block + voffset / DEV_BSIZE;
376 *run *= bsize/PAGE_SIZE;
377 *run -= voffset/PAGE_SIZE;
385 * interrupt routine for I/O completion
388 vnode_pager_iodone(bp)
391 bp->b_flags |= B_DONE;
396 * small block file system vnode pager input
399 vnode_pager_input_smlfs(object, m)
405 struct vnode *dp, *vp;
415 if (vp->v_mount == NULL)
418 bsize = vp->v_mount->mnt_stat.f_iosize;
420 VOP_BMAP(vp, 0, &dp, 0, NULL, NULL);
422 kva = vm_pager_map_page(m);
424 for (i = 0; i < PAGE_SIZE / bsize; i++) {
426 if (vm_page_bits(i * bsize, bsize) & m->valid)
429 fileaddr = vnode_pager_addr(vp,
430 IDX_TO_OFF(m->pindex) + i * bsize, (int *)0);
431 if (fileaddr != -1) {
432 bp = getpbuf(&vnode_pbuf_freecnt);
434 /* build a minimal buffer header */
435 bp->b_iocmd = BIO_READ;
436 bp->b_iodone = vnode_pager_iodone;
437 KASSERT(bp->b_rcred == NOCRED, ("leaking read ucred"));
438 KASSERT(bp->b_wcred == NOCRED, ("leaking write ucred"));
439 bp->b_rcred = crhold(curthread->td_proc->p_ucred);
440 bp->b_wcred = crhold(curthread->td_proc->p_ucred);
441 bp->b_data = (caddr_t) kva + i * bsize;
442 bp->b_blkno = fileaddr;
444 bp->b_bcount = bsize;
445 bp->b_bufsize = bsize;
446 bp->b_runningbufspace = bp->b_bufsize;
447 runningbufspace += bp->b_runningbufspace;
452 /* we definitely need to be at splvm here */
455 while ((bp->b_flags & B_DONE) == 0) {
456 tsleep(bp, PVM, "vnsrd", 0);
459 if ((bp->b_ioflags & BIO_ERROR) != 0)
463 * free the buffer header back to the swap buffer pool
465 relpbuf(bp, &vnode_pbuf_freecnt);
469 vm_page_set_validclean(m, (i * bsize) & PAGE_MASK, bsize);
471 vm_page_set_validclean(m, (i * bsize) & PAGE_MASK, bsize);
472 bzero((caddr_t) kva + i * bsize, bsize);
475 vm_pager_unmap_page(kva);
476 pmap_clear_modify(m);
477 vm_page_flag_clear(m, PG_ZERO);
479 return VM_PAGER_ERROR;
487 * old style vnode pager output routine
490 vnode_pager_input_old(object, m)
505 * Return failure if beyond current EOF
507 if (IDX_TO_OFF(m->pindex) >= object->un_pager.vnp.vnp_size) {
511 if (IDX_TO_OFF(m->pindex) + size > object->un_pager.vnp.vnp_size)
512 size = object->un_pager.vnp.vnp_size - IDX_TO_OFF(m->pindex);
515 * Allocate a kernel virtual address and initialize so that
516 * we can use VOP_READ/WRITE routines.
518 kva = vm_pager_map_page(m);
521 aiov.iov_base = (caddr_t) kva;
523 auio.uio_iov = &aiov;
525 auio.uio_offset = IDX_TO_OFF(m->pindex);
526 auio.uio_segflg = UIO_SYSSPACE;
527 auio.uio_rw = UIO_READ;
528 auio.uio_resid = size;
529 auio.uio_td = curthread;
531 error = VOP_READ(vp, &auio, 0, curthread->td_proc->p_ucred);
533 int count = size - auio.uio_resid;
537 else if (count != PAGE_SIZE)
538 bzero((caddr_t) kva + count, PAGE_SIZE - count);
540 vm_pager_unmap_page(kva);
542 pmap_clear_modify(m);
544 vm_page_flag_clear(m, PG_ZERO);
546 m->valid = VM_PAGE_BITS_ALL;
547 return error ? VM_PAGER_ERROR : VM_PAGER_OK;
551 * generic vnode pager input routine
555 * Local media VFS's that do not implement their own VOP_GETPAGES
556 * should have their VOP_GETPAGES should call to
557 * vnode_pager_generic_getpages() to implement the previous behaviour.
559 * All other FS's should use the bypass to get to the local media
560 * backing vp's VOP_GETPAGES.
563 vnode_pager_getpages(object, m, count, reqpage)
571 int bytes = count * PAGE_SIZE;
575 rtval = VOP_GETPAGES(vp, m, bytes, reqpage, 0);
576 KASSERT(rtval != EOPNOTSUPP,
577 ("vnode_pager: FS getpages not implemented\n"));
583 * This is now called from local media FS's to operate against their
584 * own vnodes if they fail to implement VOP_GETPAGES.
587 vnode_pager_generic_getpages(vp, m, bytecount, reqpage)
595 off_t foff, tfoff, nextoff;
596 int i, size, bsize, first, firstaddr;
606 object = vp->v_object;
607 count = bytecount / PAGE_SIZE;
609 if (vp->v_mount == NULL)
612 bsize = vp->v_mount->mnt_stat.f_iosize;
614 /* get the UNDERLYING device for the file with VOP_BMAP() */
617 * originally, we did not check for an error return value -- assuming
618 * an fs always has a bmap entry point -- that assumption is wrong!!!
620 foff = IDX_TO_OFF(m[reqpage]->pindex);
623 * if we can't bmap, use old VOP code
625 if (VOP_BMAP(vp, 0, &dp, 0, NULL, NULL)) {
626 for (i = 0; i < count; i++) {
633 return vnode_pager_input_old(object, m[reqpage]);
636 * if the blocksize is smaller than a page size, then use
637 * special small filesystem code. NFS sometimes has a small
638 * blocksize, but it can handle large reads itself.
640 } else if ((PAGE_SIZE / bsize) > 1 &&
641 (vp->v_mount->mnt_stat.f_type != nfs_mount_type)) {
642 for (i = 0; i < count; i++) {
649 return vnode_pager_input_smlfs(object, m[reqpage]);
653 * If we have a completely valid page available to us, we can
654 * clean up and return. Otherwise we have to re-read the
658 if (m[reqpage]->valid == VM_PAGE_BITS_ALL) {
659 for (i = 0; i < count; i++) {
665 m[reqpage]->valid = 0;
668 * here on direct device I/O
673 * calculate the run that includes the required page
675 for(first = 0, i = 0; i < count; i = runend) {
676 firstaddr = vnode_pager_addr(vp,
677 IDX_TO_OFF(m[i]->pindex), &runpg);
678 if (firstaddr == -1) {
679 if (i == reqpage && foff < object->un_pager.vnp.vnp_size) {
680 /* XXX no %qd in kernel. */
681 panic("vnode_pager_getpages: unexpected missing page: firstaddr: %d, foff: 0x%lx%08lx, vnp_size: 0x%lx%08lx",
682 firstaddr, (u_long)(foff >> 32),
683 (u_long)(u_int32_t)foff,
685 (object->un_pager.vnp.vnp_size >> 32),
687 object->un_pager.vnp.vnp_size);
695 if (runend <= reqpage) {
697 for (j = i; j < runend; j++) {
701 if (runpg < (count - first)) {
702 for (i = first + runpg; i < count; i++)
704 count = first + runpg;
712 * the first and last page have been calculated now, move input pages
713 * to be zero based...
716 for (i = first; i < count; i++) {
724 * calculate the file virtual address for the transfer
726 foff = IDX_TO_OFF(m[0]->pindex);
729 * calculate the size of the transfer
731 size = count * PAGE_SIZE;
732 if ((foff + size) > object->un_pager.vnp.vnp_size)
733 size = object->un_pager.vnp.vnp_size - foff;
736 * round up physical size for real devices.
738 if (dp->v_type == VBLK || dp->v_type == VCHR) {
739 int secmask = dp->v_rdev->si_bsize_phys - 1;
740 KASSERT(secmask < PAGE_SIZE, ("vnode_pager_generic_getpages: sector size %d too large\n", secmask + 1));
741 size = (size + secmask) & ~secmask;
744 bp = getpbuf(&vnode_pbuf_freecnt);
745 kva = (vm_offset_t) bp->b_data;
748 * and map the pages to be read into the kva
750 pmap_qenter(kva, m, count);
752 /* build a minimal buffer header */
753 bp->b_iocmd = BIO_READ;
754 bp->b_iodone = vnode_pager_iodone;
755 /* B_PHYS is not set, but it is nice to fill this in */
756 KASSERT(bp->b_rcred == NOCRED, ("leaking read ucred"));
757 KASSERT(bp->b_wcred == NOCRED, ("leaking write ucred"));
758 bp->b_rcred = crhold(curthread->td_proc->p_ucred);
759 bp->b_wcred = crhold(curthread->td_proc->p_ucred);
760 bp->b_blkno = firstaddr;
763 bp->b_bufsize = size;
764 bp->b_runningbufspace = bp->b_bufsize;
765 runningbufspace += bp->b_runningbufspace;
768 cnt.v_vnodepgsin += count;
774 /* we definitely need to be at splvm here */
776 while ((bp->b_flags & B_DONE) == 0) {
777 tsleep(bp, PVM, "vnread", 0);
780 if ((bp->b_ioflags & BIO_ERROR) != 0)
784 if (size != count * PAGE_SIZE)
785 bzero((caddr_t) kva + size, PAGE_SIZE * count - size);
787 pmap_qremove(kva, count);
790 * free the buffer header back to the swap buffer pool
792 relpbuf(bp, &vnode_pbuf_freecnt);
794 for (i = 0, tfoff = foff; i < count; i++, tfoff = nextoff) {
797 nextoff = tfoff + PAGE_SIZE;
800 if (nextoff <= object->un_pager.vnp.vnp_size) {
802 * Read filled up entire page.
804 mt->valid = VM_PAGE_BITS_ALL;
805 vm_page_undirty(mt); /* should be an assert? XXX */
806 pmap_clear_modify(mt);
809 * Read did not fill up entire page. Since this
810 * is getpages, the page may be mapped, so we have
811 * to zero the invalid portions of the page even
812 * though we aren't setting them valid.
814 * Currently we do not set the entire page valid,
815 * we just try to clear the piece that we couldn't
818 vm_page_set_validclean(mt, 0,
819 object->un_pager.vnp.vnp_size - tfoff);
820 /* handled by vm_fault now */
821 /* vm_page_zero_invalid(mt, FALSE); */
824 vm_page_flag_clear(mt, PG_ZERO);
828 * whether or not to leave the page activated is up in
829 * the air, but we should put the page on a page queue
830 * somewhere. (it already is in the object). Result:
831 * It appears that empirical results show that
832 * deactivating pages is best.
836 * just in case someone was asking for this page we
837 * now tell them that it is ok to use
840 if (mt->flags & PG_WANTED)
841 vm_page_activate(mt);
843 vm_page_deactivate(mt);
851 printf("vnode_pager_getpages: I/O read error\n");
853 return (error ? VM_PAGER_ERROR : VM_PAGER_OK);
857 * EOPNOTSUPP is no longer legal. For local media VFS's that do not
858 * implement their own VOP_PUTPAGES, their VOP_PUTPAGES should call to
859 * vnode_pager_generic_putpages() to implement the previous behaviour.
861 * All other FS's should use the bypass to get to the local media
862 * backing vp's VOP_PUTPAGES.
865 vnode_pager_putpages(object, m, count, sync, rtvals)
875 int bytes = count * PAGE_SIZE;
879 * Force synchronous operation if we are extremely low on memory
880 * to prevent a low-memory deadlock. VOP operations often need to
881 * allocate more memory to initiate the I/O ( i.e. do a BMAP
882 * operation ). The swapper handles the case by limiting the amount
883 * of asynchronous I/O, but that sort of solution doesn't scale well
884 * for the vnode pager without a lot of work.
886 * Also, the backing vnode's iodone routine may not wake the pageout
887 * daemon up. This should be probably be addressed XXX.
890 if ((cnt.v_free_count + cnt.v_cache_count) < cnt.v_pageout_free_min)
894 * Call device-specific putpages function
898 if (vp->v_type != VREG)
900 (void)vn_start_write(vp, &mp, V_WAIT);
901 rtval = VOP_PUTPAGES(vp, m, bytes, sync, rtvals, 0);
902 KASSERT(rtval != EOPNOTSUPP,
903 ("vnode_pager: stale FS putpages\n"));
904 vn_finished_write(mp);
909 * This is now called from local media FS's to operate against their
910 * own vnodes if they fail to implement VOP_PUTPAGES.
912 * This is typically called indirectly via the pageout daemon and
913 * clustering has already typically occured, so in general we ask the
914 * underlying filesystem to write the data out asynchronously rather
918 vnode_pager_generic_putpages(vp, m, bytecount, flags, rtvals)
930 vm_ooffset_t poffset;
937 object = vp->v_object;
938 count = bytecount / PAGE_SIZE;
940 for (i = 0; i < count; i++)
941 rtvals[i] = VM_PAGER_AGAIN;
943 if ((int) m[0]->pindex < 0) {
944 printf("vnode_pager_putpages: attempt to write meta-data!!! -- 0x%lx(%x)\n",
945 (long)m[0]->pindex, m[0]->dirty);
946 rtvals[0] = VM_PAGER_BAD;
950 maxsize = count * PAGE_SIZE;
953 poffset = IDX_TO_OFF(m[0]->pindex);
954 if (maxsize + poffset > object->un_pager.vnp.vnp_size) {
955 if (object->un_pager.vnp.vnp_size > poffset)
956 maxsize = object->un_pager.vnp.vnp_size - poffset;
959 ncount = btoc(maxsize);
960 if (ncount < count) {
961 for (i = ncount; i < count; i++) {
962 rtvals[i] = VM_PAGER_BAD;
968 * pageouts are already clustered, use IO_ASYNC t o force a bawrite()
969 * rather then a bdwrite() to prevent paging I/O from saturating
973 ioflags |= (flags & (VM_PAGER_PUT_SYNC | VM_PAGER_PUT_INVAL)) ? IO_SYNC: IO_ASYNC;
974 ioflags |= (flags & VM_PAGER_PUT_INVAL) ? IO_INVAL: 0;
976 aiov.iov_base = (caddr_t) 0;
977 aiov.iov_len = maxsize;
978 auio.uio_iov = &aiov;
980 auio.uio_offset = poffset;
981 auio.uio_segflg = UIO_NOCOPY;
982 auio.uio_rw = UIO_WRITE;
983 auio.uio_resid = maxsize;
984 auio.uio_td = (struct thread *) 0;
985 error = VOP_WRITE(vp, &auio, ioflags, curthread->td_proc->p_ucred);
987 cnt.v_vnodepgsout += ncount;
990 printf("vnode_pager_putpages: I/O error %d\n", error);
992 if (auio.uio_resid) {
993 printf("vnode_pager_putpages: residual I/O %d at %lu\n",
994 auio.uio_resid, (u_long)m[0]->pindex);
996 for (i = 0; i < ncount; i++) {
997 rtvals[i] = VM_PAGER_OK;
1003 vnode_pager_lock(object)
1006 struct thread *td = curthread; /* XXX */
1010 for (; object != NULL; object = object->backing_object) {
1011 if (object->type != OBJT_VNODE)
1013 if (object->flags & OBJ_DEAD) {
1017 /* XXX; If object->handle can change, we need to cache it. */
1018 while (vget(object->handle,
1019 LK_NOPAUSE | LK_SHARED | LK_RETRY | LK_CANRECURSE, td)){
1020 if ((object->flags & OBJ_DEAD) || (object->type != OBJT_VNODE))
1022 printf("vnode_pager_lock: retrying\n");
1024 return object->handle;