[BACK]Return to genfs_vnops.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / miscfs / genfs

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/miscfs/genfs/genfs_vnops.c between version 1.176.4.3 and 1.176.4.4

version 1.176.4.3, 2010/07/03 01:19:57 version 1.176.4.4, 2011/03/05 20:55:30
Line 64  __KERNEL_RCSID(0, "$NetBSD$");
Line 64  __KERNEL_RCSID(0, "$NetBSD$");
 #include <sys/proc.h>  #include <sys/proc.h>
 #include <sys/kernel.h>  #include <sys/kernel.h>
 #include <sys/mount.h>  #include <sys/mount.h>
   #include <sys/fstrans.h>
 #include <sys/namei.h>  #include <sys/namei.h>
 #include <sys/vnode.h>  #include <sys/vnode.h>
 #include <sys/fcntl.h>  #include <sys/fcntl.h>
Line 121  genfs_abortop(void *v)
Line 122  genfs_abortop(void *v)
                 struct componentname *a_cnp;                  struct componentname *a_cnp;
         } */ *ap = v;          } */ *ap = v;
   
         if ((ap->a_cnp->cn_flags & (HASBUF | SAVESTART)) == HASBUF)          (void)ap;
                 PNBUF_PUT(ap->a_cnp->cn_pnbuf);  
         return (0);          return (0);
 }  }
   
Line 188  genfs_eopnotsupp(void *v)
Line 189  genfs_eopnotsupp(void *v)
         KASSERT(desc->vdesc_offset != VOP_ABORTOP_DESCOFFSET);          KASSERT(desc->vdesc_offset != VOP_ABORTOP_DESCOFFSET);
   
         /*          /*
          * Free componentname that lookup potentially SAVENAMEd.           * Abort any componentname that lookup potentially left state in.
          *           *
          * As is logical, componentnames for VOP_RENAME are handled by           * As is logical, componentnames for VOP_RENAME are handled by
          * the caller of VOP_RENAME.  Yay, rename!           * the caller of VOP_RENAME.  Yay, rename!
Line 293  genfs_lock(void *v)
Line 294  genfs_lock(void *v)
         KASSERT((flags & ~(LK_EXCLUSIVE | LK_SHARED | LK_NOWAIT)) == 0);          KASSERT((flags & ~(LK_EXCLUSIVE | LK_SHARED | LK_NOWAIT)) == 0);
   
         op = ((flags & LK_EXCLUSIVE) != 0 ? RW_WRITER : RW_READER);          op = ((flags & LK_EXCLUSIVE) != 0 ? RW_WRITER : RW_READER);
           if ((flags & LK_NOWAIT) != 0) {
                   if (fstrans_start_nowait(vp->v_mount, FSTRANS_SHARED))
                           return EBUSY;
                   if (! rw_tryenter(&vp->v_lock, op)) {
                           fstrans_done(vp->v_mount);
                           return EBUSY;
                   }
                   return 0;
           }
   
         if ((flags & LK_NOWAIT) != 0)          fstrans_start(vp->v_mount, FSTRANS_SHARED);
                 return (rw_tryenter(&vp->v_lock, op) ? 0 : EBUSY);  
   
         rw_enter(&vp->v_lock, op);          rw_enter(&vp->v_lock, op);
   
         return 0;          return 0;
Line 314  genfs_unlock(void *v)
Line 322  genfs_unlock(void *v)
         struct vnode *vp = ap->a_vp;          struct vnode *vp = ap->a_vp;
   
         rw_exit(&vp->v_lock);          rw_exit(&vp->v_lock);
           fstrans_done(vp->v_mount);
   
         return 0;          return 0;
 }  }
Line 551  genfs_node_unlock(struct vnode *vp)
Line 560  genfs_node_unlock(struct vnode *vp)
         rw_exit(&gp->g_glock);          rw_exit(&gp->g_glock);
 }  }
   
   int
   genfs_node_wrlocked(struct vnode *vp)
   {
           struct genfs_node *gp = VTOG(vp);
   
           return rw_write_held(&gp->g_glock);
   }
   
 /*  /*
  * Do the usual access checking.   * Do the usual access checking.
  * file_mode, uid and gid are from the vnode in question,   * file_mode, uid and gid are from the vnode in question,

Legend:
Removed from v.1.176.4.3  
changed lines
  Added in v.1.176.4.4

CVSweb <webmaster@jp.NetBSD.org>