Lines Matching refs:mctx

173 				bitmap_set(srgn->mctx->ppn_dirty, srgn_offset,  in ufshpb_iterate_rgn()
244 if (unlikely(!srgn->mctx)) { in ufshpb_test_ppn_dirty()
261 if (find_next_bit(srgn->mctx->ppn_dirty, bit_len + srgn_offset, in ufshpb_test_ppn_dirty()
284 struct ufshpb_map_ctx *mctx, int pos, in ufshpb_fill_ppn_from_page() argument
299 page = mctx->m_page[index]; in ufshpb_fill_ppn_from_page()
417 err = ufshpb_fill_ppn_from_page(hpb, srgn->mctx, srgn_offset, 1, &ppn); in ufshpb_prep()
505 map_req->rb.mctx = srgn->mctx; in ufshpb_get_map_req()
533 if (!srgn->mctx) { in ufshpb_clear_dirty_bitmap()
543 bitmap_zero(srgn->mctx->ppn_dirty, num_entries); in ufshpb_clear_dirty_bitmap()
596 if (!srgn->mctx) { in ufshpb_activate_subregion()
699 ret = bio_add_pc_page(q, map_req->bio, map_req->rb.mctx->m_page[i], in ufshpb_execute_map_req()
733 struct ufshpb_map_ctx *mctx; in ufshpb_get_map_ctx() local
737 mctx = mempool_alloc(ufshpb_mctx_pool, GFP_KERNEL); in ufshpb_get_map_ctx()
738 if (!mctx) in ufshpb_get_map_ctx()
741 mctx->m_page = kmem_cache_alloc(hpb->m_page_cache, GFP_KERNEL); in ufshpb_get_map_ctx()
742 if (!mctx->m_page) in ufshpb_get_map_ctx()
748 mctx->ppn_dirty = bitmap_zalloc(num_entries, GFP_KERNEL); in ufshpb_get_map_ctx()
749 if (!mctx->ppn_dirty) in ufshpb_get_map_ctx()
753 mctx->m_page[i] = mempool_alloc(ufshpb_page_pool, GFP_KERNEL); in ufshpb_get_map_ctx()
754 if (!mctx->m_page[i]) { in ufshpb_get_map_ctx()
756 mempool_free(mctx->m_page[j], ufshpb_page_pool); in ufshpb_get_map_ctx()
759 clear_page(page_address(mctx->m_page[i])); in ufshpb_get_map_ctx()
762 return mctx; in ufshpb_get_map_ctx()
765 bitmap_free(mctx->ppn_dirty); in ufshpb_get_map_ctx()
767 kmem_cache_free(hpb->m_page_cache, mctx->m_page); in ufshpb_get_map_ctx()
769 mempool_free(mctx, ufshpb_mctx_pool); in ufshpb_get_map_ctx()
774 struct ufshpb_map_ctx *mctx) in ufshpb_put_map_ctx() argument
779 mempool_free(mctx->m_page[i], ufshpb_page_pool); in ufshpb_put_map_ctx()
781 bitmap_free(mctx->ppn_dirty); in ufshpb_put_map_ctx()
782 kmem_cache_free(hpb->m_page_cache, mctx->m_page); in ufshpb_put_map_ctx()
783 mempool_free(mctx, ufshpb_mctx_pool); in ufshpb_put_map_ctx()
910 ufshpb_put_map_ctx(hpb, srgn->mctx); in ufshpb_purge_active_subregion()
912 srgn->mctx = NULL; in ufshpb_purge_active_subregion()
1032 srgn->mctx = ufshpb_get_map_ctx(hpb, srgn->is_last); in ufshpb_issue_map_req()
1033 if (!srgn->mctx) { in ufshpb_issue_map_req()
1545 srgn->mctx = ufshpb_get_map_ctx(hpb, srgn->is_last); in ufshpb_init_pinned_active_region()
1547 if (!srgn->mctx) { in ufshpb_init_pinned_active_region()
1563 ufshpb_put_map_ctx(hpb, srgn->mctx); in ufshpb_init_pinned_active_region()
1719 ufshpb_put_map_ctx(hpb, srgn->mctx); in ufshpb_destroy_subregion_tbl()