-/*
- * Make a new umap_node node.
- * Vp is the alias vnode, lofsvp is the target vnode.
- * Maintain a reference to (targetvp).
- */
-static void
-umap_node_alloc(vp, targetvp)
- struct vnode *vp;
- struct vnode *targetvp;
-{
- struct umap_node_cache *hd;
- struct umap_node *a;
-
-#ifdef UMAPFS_DIAGNOSTIC
- printf("umap_node_alloc(%x, %x)\n", vp, targetvp);
-#endif
-
- MALLOC(a, struct umap_node *, sizeof(struct umap_node), M_TEMP, M_WAITOK);
- vp->v_type = targetvp->v_type;
- a->umap_vnode = vp;
- vp->v_data = a;
- VREF(targetvp); /* Extra VREF will be vrele'd in umap_node_create */
- a->umap_lowervp = targetvp;
- hd = umap_node_hash(targetvp);
- insque(a, hd);
-
-#ifdef UMAPFS_DIAGNOSTIC
- vprint("umap_node_alloc vp", vp);
- vprint("umap_node_alloc targetvp", targetvp);
-#endif
-}
-
-#ifdef UMAPFS_DIAGNOSTIC
-/*
- * NEEDSWORK: The ability to set lowervp to umap here
- * implies that one can never count on lowervp staying umap
- * (even if vp is locked). This seems quite bad. Think
- * about these things.
- */
-void
-umap_node_flushmp (mp)
- struct mount *mp;
-{
- struct umap_node_cache *ac;
- int i = 0;
- struct umap_node *roota;
-
- printf("umap_node_flushmp (%x)\n", mp);
-
- roota = VTOUMAP(MOUNTTOUMAPMOUNT(mp)->umapm_rootvp);
-
- for (ac = umap_node_cache; ac < umap_node_cache + NUMAPNODECACHE; ac++) {
- struct umap_node *a = ac->ac_forw;
- while (a != (struct umap_node *) ac) {
- if (a != roota && a->umap_vnode->v_mount == mp) {
- struct vnode *vp = a->umap_lowervp;
- if (vp) {
- a->umap_lowervp = 0;
- vprint("umap_flushmp: would vrele", vp);
- /*vrele(vp);*/
- i++;
- }
- }
- a = a->umap_forw;
- }
- }
- if (i > 0)
- printf("umap_node: vrele'd %d aliases\n", i);
-}
-#endif
-