-/*
- * Make a new null_node node.
- * Vp is the alias vnode, lofsvp is the lower vnode.
- * Maintain a reference to (lowervp).
- */
-static void
-null_node_alloc(vp, lowervp)
- struct vnode *vp;
- struct vnode *lowervp;
-{
- struct null_node_cache *hd;
- struct null_node *a;
-
-#ifdef NULLFS_DIAGNOSTIC
- printf("null_node_alloc(%x, %x)\n", vp, lowervp);
-#endif
-
- MALLOC(a, struct null_node *, sizeof(struct null_node), M_TEMP, M_WAITOK);
- vp->v_type = lowervp->v_type;
- a->null_vnode = vp;
- vp->v_data = a;
- VREF(lowervp); /* Extra VREF will be vrele'd in null_node_create */
- a->null_lowervp = lowervp;
- hd = null_node_hash(lowervp);
- insque(a, hd);
-
-#ifdef NULLFS_DIAGNOSTIC
- vprint("null_node_alloc vp", vp);
- vprint("null_node_alloc lowervp", lowervp);
-#endif
-}
-
-#ifdef NULLFS_DIAGNOSTIC
-/*
- * NEEDSWORK: The ability to set lowervp to null here
- * implies that one can never count on lowervp staying null
- * (even if vp is locked). This seems quite bad. Think
- * about these things.
- */
-void
-null_node_flushmp (mp)
- struct mount *mp;
-{
- struct null_node_cache *ac;
- int i = 0;
- struct null_node *roota;
-
- printf("null_node_flushmp (%x)\n", mp);
-
- roota = VTONULL(MOUNTTONULLMOUNT(mp)->nullm_rootvp);
-
- for (ac = null_node_cache; ac < null_node_cache + NNULLNODECACHE; ac++) {
- struct null_node *a = ac->ac_forw;
- while (a != (struct null_node *) ac) {
- if (a != roota && NULLTOV(a)->v_mount == mp) {
- struct vnode *vp = a->null_lowervp;
- if (vp) {
- a->null_lowervp = 0;
- vprint("null_flushmp: would vrele", vp);
- /*vrele(vp);*/
- i++;
- }
- }
- a = a->null_forw;
- }
- }
- if (i > 0)
- printf("null_node: vrele'd %d aliases\n", i);
-}
-#endif