Lines Matching refs:mctx

174 				bitmap_set(srgn->mctx->ppn_dirty, srgn_offset,  in ufshpb_iterate_rgn()
250 if (unlikely(!srgn->mctx)) { in ufshpb_test_ppn_dirty()
262 if (find_next_bit(srgn->mctx->ppn_dirty, bit_len + srgn_offset, in ufshpb_test_ppn_dirty()
285 struct ufshpb_map_ctx *mctx, int pos, in ufshpb_fill_ppn_from_page() argument
300 page = mctx->m_page[index]; in ufshpb_fill_ppn_from_page()
418 err = ufshpb_fill_ppn_from_page(hpb, srgn->mctx, srgn_offset, 1, &ppn); in ufshpb_prep()
507 map_req->rb.mctx = srgn->mctx; in ufshpb_get_map_req()
535 if (!srgn->mctx) { in ufshpb_clear_dirty_bitmap()
545 bitmap_zero(srgn->mctx->ppn_dirty, num_entries); in ufshpb_clear_dirty_bitmap()
598 if (!srgn->mctx) { in ufshpb_activate_subregion()
697 ret = bio_add_pc_page(q, map_req->bio, map_req->rb.mctx->m_page[i], in ufshpb_execute_map_req()
731 struct ufshpb_map_ctx *mctx; in ufshpb_get_map_ctx() local
735 mctx = mempool_alloc(ufshpb_mctx_pool, GFP_KERNEL); in ufshpb_get_map_ctx()
736 if (!mctx) in ufshpb_get_map_ctx()
739 mctx->m_page = kmem_cache_alloc(hpb->m_page_cache, GFP_KERNEL); in ufshpb_get_map_ctx()
740 if (!mctx->m_page) in ufshpb_get_map_ctx()
746 mctx->ppn_dirty = bitmap_zalloc(num_entries, GFP_KERNEL); in ufshpb_get_map_ctx()
747 if (!mctx->ppn_dirty) in ufshpb_get_map_ctx()
751 mctx->m_page[i] = mempool_alloc(ufshpb_page_pool, GFP_KERNEL); in ufshpb_get_map_ctx()
752 if (!mctx->m_page[i]) { in ufshpb_get_map_ctx()
754 mempool_free(mctx->m_page[j], ufshpb_page_pool); in ufshpb_get_map_ctx()
757 clear_page(page_address(mctx->m_page[i])); in ufshpb_get_map_ctx()
760 return mctx; in ufshpb_get_map_ctx()
763 bitmap_free(mctx->ppn_dirty); in ufshpb_get_map_ctx()
765 kmem_cache_free(hpb->m_page_cache, mctx->m_page); in ufshpb_get_map_ctx()
767 mempool_free(mctx, ufshpb_mctx_pool); in ufshpb_get_map_ctx()
772 struct ufshpb_map_ctx *mctx) in ufshpb_put_map_ctx() argument
777 mempool_free(mctx->m_page[i], ufshpb_page_pool); in ufshpb_put_map_ctx()
779 bitmap_free(mctx->ppn_dirty); in ufshpb_put_map_ctx()
780 kmem_cache_free(hpb->m_page_cache, mctx->m_page); in ufshpb_put_map_ctx()
781 mempool_free(mctx, ufshpb_mctx_pool); in ufshpb_put_map_ctx()
909 ufshpb_put_map_ctx(hpb, srgn->mctx); in ufshpb_purge_active_subregion()
911 srgn->mctx = NULL; in ufshpb_purge_active_subregion()
1036 srgn->mctx = ufshpb_get_map_ctx(hpb, srgn->is_last); in ufshpb_issue_map_req()
1037 if (!srgn->mctx) { in ufshpb_issue_map_req()
1509 srgn->mctx = ufshpb_get_map_ctx(hpb, srgn->is_last); in ufshpb_init_pinned_active_region()
1511 if (!srgn->mctx) { in ufshpb_init_pinned_active_region()
1527 ufshpb_put_map_ctx(hpb, srgn->mctx); in ufshpb_init_pinned_active_region()
1683 ufshpb_put_map_ctx(hpb, srgn->mctx); in ufshpb_destroy_subregion_tbl()