Lines Matching refs:cmap
7157 static kern_return_t vfs_drt_free_map(struct vfs_drt_clustermap *cmap);
7158 static kern_return_t vfs_drt_search_index(struct vfs_drt_clustermap *cmap,
7171 struct vfs_drt_clustermap *cmap,
7190 struct vfs_drt_clustermap *cmap = NULL, *ocmap = NULL; in vfs_drt_alloc_map() local
7268 kret = kmem_alloc(kernel_map, (vm_offset_t *)&cmap, map_size, in vfs_drt_alloc_map()
7273 cmap->scm_magic = DRT_SCM_MAGIC; in vfs_drt_alloc_map()
7274 cmap->scm_modulus = modulus_size; in vfs_drt_alloc_map()
7275 cmap->scm_buckets = 0; in vfs_drt_alloc_map()
7276 cmap->scm_lastclean = 0; in vfs_drt_alloc_map()
7277 cmap->scm_iskips = 0; in vfs_drt_alloc_map()
7278 for (i = 0; i < cmap->scm_modulus; i++) { in vfs_drt_alloc_map()
7279 DRT_HASH_CLEAR(cmap, i); in vfs_drt_alloc_map()
7280 DRT_HASH_VACATE(cmap, i); in vfs_drt_alloc_map()
7281 DRT_BITVECTOR_CLEAR(cmap, i); in vfs_drt_alloc_map()
7297 kret = vfs_drt_get_index(&cmap, offset, &index, 1); in vfs_drt_alloc_map()
7304 DRT_HASH_COPY(ocmap, i, cmap, index); in vfs_drt_alloc_map()
7310 vfs_drt_trace(cmap, DRT_DEBUG_ALLOC, copycount, 0, 0, 0); in vfs_drt_alloc_map()
7317 *cmapp = cmap; in vfs_drt_alloc_map()
7336 vfs_drt_free_map(struct vfs_drt_clustermap *cmap) in vfs_drt_free_map() argument
7340 if (cmap->scm_modulus == DRT_HASH_SMALL_MODULUS) { in vfs_drt_free_map()
7342 } else if (cmap->scm_modulus == DRT_HASH_LARGE_MODULUS) { in vfs_drt_free_map()
7344 } else if (cmap->scm_modulus == DRT_HASH_XLARGE_MODULUS) { in vfs_drt_free_map()
7347 panic("vfs_drt_free_map: Invalid modulus %d", cmap->scm_modulus); in vfs_drt_free_map()
7350 kmem_free(kernel_map, (vm_offset_t)cmap, map_size); in vfs_drt_free_map()
7359 vfs_drt_search_index(struct vfs_drt_clustermap *cmap, u_int64_t offset, int *indexp) in vfs_drt_search_index() argument
7365 index = DRT_HASH(cmap, offset); in vfs_drt_search_index()
7368 for (i = 0; i < cmap->scm_modulus; i++) { in vfs_drt_search_index()
7372 if (DRT_HASH_VACANT(cmap, index)) { in vfs_drt_search_index()
7379 if (DRT_HASH_GET_ADDRESS(cmap, index) == offset) { in vfs_drt_search_index()
7387 index = DRT_HASH_NEXT(cmap, index); in vfs_drt_search_index()
7404 struct vfs_drt_clustermap *cmap; in vfs_drt_get_index() local
7409 cmap = *cmapp; in vfs_drt_get_index()
7412 kret = vfs_drt_search_index(cmap, offset, indexp); in vfs_drt_get_index()
7419 index = DRT_HASH(cmap, offset); in vfs_drt_get_index()
7422 for (i = 0; i < cmap->scm_modulus; i++) { in vfs_drt_get_index()
7424 if (DRT_HASH_VACANT(cmap, index) || DRT_HASH_GET_COUNT(cmap, index) == 0) { in vfs_drt_get_index()
7425 cmap->scm_buckets++; in vfs_drt_get_index()
7426 if (index < cmap->scm_lastclean) { in vfs_drt_get_index()
7427 cmap->scm_lastclean = index; in vfs_drt_get_index()
7429 DRT_HASH_SET_ADDRESS(cmap, index, offset); in vfs_drt_get_index()
7430 DRT_HASH_SET_COUNT(cmap, index, 0); in vfs_drt_get_index()
7431 DRT_BITVECTOR_CLEAR(cmap, index); in vfs_drt_get_index()
7433 vfs_drt_trace(cmap, DRT_DEBUG_INSERT, (int)offset, i, 0, 0); in vfs_drt_get_index()
7436 cmap->scm_iskips += i; in vfs_drt_get_index()
7437 index = DRT_HASH_NEXT(cmap, index); in vfs_drt_get_index()
7468 struct vfs_drt_clustermap *cmap, **cmapp; in vfs_drt_do_mark_pages() local
7473 cmap = *cmapp; in vfs_drt_do_mark_pages()
7475 vfs_drt_trace(cmap, DRT_DEBUG_MARK | DBG_FUNC_START, (int)offset, (int)length, dirty, 0); in vfs_drt_do_mark_pages()
7482 if (cmap == NULL) { in vfs_drt_do_mark_pages()
7485 vfs_drt_trace(cmap, DRT_DEBUG_MARK | DBG_FUNC_END, 1, 0, 0, 0); in vfs_drt_do_mark_pages()
7490 vfs_drt_trace(cmap, DRT_DEBUG_MARK | DBG_FUNC_END, 2, 0, 0, 0); in vfs_drt_do_mark_pages()
7507 cmap = *cmapp; /* may have changed! */ in vfs_drt_do_mark_pages()
7513 vfs_drt_trace(cmap, DRT_DEBUG_MARK | DBG_FUNC_END, 3, (int)length, 0, 0); in vfs_drt_do_mark_pages()
7528 ecount = DRT_HASH_GET_COUNT(cmap, index); in vfs_drt_do_mark_pages()
7531 if (!DRT_HASH_TEST_BIT(cmap, index, pgoff + i)) { in vfs_drt_do_mark_pages()
7533 … panic("ecount >= DRT_BITVECTOR_PAGES, cmap = %p, index = %d, bit = %d", cmap, index, pgoff + i); in vfs_drt_do_mark_pages()
7535 DRT_HASH_SET_BIT(cmap, index, pgoff + i); in vfs_drt_do_mark_pages()
7540 if (DRT_HASH_TEST_BIT(cmap, index, pgoff + i)) { in vfs_drt_do_mark_pages()
7542 panic("ecount <= 0, cmap = %p, index = %d, bit = %d", cmap, index, pgoff + i); in vfs_drt_do_mark_pages()
7545 DRT_HASH_CLEAR_BIT(cmap, index, pgoff + i); in vfs_drt_do_mark_pages()
7551 DRT_HASH_SET_COUNT(cmap, index, ecount); in vfs_drt_do_mark_pages()
7560 vfs_drt_trace(cmap, DRT_DEBUG_MARK | DBG_FUNC_END, 0, setcount, 0, 0); in vfs_drt_do_mark_pages()
7627 struct vfs_drt_clustermap *cmap; in vfs_drt_get_cluster() local
7637 cmap = *cmapp; in vfs_drt_get_cluster()
7640 for (offset = 0, j = 0; j < cmap->scm_modulus; offset += (DRT_BITVECTOR_PAGES * PAGE_SIZE), j++) { in vfs_drt_get_cluster()
7641 index = DRT_HASH(cmap, offset); in vfs_drt_get_cluster()
7643 if (DRT_HASH_VACANT(cmap, index) || (DRT_HASH_GET_COUNT(cmap, index) == 0)) { in vfs_drt_get_cluster()
7651 if (DRT_HASH_TEST_BIT(cmap, index, i)) { in vfs_drt_get_cluster()
7659 cmap, index, DRT_HASH_GET_COUNT(cmap, index)); in vfs_drt_get_cluster()
7662 if (!DRT_HASH_TEST_BIT(cmap, index, i)) { in vfs_drt_get_cluster()
7668 offset = DRT_HASH_GET_ADDRESS(cmap, index) + (PAGE_SIZE * fs); in vfs_drt_get_cluster()
7671 cmap->scm_lastclean = index; in vfs_drt_get_cluster()
7677 vfs_drt_trace(cmap, DRT_DEBUG_RETCLUSTER, (int)offset, (int)length, 0, 0); in vfs_drt_get_cluster()
7685 vfs_drt_trace(cmap, DRT_DEBUG_SCMDATA, in vfs_drt_get_cluster()
7686 cmap->scm_modulus, in vfs_drt_get_cluster()
7687 cmap->scm_buckets, in vfs_drt_get_cluster()
7688 cmap->scm_lastclean, in vfs_drt_get_cluster()
7689 cmap->scm_iskips); in vfs_drt_get_cluster()
7691 vfs_drt_free_map(cmap); in vfs_drt_get_cluster()
7701 struct vfs_drt_clustermap *cmap; in vfs_drt_control() local
7707 cmap = *cmapp; in vfs_drt_control()
7712 vfs_drt_trace(cmap, DRT_DEBUG_SCMDATA, in vfs_drt_control()
7713 cmap->scm_modulus, in vfs_drt_control()
7714 cmap->scm_buckets, in vfs_drt_control()
7715 cmap->scm_lastclean, in vfs_drt_control()
7716 cmap->scm_iskips); in vfs_drt_control()
7718 vfs_drt_free_map(cmap); in vfs_drt_control()
7723 cmap->scm_lastclean = 0; in vfs_drt_control()
7737 vfs_drt_trace(__unused struct vfs_drt_clustermap *cmap, int code, int arg1, int arg2, int arg3, int… in vfs_drt_trace() argument
7743 vfs_drt_trace(__unused struct vfs_drt_clustermap *cmap, __unused int code, in vfs_drt_trace() argument
7756 vfs_drt_sanity(struct vfs_drt_clustermap *cmap)
7761 for (index = 0; index < cmap->scm_modulus; index++) {
7762 if (DRT_HASH_VACANT(cmap, index)) {
7767 if (DRT_HASH_TEST_BIT(cmap, index, i)) {
7771 if (bits_on != DRT_HASH_GET_COUNT(cmap, index)) {
7784 struct vfs_drt_clustermap *cmap; in vfs_get_scmap_push_behavior_internal() local
7790 cmap = *cmapp; in vfs_get_scmap_push_behavior_internal()
7792 if (cmap->scm_modulus == DRT_HASH_XLARGE_MODULUS) { in vfs_get_scmap_push_behavior_internal()