Deleted Added
full compact
39c39
< * $Id: vfs_subr.c,v 1.57 1996/07/30 18:00:25 bde Exp $
---
> * $Id: vfs_subr.c,v 1.58 1996/08/15 06:45:01 dyson Exp $
67a68,69
> #include <vm/vm_pager.h>
> #include <vm/vnode_pager.h>
479a482,483
>
> s = splbio();
495d498
< s = splbio();
508d510
< splx(s);
522a525
> splx(s);
641d643
< register struct buflists *listheadp;
673,674c675
< listheadp = &newvp->v_cleanblkhd;
< bufinsvn(bp, listheadp);
---
> bufinsvn(bp, &newvp->v_cleanblkhd);
747a749
>
806a809,817
>
> /*
> * Create the VM object, if needed
> */
> if ((vp->v_type == VREG) &&
> ((vp->v_object == NULL) ||
> (vp->v_object->flags & OBJ_VFS_REF) == 0)) {
> vfs_object_create(vp, curproc, curproc->p_ucred, 0);
> }
808a820
>
819d830
<
821a833,845
>
> if ((vp->v_type == VREG) &&
> ((vp->v_object == NULL) ||
> ((vp->v_object->flags & OBJ_VFS_REF) == 0)) ) {
> /*
> * We need to lock to VP during the time that
> * the object is created. This is necessary to
> * keep the system from re-entrantly doing it
> * multiple times.
> */
> vfs_object_create(vp, curproc, curproc->p_ucred, 0);
> }
>
832d855
<
849a873
>
850a875,883
>
> if ((vp->v_usecount == 1) &&
> vp->v_object &&
> (vp->v_object->flags & OBJ_VFS_REF)) {
> vp->v_object->flags &= ~OBJ_VFS_REF;
> vm_object_deallocate(vp->v_object);
> return;
> }
>
853c886,887
< if (vp->v_usecount < 0 /* || vp->v_writecount < 0 */ ) {
---
>
> if (vp->v_usecount < 0) {
946a981,985
>
> if ((vp->v_usecount == 1) && vp->v_object) {
> pager_cache(vp->v_object, FALSE);
> }
>
1549c1588
< (((vm_object_t) vp->v_object)->flags & OBJ_MIGHTBEDIRTY)) {
---
> (vp->v_object->flags & OBJ_MIGHTBEDIRTY)) {
1553a1593,1646
>
> /*
> * Create the VM object needed for VMIO and mmap support. This
> * is done for all VREG files in the system. Some filesystems might
> * afford the additional metadata buffering capability of the
> * VMIO code by making the device node be VMIO mode also.
> */
> int
> vfs_object_create(vp, p, cred, waslocked)
> struct vnode *vp;
> struct proc *p;
> struct ucred *cred;
> int waslocked;
> {
> struct vattr vat;
> vm_object_t object;
> int error = 0;
>
> retry:
> if ((object = vp->v_object) == NULL) {
> if (vp->v_type == VREG) {
> if ((error = VOP_GETATTR(vp, &vat, cred, p)) != 0)
> goto retn;
> (void) vnode_pager_alloc(vp,
> OFF_TO_IDX(round_page(vat.va_size)), 0, 0);
> } else {
> /*
> * This simply allocates the biggest object possible
> * for a VBLK vnode. This should be fixed, but doesn't
> * cause any problems (yet).
> */
> (void) vnode_pager_alloc(vp, INT_MAX, 0, 0);
> }
> vp->v_object->flags |= OBJ_VFS_REF;
> } else {
> if (object->flags & OBJ_DEAD) {
> if (waslocked)
> VOP_UNLOCK(vp);
> tsleep(object, PVM, "vodead", 0);
> if (waslocked)
> VOP_LOCK(vp);
> goto retry;
> }
> if ((object->flags & OBJ_VFS_REF) == 0) {
> object->flags |= OBJ_VFS_REF;
> vm_object_reference(object);
> }
> }
> if (vp->v_object)
> vp->v_flag |= VVMIO;
>
> retn:
> return error;
> }