Lines Matching refs:bnp
74 bootfs_node_t *bnp = buf;
76 bnp->bvn_vnp = vn_alloc(kmflags);
77 if (bnp->bvn_vnp == NULL)
87 bootfs_node_t *bnp = buf;
89 vn_free(bnp->bvn_vnp);
110 bootfs_node_init(bootfs_t *bfs, bootfs_node_t *bnp, const struct vattr *vap,
115 vn_reinit(bnp->bvn_vnp);
117 bnp->bvn_vnp->v_flag |= VNOSWAP;
118 bnp->bvn_vnp->v_type = vap->va_type;
119 bnp->bvn_vnp->v_vfsp = bfs->bfs_vfsp;
120 bnp->bvn_vnp->v_rdev = 0;
121 bnp->bvn_vnp->v_data = (caddr_t)bnp;
122 vn_setops(bnp->bvn_vnp, bootfs_vnodeops);
124 bnp->bvn_name = kmem_alloc(namelen + 1, KM_SLEEP);
125 bcopy(name, bnp->bvn_name, namelen);
126 bnp->bvn_name[namelen] = '\0';
128 avl_create(&bnp->bvn_dir, bootfs_comparator,
132 bzero(&bnp->bvn_link, sizeof (avl_node_t));
133 bcopy(vap, &bnp->bvn_attr, sizeof (vattr_t));
136 bnp->bvn_attr.va_atime = now;
137 bnp->bvn_attr.va_ctime = now;
138 bnp->bvn_attr.va_mtime = now;
139 bnp->bvn_attr.va_fsid = makedevice(bootfs_major, bfs->bfs_minor);
140 bnp->bvn_attr.va_nodeid = bfs->bfs_ninode;
141 bnp->bvn_attr.va_blksize = PAGESIZE;
143 list_insert_tail(&bfs->bfs_nodes, bnp);
149 bootfs_node_t *bnp;
151 bnp = kmem_cache_alloc(bootfs_node_cache, KM_SLEEP);
152 bootfs_node_init(bfs, bnp, &bootfs_vattr_dir, "/", 1);
153 bnp->bvn_vnp->v_flag |= VROOT;
154 bnp->bvn_parent = bnp;
155 bfs->bfs_rootvn = bnp;
157 vn_exists(bnp->bvn_vnp);
165 bootfs_node_t *bnp;
175 if ((bnp = avl_find(&parent->bvn_dir, &sn, &where)) != NULL) {
179 *outp = bnp;
186 bnp = kmem_cache_alloc(bootfs_node_cache, KM_SLEEP);
187 bootfs_node_init(bfs, bnp, vap, name, namelen);
188 bnp->bvn_parent = parent;
189 avl_add(&parent->bvn_dir, bnp);
190 *outp = bnp;
197 bnp->bvn_addr = addr;
198 bnp->bvn_size = size;
201 bnp->bvn_attr.va_nblocks = P2ROUNDUP(size, 512) >> 9;
202 bnp->bvn_attr.va_size = size;
205 vn_exists(bnp->bvn_vnp);
226 bootfs_node_t *bnp = bfs->bfs_rootvn;
250 bnp = bnp->bvn_parent;
255 VERIFY(bootfs_mknode(bfs, bnp, &nbnp, p, nlen,
258 bnp = nbnp;
262 ret = bootfs_mknode(bfs, bnp, &nbnp, p, nlen, &bootfs_vattr_reg,
360 bootfs_node_t *bnp;
362 while ((bnp = list_remove_head(&bfs->bfs_nodes)) != NULL) {
363 ASSERT(bnp->bvn_vnp->v_count == 1);
364 VN_RELE(bnp->bvn_vnp);
365 kmem_free(bnp->bvn_name, strlen(bnp->bvn_name) + 1);
366 kmem_cache_free(bootfs_node_cache, bnp);