[BACK]Return to ufs_lookup.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / ufs / ufs

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

Diff for /src/sys/ufs/ufs/ufs_lookup.c between version 1.117 and 1.117.2.1

version 1.117, 2012/07/22 00:53:22 version 1.117.2.1, 2012/11/20 03:02:53
Line 153  ufs_lookup(void *v)
Line 153  ufs_lookup(void *v)
         int dirblksiz = ump->um_dirblksiz;          int dirblksiz = ump->um_dirblksiz;
         ino_t foundino;          ino_t foundino;
         struct ufs_lookup_results *results;          struct ufs_lookup_results *results;
           int iswhiteout;                 /* temp result from cache_lookup() */
   
         flags = cnp->cn_flags;          flags = cnp->cn_flags;
   
Line 186  ufs_lookup(void *v)
Line 187  ufs_lookup(void *v)
          * check the name cache to see if the directory/name pair           * check the name cache to see if the directory/name pair
          * we are looking for is known already.           * we are looking for is known already.
          */           */
         if ((error = cache_lookup(vdp, vpp, cnp)) >= 0) {          if (cache_lookup(vdp, cnp->cn_nameptr, cnp->cn_namelen,
                 return (error);                           cnp->cn_nameiop, cnp->cn_flags, &iswhiteout, vpp)) {
                   if (iswhiteout) {
                           cnp->cn_flags |= ISWHITEOUT;
                   }
                   return *vpp == NULLVP ? ENOENT : 0;
           }
           if (iswhiteout) {
                   /*
                    * The namecache set iswhiteout without finding a
                    * cache entry. As of this writing (20121014), this
                    * can happen if there was a whiteout entry that has
                    * been invalidated by the lookup. It is not clear if
                    * it is correct to set ISWHITEOUT in this case or
                    * not; however, doing so retains the prior behavior,
                    * so we'll go with that until some clearer answer
                    * appears. XXX
                    */
                   cnp->cn_flags |= ISWHITEOUT;
         }          }
   
         fstrans_start(vdp->v_mount, FSTRANS_SHARED);          fstrans_start(vdp->v_mount, FSTRANS_SHARED);
Line 497  notfound:
Line 515  notfound:
          * Insert name into cache (as non-existent) if appropriate.           * Insert name into cache (as non-existent) if appropriate.
          */           */
         if (nameiop != CREATE) {          if (nameiop != CREATE) {
                 cache_enter(vdp, *vpp, cnp);                  cache_enter(vdp, *vpp, cnp->cn_nameptr, cnp->cn_namelen,
                               cnp->cn_flags);
         }          }
         error = ENOENT;          error = ENOENT;
         goto out;          goto out;
Line 661  found:
Line 680  found:
         /*          /*
          * Insert name into cache if appropriate.           * Insert name into cache if appropriate.
          */           */
         cache_enter(vdp, *vpp, cnp);          cache_enter(vdp, *vpp, cnp->cn_nameptr, cnp->cn_namelen, cnp->cn_flags);
         error = 0;          error = 0;
   
 out:  out:
Line 1115  out:
Line 1134  out:
                 ip->i_flag |= IN_CHANGE;                  ip->i_flag |= IN_CHANGE;
                 UFS_WAPBL_UPDATE(ITOV(ip), NULL, NULL, 0);                  UFS_WAPBL_UPDATE(ITOV(ip), NULL, NULL, 0);
         }          }
           /*
            * XXX did it ever occur to anyone that it might be a good
            * idea to restore ip->i_nlink if this fails? Or something?
            * Currently on error return from this function the state of
            * ip->i_nlink depends on what happened, and callers
            * definitely do not take this into account.
            */
         error = VOP_BWRITE(bp->b_vp, bp);          error = VOP_BWRITE(bp->b_vp, bp);
         dp->i_flag |= IN_CHANGE | IN_UPDATE;          dp->i_flag |= IN_CHANGE | IN_UPDATE;
         /*          /*

Legend:
Removed from v.1.117  
changed lines
  Added in v.1.117.2.1

CVSweb <webmaster@jp.NetBSD.org>