[BACK]Return to ptyfs_vnops.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / fs / ptyfs

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

Diff for /src/sys/fs/ptyfs/ptyfs_vnops.c between version 1.16.6.2 and 1.17

version 1.16.6.2, 2006/12/10 07:18:38 version 1.17, 2006/10/12 01:32:14
Line 553  ptyfs_access(void *v)
Line 553  ptyfs_access(void *v)
  * If we're looking up ".", just vref the parent & return it.   * If we're looking up ".", just vref the parent & return it.
  *   *
  * If we're looking up "..", unlock the parent, and lock "..". If everything   * If we're looking up "..", unlock the parent, and lock "..". If everything
  * went ok, try to re-lock the parent. We do this to prevent lock races.   * went ok, and we're on the last component and the caller requested the
    * parent locked, try to re-lock the parent. We do this to prevent lock
    * races.
  *   *
  * For anything else, get the needed node.   * For anything else, get the needed node. Then unlock the parent if not
    * the last component or not LOCKPARENT (i.e. if we wouldn't re-lock the
    * parent in the .. case).
  *   *
  * We try to exit with the parent locked in error cases.   * We try to exit with the parent locked in error cases.
  */   */
Line 572  ptyfs_lookup(void *v)
Line 576  ptyfs_lookup(void *v)
         struct vnode *dvp = ap->a_dvp;          struct vnode *dvp = ap->a_dvp;
         const char *pname = cnp->cn_nameptr;          const char *pname = cnp->cn_nameptr;
         struct ptyfsnode *ptyfs;          struct ptyfsnode *ptyfs;
         int pty, error;          int pty, error, wantpunlock;
   
         *vpp = NULL;          *vpp = NULL;
           cnp->cn_flags &= ~PDIRUNLOCK;
   
         if (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME)          if (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME)
                 return EROFS;                  return EROFS;
Line 585  ptyfs_lookup(void *v)
Line 590  ptyfs_lookup(void *v)
                 return 0;                  return 0;
         }          }
   
           wantpunlock = ~cnp->cn_flags & (LOCKPARENT | ISLASTCN);
         ptyfs = VTOPTYFS(dvp);          ptyfs = VTOPTYFS(dvp);
         switch (ptyfs->ptyfs_type) {          switch (ptyfs->ptyfs_type) {
         case PTYFSroot:          case PTYFSroot:
Line 601  ptyfs_lookup(void *v)
Line 607  ptyfs_lookup(void *v)
   
                 error = ptyfs_allocvp(dvp->v_mount, vpp, PTYFSpts, pty,                  error = ptyfs_allocvp(dvp->v_mount, vpp, PTYFSpts, pty,
                     curlwp);                      curlwp);
                   if (error == 0 && wantpunlock) {
                           VOP_UNLOCK(dvp, 0);
                           cnp->cn_flags |= PDIRUNLOCK;
                   }
                 return error;                  return error;
   
         default:          default:
Line 921  ptyfs_kqfilter(void *v)
Line 931  ptyfs_kqfilter(void *v)
   
 static int  static int
 ptyfs_update(struct vnode *vp, const struct timespec *acc,  ptyfs_update(struct vnode *vp, const struct timespec *acc,
     const struct timespec *mod, int flags)      const struct timespec *mod, int flags __unused)
 {  {
         struct ptyfsnode *ptyfs = VTOPTYFS(vp);          struct ptyfsnode *ptyfs = VTOPTYFS(vp);
   

Legend:
Removed from v.1.16.6.2  
changed lines
  Added in v.1.17

CVSweb <webmaster@jp.NetBSD.org>