Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/isofs/cd9660 Adapt to cache_lookup() changes (forgot to ...



details:   https://anonhg.NetBSD.org/src/rev/52e039cf7d57
branches:  trunk
changeset: 476103:52e039cf7d57
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Mon Sep 06 10:10:05 1999 +0000

description:
Adapt to cache_lookup() changes (forgot to commit it yesterday)

diffstat:

 sys/isofs/cd9660/cd9660_lookup.c |  61 +--------------------------------------
 1 files changed, 3 insertions(+), 58 deletions(-)

diffs (75 lines):

diff -r 43ec67d8d19a -r 52e039cf7d57 sys/isofs/cd9660/cd9660_lookup.c
--- a/sys/isofs/cd9660/cd9660_lookup.c  Mon Sep 06 09:37:29 1999 +0000
+++ b/sys/isofs/cd9660/cd9660_lookup.c  Mon Sep 06 10:10:05 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cd9660_lookup.c,v 1.24 1999/08/04 18:40:47 wrstuden Exp $      */
+/*     $NetBSD: cd9660_lookup.c,v 1.25 1999/09/06 10:10:05 jdolecek Exp $      */
 
 /*-
  * Copyright (c) 1989, 1993, 1994
@@ -159,63 +159,8 @@
         * check the name cache to see if the directory/name pair
         * we are looking for is known already.
         */
-       if ((error = cache_lookup(vdp, vpp, cnp)) != 0) {
-               int vpid;       /* capability number of vnode */
-
-               if (error == ENOENT)
-                       return (error);
-#ifdef PARANOID
-               if ((vdp->v_flag & VROOT) && (flags & ISDOTDOT))
-                       panic("cd9660_lookup: .. through root");
-#endif
-               /*
-                * Get the next vnode in the path.
-                * See comment below starting `Step through' for
-                * an explaination of the locking protocol.
-                */
-               pdp = vdp;
-               dp = VTOI(*vpp);
-               vdp = *vpp;
-               vpid = vdp->v_id;
-               if (pdp == vdp) {
-                       VREF(vdp);
-                       error = 0;
-               } else if (flags & ISDOTDOT) {
-                       VOP_UNLOCK(pdp, 0);
-                       cnp->cn_flags |= PDIRUNLOCK;
-                       error = vget(vdp, LK_EXCLUSIVE);
-                       if (!error && lockparent && (flags & ISLASTCN)) {
-                               error = vn_lock(pdp, LK_EXCLUSIVE);
-                               if (error == 0)
-                                       cnp->cn_flags &= ~PDIRUNLOCK;
-                       }
-               } else {
-                       error = vget(vdp, LK_EXCLUSIVE);
-                       if (!lockparent || error || !(flags & ISLASTCN)) {
-                               VOP_UNLOCK(pdp, 0);
-                               cnp->cn_flags |= PDIRUNLOCK;
-                       }
-               }
-               /*
-                * Check that the capability number did not change
-                * while we were waiting for the lock.
-                */
-               if (!error) {
-                       if (vpid == vdp->v_id)
-                               return (0);
-                       vput(vdp);
-                       if (lockparent && pdp != vdp && (flags & ISLASTCN)) {
-                               VOP_UNLOCK(pdp, 0);
-                               cnp->cn_flags |= PDIRUNLOCK;
-                       }
-               }
-               if ((error = vn_lock(pdp, LK_EXCLUSIVE)) != 0)
-                       return (error);
-               cnp->cn_flags &= ~PDIRUNLOCK;
-               vdp = pdp;
-               dp = VTOI(pdp);
-               *vpp = NULL;
-       }
+       if ((error = cache_lookup(vdp, vpp, cnp)) >= 0)
+               return (error);
        
        len = cnp->cn_namelen;
        name = cnp->cn_nameptr;



Home | Main Index | Thread Index | Old Index