Lines Matching +full:0 +full:xde

73 SYSCTL_NODE(_vfs, OID_AUTO, tmpfs, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
94 MPASS(offset == 0); in tmpfs_pager_alloc()
97 if (!swap_pager_init_object(object, NULL, NULL, size, 0)) { in tmpfs_pager_alloc()
124 KASSERT((object->flags & OBJ_TMPFS_VREF) == 0, in tmpfs_pager_writecount_recalc()
131 if (old == 0) { in tmpfs_pager_writecount_recalc()
132 VNASSERT((object->flags & OBJ_TMPFS_VREF) == 0, vp, in tmpfs_pager_writecount_recalc()
134 VNPASS(vp->v_usecount > 0, vp); in tmpfs_pager_writecount_recalc()
136 VNASSERT((object->flags & OBJ_TMPFS_VREF) != 0, vp, in tmpfs_pager_writecount_recalc()
146 if (new == 0) { in tmpfs_pager_writecount_recalc()
151 if ((object->flags & OBJ_TMPFS_VREF) == 0) { in tmpfs_pager_writecount_recalc()
167 KASSERT((object->flags & OBJ_ANON) == 0, in tmpfs_pager_update_writecount()
183 KASSERT((object->flags & OBJ_ANON) == 0, in tmpfs_pager_release_writecount()
208 if ((object->flags & OBJ_TMPFS) != 0) { in tmpfs_pager_getvp()
230 if ((obj->flags & OBJ_TMPFS) == 0 || c == 0) in tmpfs_pager_freespace()
253 if ((obj->flags & OBJ_TMPFS) == 0) in tmpfs_page_inserted()
272 if ((obj->flags & OBJ_TMPFS) == 0) in tmpfs_page_removed()
298 tm->tm_pages_max == 0) in tmpfs_can_alloc_page()
326 node->tn_size = 0; in tmpfs_node_ctor()
327 node->tn_status = 0; in tmpfs_node_ctor()
329 node->tn_flags = 0; in tmpfs_node_ctor()
330 node->tn_links = 0; in tmpfs_node_ctor()
332 node->tn_vpstate = 0; in tmpfs_node_ctor()
333 return (0); in tmpfs_node_ctor()
351 node->tn_id = 0; in tmpfs_node_init()
354 return (0); in tmpfs_node_init()
375 tmpfs_node_init, tmpfs_node_fini, UMA_ALIGN_PTR, 0); in tmpfs_subr_init()
380 return (0); in tmpfs_subr_init()
401 error = sysctl_handle_long(oidp, &bytes, 0, req); in sysctl_mem_reserved()
410 return (0); in sysctl_mem_reserved()
414 CTLTYPE_LONG | CTLFLAG_MPSAFE | CTLFLAG_RW, &tmpfs_pages_reserved, 0,
424 error = sysctl_handle_int(oidp, &percent, 0, req); in sysctl_mem_percent()
433 return (0); in sysctl_mem_percent()
446 CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RWTUN, &tmpfs_mem_percent, 0,
463 return (0); in tmpfs_mem_avail()
500 error = 0; in tmpfs_partial_page_invalidate()
514 KASSERT(old > 0, ("node %p zero refcount", node)); in tmpfs_ref_node()
561 if ((mp->mnt_kern_flag & MNTK_UNMOUNT) != 0) { in tmpfs_alloc_node()
578 if ((mp->mnt_kern_flag & MNT_RDONLY) != 0) in tmpfs_alloc_node()
608 nnode->tn_dir.tn_readdir_lastn = 0; in tmpfs_alloc_node()
610 nnode->tn_dir.tn_wht_size = 0; in tmpfs_alloc_node()
663 vm_pager_allocate(tmpfs_pager_type, NULL, 0, in tmpfs_alloc_node()
664 VM_PROT_DEFAULT, 0, in tmpfs_alloc_node()
669 nnode->tn_reg.tn_pages = 0; in tmpfs_alloc_node()
685 return (0); in tmpfs_alloc_node()
720 MPASS(tmp->tm_nodes_inuse > 0); in tmpfs_free_node_locked()
732 MPASS((node->tn_vpstate & TMPFS_VNODE_ALLOCATING) == 0); in tmpfs_free_node_locked()
768 KASSERT((uobj->flags & OBJ_TMPFS) != 0, in tmpfs_free_node_locked()
818 hash &= 0xf; in tmpfs_dirent_hash()
840 return ((de->td_cookie & TMPFS_DIRCOOKIE_DUP) != 0); in tmpfs_dirent_dup()
846 return ((de->td_cookie & TMPFS_DIRCOOKIE_DUPHEAD) != 0); in tmpfs_dirent_duphead()
878 nde->td_namelen = 0; in tmpfs_alloc_dirent()
884 return (0); in tmpfs_alloc_dirent()
903 MPASS(node->tn_links > 0); in tmpfs_free_dirent()
928 if ((obj->flags & OBJ_TMPFS_VREF) != 0) { in tmpfs_destroy_vobject()
933 if (vp->v_writecount < 0) in tmpfs_destroy_vobject()
934 vp->v_writecount = 0; in tmpfs_destroy_vobject()
959 error = 0; in tmpfs_alloc_vp()
966 MPASS((node->tn_vpstate & TMPFS_VNODE_DOOMED) == 0); in tmpfs_alloc_vp()
969 (lkflag & LK_NOWAIT) != 0)) { in tmpfs_alloc_vp()
977 while ((node->tn_vpstate & TMPFS_VNODE_WRECLAIM) != 0) { in tmpfs_alloc_vp()
979 0, "tmpfsE", 0); in tmpfs_alloc_vp()
990 if (error != 0) { in tmpfs_alloc_vp()
1023 TMPFS_NODE_MTX(node), 0, "tmpfs_alloc_vp", 0); in tmpfs_alloc_vp()
1024 if (error != 0) in tmpfs_alloc_vp()
1035 if (error != 0) in tmpfs_alloc_vp()
1061 KASSERT((object->flags & OBJ_TMPFS_VREF) == 0, in tmpfs_alloc_vp()
1067 vn_irflag_set_locked(vp, (tm->tm_pgread ? VIRF_PGREAD : 0) | in tmpfs_alloc_vp()
1070 VNASSERT((object->flags & OBJ_TMPFS_VREF) == 0, vp, in tmpfs_alloc_vp()
1072 if (object->un_pager.swp.writemappings > 0) { in tmpfs_alloc_vp()
1092 if (error != 0) { in tmpfs_alloc_vp()
1120 if (error == 0) { in tmpfs_alloc_vp()
1149 if ((node->tn_vpstate & TMPFS_VNODE_WRECLAIM) != 0) in tmpfs_free_vp()
1202 if (error != 0) in tmpfs_alloc_file()
1208 if (error != 0) { in tmpfs_alloc_file()
1215 if (error != 0) { in tmpfs_alloc_file()
1227 return (0); in tmpfs_alloc_file()
1294 if ((cookie & TMPFS_DIRCOOKIE_DUP) != 0) { in tmpfs_dir_lookup_cookie()
1350 MPASS(IMPLIES(cnp->cn_namelen == 1, cnp->cn_nameptr[0] != '.')); in tmpfs_dir_lookup()
1351 MPASS(IMPLIES(cnp->cn_namelen == 2, !(cnp->cn_nameptr[0] == '.' && in tmpfs_dir_lookup()
1451 struct tmpfs_dirent *xde, *nde; in tmpfs_dir_attach() local
1454 MPASS(de->td_namelen > 0); in tmpfs_dir_attach()
1459 dnode->tn_dir.tn_readdir_lastn = 0; in tmpfs_dir_attach()
1463 xde = RB_INSERT(tmpfs_dir, &dnode->tn_dir.tn_dirhead, de); in tmpfs_dir_attach()
1464 if (xde != NULL && tmpfs_dirent_duphead(xde)) in tmpfs_dir_attach()
1465 tmpfs_dir_attach_dup(dnode, &xde->ud.td_duphead, de); in tmpfs_dir_attach()
1466 else if (xde != NULL) { in tmpfs_dir_attach()
1468 * Allocate new duphead. Swap xde with duphead to avoid in tmpfs_dir_attach()
1471 MPASS(!tmpfs_dirent_dup(xde)); in tmpfs_dir_attach()
1472 tmpfs_alloc_dirent(VFS_TO_TMPFS(vp->v_mount), NULL, NULL, 0, in tmpfs_dir_attach()
1474 /* *nde = *xde; XXX gcc 4.2.1 may generate invalid code. */ in tmpfs_dir_attach()
1475 memcpy(nde, xde, sizeof(*xde)); in tmpfs_dir_attach()
1476 xde->td_cookie |= TMPFS_DIRCOOKIE_DUPHEAD; in tmpfs_dir_attach()
1477 LIST_INIT(&xde->ud.td_duphead); in tmpfs_dir_attach()
1478 xde->td_namelen = 0; in tmpfs_dir_attach()
1479 xde->td_node = NULL; in tmpfs_dir_attach()
1480 tmpfs_dir_attach_dup(dnode, &xde->ud.td_duphead, nde); in tmpfs_dir_attach()
1481 tmpfs_dir_attach_dup(dnode, &xde->ud.td_duphead, de); in tmpfs_dir_attach()
1500 struct tmpfs_dirent *xde; in tmpfs_dir_detach() local
1506 dnode->tn_dir.tn_readdir_lastn = 0; in tmpfs_dir_detach()
1512 xde = tmpfs_dir_xlookup_hash(dnode, de->td_hash); in tmpfs_dir_detach()
1513 MPASS(tmpfs_dirent_duphead(xde)); in tmpfs_dir_detach()
1515 xde = NULL; in tmpfs_dir_detach()
1518 if (xde != NULL) { in tmpfs_dir_detach()
1519 if (LIST_EMPTY(&xde->ud.td_duphead)) { in tmpfs_dir_detach()
1520 RB_REMOVE(tmpfs_dir, head, xde); in tmpfs_dir_detach()
1522 MPASS(xde->td_node == NULL); in tmpfs_dir_detach()
1523 tmpfs_free_dirent(tmp, xde); in tmpfs_dir_detach()
1558 * directory and returns it in the uio space. The function returns 0
1577 dent.d_name[0] = '.'; in tmpfs_dir_getdotdent()
1593 * directory and returns it in the uio space. The function returns 0
1621 dent.d_name[0] = '.'; in tmpfs_dir_getdotdotdent()
1639 * The function returns 0 on success, -1 if there was not enough space
1654 off = 0; in tmpfs_dir_getdents()
1658 * 0 will lookup both '.' and '..', and then the first real entry, in tmpfs_dir_getdents()
1662 * call to return 0. in tmpfs_dir_getdents()
1667 if (error != 0) in tmpfs_dir_getdents()
1677 if (error != 0) in tmpfs_dir_getdents()
1684 return (0); in tmpfs_dir_getdents()
1687 return (0); in tmpfs_dir_getdents()
1769 if (error == 0) { in tmpfs_dir_getdents()
1777 } while (error == 0 && uio->uio_resid > 0 && de != NULL); in tmpfs_dir_getdents()
1801 if (error != 0) in tmpfs_dir_whiteout_add()
1806 return (0); in tmpfs_dir_whiteout_add()
1846 MPASS(dnode->tn_size == 0); in tmpfs_dir_clear_whiteouts()
1847 MPASS(dnode->tn_dir.tn_wht_size == 0); in tmpfs_dir_clear_whiteouts()
1867 MPASS(newsize >= 0); in tmpfs_reg_resize()
1885 return (0); in tmpfs_reg_resize()
1894 if (base != 0) { in tmpfs_reg_resize()
1898 if (error != 0) { in tmpfs_reg_resize()
1908 vm_object_page_remove(uobj, newpages, 0, 0); in tmpfs_reg_resize()
1914 return (0); in tmpfs_reg_resize()
1921 * Returns 0 on success or error code from tmpfs_partial_page_invalidate() on
1947 error = 0; in tmpfs_reg_punch_hole()
1950 if (len <= 0) { in tmpfs_reg_punch_hole()
1951 *length = 0; in tmpfs_reg_punch_hole()
1952 return (0); in tmpfs_reg_punch_hole()
1961 if (startofs != 0) { in tmpfs_reg_punch_hole()
1965 if (error != 0) in tmpfs_reg_punch_hole()
1975 vm_object_page_remove(object, pi, piend, 0); in tmpfs_reg_punch_hole()
1984 if (endofs != 0 && pistart != piend) { in tmpfs_reg_punch_hole()
1985 error = tmpfs_partial_page_invalidate(object, piend, 0, endofs, in tmpfs_reg_punch_hole()
1987 if (error != 0) in tmpfs_reg_punch_hole()
2045 UF_SPARSE | UF_SYSTEM)) != 0) in tmpfs_chflags()
2065 error = securelevel_gt(cred, 0); in tmpfs_chflags()
2080 return (0); in tmpfs_chflags()
2139 return (0); in tmpfs_chmod()
2205 if ((node->tn_mode & (S_ISUID | S_ISGID)) != 0 && in tmpfs_chown()
2215 return (0); in tmpfs_chown()
2235 error = 0; in tmpfs_chsize()
2255 return (0); in tmpfs_chsize()
2267 if (error != 0) in tmpfs_chsize()
2306 if (error != 0) in tmpfs_chtimes()
2320 return (0); in tmpfs_chtimes()
2354 (node->tn_status & (TMPFS_NODE_MODIFIED | TMPFS_NODE_CHANGED)) == 0) in tmpfs_itimes()
2385 if (length < 0) in tmpfs_truncate()
2391 error = node->tn_size == length ? 0 : tmpfs_reg_resize(vp, length, in tmpfs_truncate()
2393 if (error == 0) in tmpfs_truncate()
2407 return (0); in tmpfs_dirtree_cmp()