Lines Matching refs:cmap

7062 static kern_return_t    vfs_drt_free_map(struct vfs_drt_clustermap *cmap);
7063 static kern_return_t vfs_drt_search_index(struct vfs_drt_clustermap *cmap,
7076 struct vfs_drt_clustermap *cmap,
7095 struct vfs_drt_clustermap *cmap = NULL, *ocmap = NULL; in vfs_drt_alloc_map() local
7173 kret = kmem_alloc(kernel_map, (vm_offset_t *)&cmap, map_size, in vfs_drt_alloc_map()
7178 cmap->scm_magic = DRT_SCM_MAGIC; in vfs_drt_alloc_map()
7179 cmap->scm_modulus = modulus_size; in vfs_drt_alloc_map()
7180 cmap->scm_buckets = 0; in vfs_drt_alloc_map()
7181 cmap->scm_lastclean = 0; in vfs_drt_alloc_map()
7182 cmap->scm_iskips = 0; in vfs_drt_alloc_map()
7183 for (i = 0; i < cmap->scm_modulus; i++) { in vfs_drt_alloc_map()
7184 DRT_HASH_CLEAR(cmap, i); in vfs_drt_alloc_map()
7185 DRT_HASH_VACATE(cmap, i); in vfs_drt_alloc_map()
7186 DRT_BITVECTOR_CLEAR(cmap, i); in vfs_drt_alloc_map()
7202 kret = vfs_drt_get_index(&cmap, offset, &index, 1); in vfs_drt_alloc_map()
7209 DRT_HASH_COPY(ocmap, i, cmap, index); in vfs_drt_alloc_map()
7215 vfs_drt_trace(cmap, DRT_DEBUG_ALLOC, copycount, 0, 0, 0); in vfs_drt_alloc_map()
7222 *cmapp = cmap; in vfs_drt_alloc_map()
7241 vfs_drt_free_map(struct vfs_drt_clustermap *cmap) in vfs_drt_free_map() argument
7245 if (cmap->scm_modulus == DRT_HASH_SMALL_MODULUS) { in vfs_drt_free_map()
7247 } else if (cmap->scm_modulus == DRT_HASH_LARGE_MODULUS) { in vfs_drt_free_map()
7249 } else if (cmap->scm_modulus == DRT_HASH_XLARGE_MODULUS) { in vfs_drt_free_map()
7252 panic("vfs_drt_free_map: Invalid modulus %d", cmap->scm_modulus); in vfs_drt_free_map()
7255 kmem_free(kernel_map, (vm_offset_t)cmap, map_size); in vfs_drt_free_map()
7264 vfs_drt_search_index(struct vfs_drt_clustermap *cmap, u_int64_t offset, int *indexp) in vfs_drt_search_index() argument
7270 index = DRT_HASH(cmap, offset); in vfs_drt_search_index()
7273 for (i = 0; i < cmap->scm_modulus; i++) { in vfs_drt_search_index()
7277 if (DRT_HASH_VACANT(cmap, index)) { in vfs_drt_search_index()
7284 if (DRT_HASH_GET_ADDRESS(cmap, index) == offset) { in vfs_drt_search_index()
7292 index = DRT_HASH_NEXT(cmap, index); in vfs_drt_search_index()
7309 struct vfs_drt_clustermap *cmap; in vfs_drt_get_index() local
7314 cmap = *cmapp; in vfs_drt_get_index()
7317 kret = vfs_drt_search_index(cmap, offset, indexp); in vfs_drt_get_index()
7324 index = DRT_HASH(cmap, offset); in vfs_drt_get_index()
7327 for (i = 0; i < cmap->scm_modulus; i++) { in vfs_drt_get_index()
7329 if (DRT_HASH_VACANT(cmap, index) || DRT_HASH_GET_COUNT(cmap, index) == 0) { in vfs_drt_get_index()
7330 cmap->scm_buckets++; in vfs_drt_get_index()
7331 if (index < cmap->scm_lastclean) { in vfs_drt_get_index()
7332 cmap->scm_lastclean = index; in vfs_drt_get_index()
7334 DRT_HASH_SET_ADDRESS(cmap, index, offset); in vfs_drt_get_index()
7335 DRT_HASH_SET_COUNT(cmap, index, 0); in vfs_drt_get_index()
7336 DRT_BITVECTOR_CLEAR(cmap, index); in vfs_drt_get_index()
7338 vfs_drt_trace(cmap, DRT_DEBUG_INSERT, (int)offset, i, 0, 0); in vfs_drt_get_index()
7341 cmap->scm_iskips += i; in vfs_drt_get_index()
7342 index = DRT_HASH_NEXT(cmap, index); in vfs_drt_get_index()
7373 struct vfs_drt_clustermap *cmap, **cmapp; in vfs_drt_do_mark_pages() local
7378 cmap = *cmapp; in vfs_drt_do_mark_pages()
7380 vfs_drt_trace(cmap, DRT_DEBUG_MARK | DBG_FUNC_START, (int)offset, (int)length, dirty, 0); in vfs_drt_do_mark_pages()
7387 if (cmap == NULL) { in vfs_drt_do_mark_pages()
7390 vfs_drt_trace(cmap, DRT_DEBUG_MARK | DBG_FUNC_END, 1, 0, 0, 0); in vfs_drt_do_mark_pages()
7395 vfs_drt_trace(cmap, DRT_DEBUG_MARK | DBG_FUNC_END, 2, 0, 0, 0); in vfs_drt_do_mark_pages()
7412 cmap = *cmapp; /* may have changed! */ in vfs_drt_do_mark_pages()
7418 vfs_drt_trace(cmap, DRT_DEBUG_MARK | DBG_FUNC_END, 3, (int)length, 0, 0); in vfs_drt_do_mark_pages()
7433 ecount = DRT_HASH_GET_COUNT(cmap, index); in vfs_drt_do_mark_pages()
7436 if (!DRT_HASH_TEST_BIT(cmap, index, pgoff + i)) { in vfs_drt_do_mark_pages()
7438 … panic("ecount >= DRT_BITVECTOR_PAGES, cmap = %p, index = %d, bit = %d", cmap, index, pgoff + i); in vfs_drt_do_mark_pages()
7440 DRT_HASH_SET_BIT(cmap, index, pgoff + i); in vfs_drt_do_mark_pages()
7445 if (DRT_HASH_TEST_BIT(cmap, index, pgoff + i)) { in vfs_drt_do_mark_pages()
7447 panic("ecount <= 0, cmap = %p, index = %d, bit = %d", cmap, index, pgoff + i); in vfs_drt_do_mark_pages()
7450 DRT_HASH_CLEAR_BIT(cmap, index, pgoff + i); in vfs_drt_do_mark_pages()
7456 DRT_HASH_SET_COUNT(cmap, index, ecount); in vfs_drt_do_mark_pages()
7465 vfs_drt_trace(cmap, DRT_DEBUG_MARK | DBG_FUNC_END, 0, setcount, 0, 0); in vfs_drt_do_mark_pages()
7532 struct vfs_drt_clustermap *cmap; in vfs_drt_get_cluster() local
7542 cmap = *cmapp; in vfs_drt_get_cluster()
7545 for (offset = 0, j = 0; j < cmap->scm_modulus; offset += (DRT_BITVECTOR_PAGES * PAGE_SIZE), j++) { in vfs_drt_get_cluster()
7546 index = DRT_HASH(cmap, offset); in vfs_drt_get_cluster()
7548 if (DRT_HASH_VACANT(cmap, index) || (DRT_HASH_GET_COUNT(cmap, index) == 0)) { in vfs_drt_get_cluster()
7556 if (DRT_HASH_TEST_BIT(cmap, index, i)) { in vfs_drt_get_cluster()
7564 cmap, index, DRT_HASH_GET_COUNT(cmap, index)); in vfs_drt_get_cluster()
7567 if (!DRT_HASH_TEST_BIT(cmap, index, i)) { in vfs_drt_get_cluster()
7573 offset = DRT_HASH_GET_ADDRESS(cmap, index) + (PAGE_SIZE * fs); in vfs_drt_get_cluster()
7576 cmap->scm_lastclean = index; in vfs_drt_get_cluster()
7582 vfs_drt_trace(cmap, DRT_DEBUG_RETCLUSTER, (int)offset, (int)length, 0, 0); in vfs_drt_get_cluster()
7590 vfs_drt_trace(cmap, DRT_DEBUG_SCMDATA, in vfs_drt_get_cluster()
7591 cmap->scm_modulus, in vfs_drt_get_cluster()
7592 cmap->scm_buckets, in vfs_drt_get_cluster()
7593 cmap->scm_lastclean, in vfs_drt_get_cluster()
7594 cmap->scm_iskips); in vfs_drt_get_cluster()
7596 vfs_drt_free_map(cmap); in vfs_drt_get_cluster()
7606 struct vfs_drt_clustermap *cmap; in vfs_drt_control() local
7612 cmap = *cmapp; in vfs_drt_control()
7617 vfs_drt_trace(cmap, DRT_DEBUG_SCMDATA, in vfs_drt_control()
7618 cmap->scm_modulus, in vfs_drt_control()
7619 cmap->scm_buckets, in vfs_drt_control()
7620 cmap->scm_lastclean, in vfs_drt_control()
7621 cmap->scm_iskips); in vfs_drt_control()
7623 vfs_drt_free_map(cmap); in vfs_drt_control()
7628 cmap->scm_lastclean = 0; in vfs_drt_control()
7642 vfs_drt_trace(__unused struct vfs_drt_clustermap *cmap, int code, int arg1, int arg2, int arg3, int… in vfs_drt_trace() argument
7648 vfs_drt_trace(__unused struct vfs_drt_clustermap *cmap, __unused int code, in vfs_drt_trace() argument
7661 vfs_drt_sanity(struct vfs_drt_clustermap *cmap)
7666 for (index = 0; index < cmap->scm_modulus; index++) {
7667 if (DRT_HASH_VACANT(cmap, index)) {
7672 if (DRT_HASH_TEST_BIT(cmap, index, i)) {
7676 if (bits_on != DRT_HASH_GET_COUNT(cmap, index)) {
7689 struct vfs_drt_clustermap *cmap; in vfs_get_scmap_push_behavior_internal() local
7695 cmap = *cmapp; in vfs_get_scmap_push_behavior_internal()
7697 if (cmap->scm_modulus == DRT_HASH_XLARGE_MODULUS) { in vfs_get_scmap_push_behavior_internal()