Source-Changes archive

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

Re: CVS commit: src/sys/miscfs/kernfs



itojun%itojun.org@localhost (Jun-ichiro itojun Hagino) writes:

>       ooops.  i'll look into it.

You need to test struct kern_target * to identify the node.

enami.

Index: kernfs_subr.c
===================================================================
RCS file: /cvsroot/src/sys/miscfs/kernfs/kernfs_subr.c,v
retrieving revision 1.1
diff -u -r1.1 kernfs_subr.c
--- kernfs_subr.c       8 Sep 2003 06:51:53 -0000       1.1
+++ kernfs_subr.c       10 Sep 2003 02:19:11 -0000
@@ -104,7 +104,8 @@
 
 void kernfs_hashins __P((struct kernfs_node *));
 void kernfs_hashrem __P((struct kernfs_node *));
-struct vnode *kernfs_hashget __P((kfstype, struct mount *, u_int32_t));
+struct vnode *kernfs_hashget __P((kfstype, struct mount *,
+    const struct kern_target *, u_int32_t));
 
 static LIST_HEAD(kfs_hashhead, kernfs_node) *kfs_hashtbl;
 static u_long  kfs_ihash;      /* size of hash table - 1 */
@@ -155,7 +156,7 @@
        long *cookie;
 
        do {
-               if ((*vpp = kernfs_hashget(kfs_type, mp, value)) != NULL)
+               if ((*vpp = kernfs_hashget(kfs_type, mp, kt, value)) != NULL)
                        return (0);
        } while (lockmgr(&kfs_hashlock, LK_EXCLUSIVE|LK_SLEEPFAIL, 0));
 
@@ -335,9 +336,10 @@
 }
 
 struct vnode *
-kernfs_hashget(type, mp, value)
+kernfs_hashget(type, mp, kt, value)
        kfstype type;
        struct mount *mp;
+       const struct kern_target *kt;
        u_int32_t value;
 {
        struct kfs_hashhead *ppp;
@@ -350,7 +352,7 @@
        LIST_FOREACH(pp, ppp, kfs_hash) {
                vp = KERNFSTOV(pp);
                if (pp->kfs_type == type && vp->v_mount == mp &&
-                   pp->kfs_value == value) {
+                   pp->kfs_kt == kt && pp->kfs_value == value) {
                        simple_lock(&vp->v_interlock);
                        simple_unlock(&kfs_hash_slock);
                        if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK))



Home | Main Index | Thread Index | Old Index