Lines Matching refs:dnode
188 tmpfs_node_t *node, *dnode; in tmpfs_newvnode() local
192 dnode = VP_TO_TMPFS_DIR(dvp); in tmpfs_newvnode()
193 if (dnode->tn_links == 0) in tmpfs_newvnode()
197 if (dnode->tn_links == LINK_MAX) in tmpfs_newvnode()
199 KASSERT(dnode->tn_links < LINK_MAX); in tmpfs_newvnode()
202 dnode = NULL; in tmpfs_newvnode()
248 KASSERT(dnode != NULL); in tmpfs_newvnode()
250 node->tn_gid = dnode->tn_gid; in tmpfs_newvnode()
372 tmpfs_node_t *dnode = VP_TO_TMPFS_DIR(dvp), *node; in tmpfs_construct_node() local
426 wde = tmpfs_dir_lookup(dnode, cnp); in tmpfs_construct_node()
428 tmpfs_dir_detach(dnode, wde); in tmpfs_construct_node()
433 tmpfs_dir_attach(dnode, de, node); in tmpfs_construct_node()
498 tmpfs_dir_attach(tmpfs_node_t *dnode, tmpfs_dirent_t *de, tmpfs_node_t *node) in tmpfs_dir_attach() argument
500 vnode_t *dvp = dnode->tn_vnode; in tmpfs_dir_attach()
508 de->td_seq = tmpfs_dir_getseq(dnode, de); in tmpfs_dir_attach()
518 } else if ((dnode->tn_gen & TMPFS_WHITEOUT_BIT) == 0) { in tmpfs_dir_attach()
520 atomic_or_32(&dnode->tn_gen, TMPFS_WHITEOUT_BIT); in tmpfs_dir_attach()
524 TAILQ_INSERT_TAIL(&dnode->tn_spec.tn_dir.tn_dir, de, td_entries); in tmpfs_dir_attach()
525 KASSERT(dnode->tn_size <= __type_max(off_t) - sizeof(tmpfs_dirent_t)); in tmpfs_dir_attach()
526 dnode->tn_size += sizeof(tmpfs_dirent_t); in tmpfs_dir_attach()
527 uvm_vnp_setsize(dvp, dnode->tn_size); in tmpfs_dir_attach()
532 node->tn_spec.tn_dir.tn_parent = dnode; in tmpfs_dir_attach()
535 KASSERT(dnode->tn_links < LINK_MAX); in tmpfs_dir_attach()
536 dnode->tn_links++; in tmpfs_dir_attach()
554 tmpfs_dir_detach(tmpfs_node_t *dnode, tmpfs_dirent_t *de) in tmpfs_dir_detach() argument
557 vnode_t *dvp = dnode->tn_vnode; in tmpfs_dir_detach()
570 KASSERT(node->tn_spec.tn_dir.tn_parent == dnode); in tmpfs_dir_detach()
573 KASSERT(dnode->tn_links > 0); in tmpfs_dir_detach()
574 dnode->tn_links--; in tmpfs_dir_detach()
580 if (dnode->tn_spec.tn_dir.tn_readdir_lastp == de) { in tmpfs_dir_detach()
581 dnode->tn_spec.tn_dir.tn_readdir_lastp = NULL; in tmpfs_dir_detach()
583 TAILQ_REMOVE(&dnode->tn_spec.tn_dir.tn_dir, de, td_entries); in tmpfs_dir_detach()
584 KASSERT(dnode->tn_size >= sizeof(tmpfs_dirent_t)); in tmpfs_dir_detach()
585 dnode->tn_size -= sizeof(tmpfs_dirent_t); in tmpfs_dir_detach()
586 tmpfs_dir_putseq(dnode, de); in tmpfs_dir_detach()
589 uvm_vnp_setsize(dvp, dnode->tn_size); in tmpfs_dir_detach()
652 tmpfs_dir_getseq(tmpfs_node_t *dnode, tmpfs_dirent_t *de) in tmpfs_dir_getseq() argument
659 TMPFS_VALIDATE_DIR(dnode); in tmpfs_dir_getseq()
677 seq = dnode->tn_spec.tn_dir.tn_next_seq; in tmpfs_dir_getseq()
682 dnode->tn_spec.tn_dir.tn_next_seq++; in tmpfs_dir_getseq()
690 if ((seq_arena = dnode->tn_spec.tn_dir.tn_seq_arena) == NULL) { in tmpfs_dir_getseq()
694 dnode->tn_spec.tn_dir.tn_seq_arena = seq_arena; in tmpfs_dir_getseq()
706 tmpfs_dir_putseq(tmpfs_node_t *dnode, tmpfs_dirent_t *de) in tmpfs_dir_putseq() argument
708 vmem_t *seq_arena = dnode->tn_spec.tn_dir.tn_seq_arena; in tmpfs_dir_putseq()
711 TMPFS_VALIDATE_DIR(dnode); in tmpfs_dir_putseq()
726 if (seq_arena && dnode->tn_size == 0) { in tmpfs_dir_putseq()
727 dnode->tn_spec.tn_dir.tn_seq_arena = NULL; in tmpfs_dir_putseq()
728 dnode->tn_spec.tn_dir.tn_next_seq = TMPFS_DIRSEQ_START; in tmpfs_dir_putseq()