Lines Matching refs:de

710 tmpfs_dirent_cookie(struct tmpfs_dirent *de)  in tmpfs_dirent_cookie()  argument
712 if (de == NULL) in tmpfs_dirent_cookie()
715 MPASS(de->td_cookie >= TMPFS_DIRCOOKIE_MIN); in tmpfs_dirent_cookie()
717 return (de->td_cookie); in tmpfs_dirent_cookie()
721 tmpfs_dirent_dup(struct tmpfs_dirent *de) in tmpfs_dirent_dup() argument
723 return ((de->td_cookie & TMPFS_DIRCOOKIE_DUP) != 0); in tmpfs_dirent_dup()
727 tmpfs_dirent_duphead(struct tmpfs_dirent *de) in tmpfs_dirent_duphead() argument
729 return ((de->td_cookie & TMPFS_DIRCOOKIE_DUPHEAD) != 0); in tmpfs_dirent_duphead()
733 tmpfs_dirent_init(struct tmpfs_dirent *de, const char *name, u_int namelen) in tmpfs_dirent_init() argument
735 de->td_hash = de->td_cookie = tmpfs_dirent_hash(name, namelen); in tmpfs_dirent_init()
736 memcpy(de->ud.td_name, name, namelen); in tmpfs_dirent_init()
737 de->td_namelen = namelen; in tmpfs_dirent_init()
751 const char *name, u_int len, struct tmpfs_dirent **de) in tmpfs_alloc_dirent() argument
765 *de = nde; in tmpfs_alloc_dirent()
780 tmpfs_free_dirent(struct tmpfs_mount *tmp, struct tmpfs_dirent *de) in tmpfs_free_dirent() argument
784 node = de->td_node; in tmpfs_free_dirent()
789 if (!tmpfs_dirent_duphead(de) && de->ud.td_name != NULL) in tmpfs_free_dirent()
790 free(de->ud.td_name, M_TMPFSNAME); in tmpfs_free_dirent()
791 free(de, M_TMPFSDIR); in tmpfs_free_dirent()
1054 struct tmpfs_dirent *de; in tmpfs_alloc_file() local
1092 &de); in tmpfs_alloc_file()
1101 tmpfs_free_dirent(tmp, de); in tmpfs_alloc_file()
1111 tmpfs_dir_attach(dvp, de); in tmpfs_alloc_file()
1118 struct tmpfs_dirent *de; in tmpfs_dir_first() local
1120 de = RB_MIN(tmpfs_dir, &dnode->tn_dir.tn_dirhead); in tmpfs_dir_first()
1121 dc->tdc_tree = de; in tmpfs_dir_first()
1122 if (de != NULL && tmpfs_dirent_duphead(de)) in tmpfs_dir_first()
1123 de = LIST_FIRST(&de->ud.td_duphead); in tmpfs_dir_first()
1124 dc->tdc_current = de; in tmpfs_dir_first()
1132 struct tmpfs_dirent *de; in tmpfs_dir_next() local
1142 if ((de = dc->tdc_current) != NULL && tmpfs_dirent_duphead(de)) { in tmpfs_dir_next()
1143 dc->tdc_current = LIST_FIRST(&de->ud.td_duphead); in tmpfs_dir_next()
1154 struct tmpfs_dirent *de, dekey; in tmpfs_dir_xlookup_hash() local
1157 de = RB_FIND(tmpfs_dir, &dnode->tn_dir.tn_dirhead, &dekey); in tmpfs_dir_xlookup_hash()
1158 return (de); in tmpfs_dir_xlookup_hash()
1167 struct tmpfs_dirent *de, dekey; in tmpfs_dir_lookup_cookie() local
1172 (de = node->tn_dir.tn_readdir_lastp) != NULL) { in tmpfs_dir_lookup_cookie()
1175 if (cookie == tmpfs_dirent_cookie(de)) in tmpfs_dir_lookup_cookie()
1180 LIST_FOREACH(de, &node->tn_dir.tn_dupindex, in tmpfs_dir_lookup_cookie()
1182 MPASS(tmpfs_dirent_dup(de)); in tmpfs_dir_lookup_cookie()
1183 if (de->td_cookie == cookie) in tmpfs_dir_lookup_cookie()
1186 if (de->td_cookie < cookie) { in tmpfs_dir_lookup_cookie()
1187 de = NULL; in tmpfs_dir_lookup_cookie()
1191 MPASS(de == NULL); in tmpfs_dir_lookup_cookie()
1196 de = NULL; in tmpfs_dir_lookup_cookie()
1200 de = RB_NFIND(tmpfs_dir, dirhead, &dekey); in tmpfs_dir_lookup_cookie()
1202 dc->tdc_tree = de; in tmpfs_dir_lookup_cookie()
1203 dc->tdc_current = de; in tmpfs_dir_lookup_cookie()
1204 if (de != NULL && tmpfs_dirent_duphead(de)) { in tmpfs_dir_lookup_cookie()
1205 dc->tdc_current = LIST_FIRST(&de->ud.td_duphead); in tmpfs_dir_lookup_cookie()
1211 dc->tdc_tree = de; in tmpfs_dir_lookup_cookie()
1212 dc->tdc_current = de; in tmpfs_dir_lookup_cookie()
1213 if (de != NULL && tmpfs_dirent_dup(de)) in tmpfs_dir_lookup_cookie()
1215 de->td_hash); in tmpfs_dir_lookup_cookie()
1232 struct tmpfs_dirent *de; in tmpfs_dir_lookup() local
1241 de = tmpfs_dir_xlookup_hash(node, hash); in tmpfs_dir_lookup()
1242 if (de != NULL && tmpfs_dirent_duphead(de)) { in tmpfs_dir_lookup()
1243 duphead = &de->ud.td_duphead; in tmpfs_dir_lookup()
1244 LIST_FOREACH(de, duphead, uh.td_dup.entries) { in tmpfs_dir_lookup()
1245 if (TMPFS_DIRENT_MATCHES(de, cnp->cn_nameptr, in tmpfs_dir_lookup()
1249 } else if (de != NULL) { in tmpfs_dir_lookup()
1250 if (!TMPFS_DIRENT_MATCHES(de, cnp->cn_nameptr, in tmpfs_dir_lookup()
1252 de = NULL; in tmpfs_dir_lookup()
1254 if (de != NULL && f != NULL && de->td_node != f) in tmpfs_dir_lookup()
1255 de = NULL; in tmpfs_dir_lookup()
1257 return (de); in tmpfs_dir_lookup()
1269 struct tmpfs_dirent *de, *pde; in tmpfs_dir_attach_dup() local
1272 de = LIST_FIRST(dupindex); in tmpfs_dir_attach_dup()
1273 if (de == NULL || de->td_cookie < TMPFS_DIRCOOKIE_DUP_MAX) { in tmpfs_dir_attach_dup()
1274 if (de == NULL) in tmpfs_dir_attach_dup()
1277 nde->td_cookie = de->td_cookie + 1; in tmpfs_dir_attach_dup()
1290 pde = de; in tmpfs_dir_attach_dup()
1291 de = LIST_NEXT(de, uh.td_dup.index_entries); in tmpfs_dir_attach_dup()
1292 if (de == NULL && pde->td_cookie != TMPFS_DIRCOOKIE_DUP_MIN) { in tmpfs_dir_attach_dup()
1301 } else if (de == NULL) { in tmpfs_dir_attach_dup()
1314 if (de->td_cookie + 1 == pde->td_cookie || in tmpfs_dir_attach_dup()
1315 de->td_cookie >= TMPFS_DIRCOOKIE_DUP_MAX) in tmpfs_dir_attach_dup()
1317 nde->td_cookie = de->td_cookie + 1; in tmpfs_dir_attach_dup()
1320 MPASS(nde->td_cookie > de->td_cookie); in tmpfs_dir_attach_dup()
1321 LIST_INSERT_BEFORE(de, nde, uh.td_dup.index_entries); in tmpfs_dir_attach_dup()
1333 tmpfs_dir_attach(struct vnode *vp, struct tmpfs_dirent *de) in tmpfs_dir_attach() argument
1339 MPASS(de->td_namelen > 0); in tmpfs_dir_attach()
1340 MPASS(de->td_hash >= TMPFS_DIRCOOKIE_MIN); in tmpfs_dir_attach()
1341 MPASS(de->td_cookie == de->td_hash); in tmpfs_dir_attach()
1347 MPASS(!tmpfs_dirent_dup(de)); in tmpfs_dir_attach()
1348 xde = RB_INSERT(tmpfs_dir, &dnode->tn_dir.tn_dirhead, de); in tmpfs_dir_attach()
1350 tmpfs_dir_attach_dup(dnode, &xde->ud.td_duphead, de); in tmpfs_dir_attach()
1366 tmpfs_dir_attach_dup(dnode, &xde->ud.td_duphead, de); in tmpfs_dir_attach()
1380 tmpfs_dir_detach(struct vnode *vp, struct tmpfs_dirent *de) in tmpfs_dir_detach() argument
1394 if (tmpfs_dirent_dup(de)) { in tmpfs_dir_detach()
1396 if (LIST_NEXT(de, uh.td_dup.entries) == NULL) { in tmpfs_dir_detach()
1397 xde = tmpfs_dir_xlookup_hash(dnode, de->td_hash); in tmpfs_dir_detach()
1401 LIST_REMOVE(de, uh.td_dup.entries); in tmpfs_dir_detach()
1402 LIST_REMOVE(de, uh.td_dup.index_entries); in tmpfs_dir_detach()
1411 de->td_cookie = de->td_hash; in tmpfs_dir_detach()
1413 RB_REMOVE(tmpfs_dir, head, de); in tmpfs_dir_detach()
1424 struct tmpfs_dirent *de, *dde, *nde; in tmpfs_dir_destroy() local
1426 RB_FOREACH_SAFE(de, tmpfs_dir, &dnode->tn_dir.tn_dirhead, nde) { in tmpfs_dir_destroy()
1427 RB_REMOVE(tmpfs_dir, &dnode->tn_dir.tn_dirhead, de); in tmpfs_dir_destroy()
1429 de->td_node = NULL; in tmpfs_dir_destroy()
1430 if (tmpfs_dirent_duphead(de)) { in tmpfs_dir_destroy()
1431 while ((dde = LIST_FIRST(&de->ud.td_duphead)) != NULL) { in tmpfs_dir_destroy()
1437 tmpfs_free_dirent(tmp, de); in tmpfs_dir_destroy()
1533 struct tmpfs_dirent *de, *nde; in tmpfs_dir_getdents() local
1559 de = tmpfs_dir_first(node, &dc); in tmpfs_dir_getdents()
1560 off = tmpfs_dirent_cookie(de); in tmpfs_dir_getdents()
1568 if (de == NULL) in tmpfs_dir_getdents()
1574 de = tmpfs_dir_lookup_cookie(node, uio->uio_offset, &dc); in tmpfs_dir_getdents()
1575 if (de == NULL) in tmpfs_dir_getdents()
1578 off = tmpfs_dirent_cookie(de); in tmpfs_dir_getdents()
1592 if (de->td_node == NULL) { in tmpfs_dir_getdents()
1596 d.d_fileno = de->td_node->tn_id; in tmpfs_dir_getdents()
1597 switch (de->td_node->tn_type) { in tmpfs_dir_getdents()
1628 de->td_node, (int)de->td_node->tn_type); in tmpfs_dir_getdents()
1631 d.d_namlen = de->td_namelen; in tmpfs_dir_getdents()
1632 MPASS(de->td_namelen < sizeof(d.d_name)); in tmpfs_dir_getdents()
1633 (void)memcpy(d.d_name, de->ud.td_name, de->td_namelen); in tmpfs_dir_getdents()
1655 de = nde; in tmpfs_dir_getdents()
1657 off = tmpfs_dirent_cookie(de); in tmpfs_dir_getdents()
1662 } while (error == 0 && uio->uio_resid > 0 && de != NULL); in tmpfs_dir_getdents()
1666 off = tmpfs_dirent_cookie(de); in tmpfs_dir_getdents()
1671 node->tn_dir.tn_readdir_lastp = de; in tmpfs_dir_getdents()
1680 struct tmpfs_dirent *de; in tmpfs_dir_whiteout_add() local
1684 cnp->cn_nameptr, cnp->cn_namelen, &de); in tmpfs_dir_whiteout_add()
1687 tmpfs_dir_attach(dvp, de); in tmpfs_dir_whiteout_add()
1694 struct tmpfs_dirent *de; in tmpfs_dir_whiteout_remove() local
1696 de = tmpfs_dir_lookup(VP_TO_TMPFS_DIR(dvp), NULL, cnp); in tmpfs_dir_whiteout_remove()
1697 MPASS(de != NULL && de->td_node == NULL); in tmpfs_dir_whiteout_remove()
1698 tmpfs_dir_detach(dvp, de); in tmpfs_dir_whiteout_remove()
1699 tmpfs_free_dirent(VFS_TO_TMPFS(dvp->v_mount), de); in tmpfs_dir_whiteout_remove()